Implement IaaS solutions, Containers Flashcards

1
Q

What is ACR Tasks

A

Basic Answer: Using Dockerfile and additional yaml definition files to automate the process of creation, deployment and push to azure registry. Can be used on shell, therefore good for Build Jobs as well.

From Docs:
ACR Tasks is a suite of features within Azure Container Registry that provides streamlined and efficient Docker container image builds in Azure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is meant by Fabric Clusters

A

A Service Fabric cluster is a network-connected set of virtual or physical machines into which your microservices are deployed and managed. A machine or VM that is part of a cluster is called a cluster node. Clusters can scale to thousands of nodes. If you add new nodes to the cluster, Service Fabric rebalances the service partition replicas and instances across the increased number of nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to make a container from an app and then push to Azure

A

1) On Dev Machine docker build to create a new image from dockerfile, use -t to tag it
2) Create container Registry when not existing (az acr create)
3) Sign into acr with az acr login
4) Tag the image within the loginServer
5) Use docker push from 4)
https: //docs.microsoft.com/en-us/azure/service-fabric/service-fabric-tutorial-create-container-images?WT.mc_id=thomasmaurer-blog-thmaure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

CLI Command to Create Azure Container Registry

A

az acr create –resource-group –name –sku Basic –admin-enabled true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does command ‘yo azuresfcontainer’ do?

A

When installed correctly, yo stands for the command line tools coming with Yeoman. Microsoft has written a generator for Yeoman that creates a service fabric application template.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the general process of creating a Service Fabric form an image?

A

1) Installing Yeoman
2) Run “yo azuresfcontainer”
3) Type in some config
4) Specify the image tag you want to use
5) Specify instance count, start with 1 usually

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In Container Context, what is ServiceManifest.xml used for

A

Like Similar xml syntax to configure Endpoints of services within a container, like scheme and port and protocol
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-tutorial-package-containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In container context, what is ApplicationManifest.xml used for

A

In order to expose the containers in the cluster, we also need to create a port binding in the ‘ApplicationManifest.xml’. The PortBinding policy references the Endpoints we defined in the ServiceManifest.xml files. Incoming requests to these endpoints get mapped to the container ports that are opened and bounded here.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is required to deploy a Application so that it can run as a Service Fabric?

A

To deploy the application to Azure, you need a Service Fabric cluster to run the application. Each instance within the cluster is called node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Syntax to select a service cluster via shell?

A

Command requires Service Fabric CLI

sfctl cluster select –endpoint https://containertestcluster.eastus.cloudapp.azure.com:19080 –pem containertestcluster22019013100.pem –no-verify

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Azure Container Instances

A

Basically a host for container.

From Docs:
Azure Container Instances enables deployment of Docker containers onto Azure infrastructure without provisioning any virtual machines or adopting a higher-level service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is meant by container replication?

A

Basically use an image/tag of container in different azure regions or mulitiple regions.

To copy a complete container registry:
az acr replication create –registry –location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or false? Container Replication View can be looked up in Azure Portal

A

True,From within the Azure portal, selecting Replications for an Azure Container Registry displays a map that details current replications. Container images can be replicated to additional regions by selecting the regions on the map.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

True of False? Container replication is possible by using the Portal and CLI?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following is not a benefit of using Azure Container Registry?

  • Replicate container images to multiple Azure datacenters.
  • Pull container images using any Docker container-related technology.
  • Allow public access to container images for pull operations.
  • Build container images without the need for locally installed Docker tools.
A

Allow public access to container images for pull operations.

Azure Container Registry is a private registry. Images cannot be accessed without authentication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the recommended authentication method for Azure Container Registry?

  • Admin account
  • Username and password

Azure service principal

No authentication

A

Azure service principal

Azure service principals are the recommended authentication method. They provide granular access to container images in Azure Container Registry; for example, you can specify read-only access or full access to the container registry.

17
Q

Suppose you use container images to run compute workloads in multiple regions throughout the world. You plan to enable the geo-replication feature of Azure Container Registry to decrease the time required to provision an instance. In which regions should you configure the Azure Container Registry geo-replication feature?

  • Place a container registry in the region closest to your development team.
  • Place a container registry in each region where images are run.
  • Place a container registry in every Azure region.
A

Place a container registry in each region where images are run.

Placing a registry in each region that runs the images will ensure network-close registry access everywhere it is needed.

18
Q

In general, what is Azure Container Registry

A

Hosts container images, similar to Docker Hub. But only private images.

From Docs:
An Azure container registry stores and manages private Docker container images, similar to the way Docker Hub stores public Docker images. You can use the Docker command-line interface (Docker CLI) for login, push, pull, and other operations on your container registry.

19
Q

How does a basic Dockerfile looks like?

A

Every Dockerfile must start with the FROM instruction. The idea behind is that you need a starting point to build your image. You can start FROM scratch, scratch is an explicitly empty image on the Docker store that is used to build base images like Alpine, Debian and so on. Everything else is addon, modifiny the image

FROM node:8.9.3-alpine
RUN mkdir -p /usr/src/app
COPY ./app/ /usr/src/app/
WORKDIR /usr/src/app
RUN npm install
CMD node /usr/src/app/index.js
20
Q

What is an Docker alias?

A

A Tag

21
Q

What is another Name for a Docker Tag

A

An Alias

22
Q

What is the Syntax for creating a Docker Tag

A

docker tag

23
Q

Required Docker Format for Pushing Tags? Specifically the naming for Tags.

A

[loginUrl]/[namespace]/[artifact:][tag]

24
Q

What is required for a container instance to be exposed to hte internet?

A

A DNS Name. The DNS name must be unique.

25
Q

How to specify the DNS name for a Container using CLI

A

–dns-name-label parameter

26
Q

What are container restart policies?

A

Restart policies define how Containers should be restarted.

  • Always (Default), good for long running tasks like web servers
  • Never, containers run one time only
  • OnFailure, for short tasks. Run at least once and restarted when exit code != 0
27
Q

What is the initial Stauts for Containers with restart policy Never or OnFailure

A

Terminated

28
Q

What is az container logs used for

A

View the logs within a container

29
Q

Ho to pass arguments to a container during start

A

Use –environment-variables arg of command az container create

30
Q

How to pass secure arguments during container start

A

Use –secure-environment-variables instead of –environment-variables

31
Q

What are container data volumes

A

By default, Azure Container Instances are stateless. If the container crashes or stops, all of its state is lost. To persist state beyond the lifetime of the container, you must mount a volume from an external store.

32
Q

Common Steps to create a azure storage for containers?

A

1) Create a storage account
2) Copy the connection string of storage account to AZURE_STORAGE_CONNECTION_STRING, using export command
3) Get Storage Key
4) Deploy Container and mount the file share using vairous –azure-file-volume- parameters for az container create command

33
Q

What is AZURE_STORAGE_CONNECTION_STRING

A

A special azure environment variable to store connection strings, understood by Azure CLI

34
Q

How to troubleshoot container instances

A

1) Get logs with az container logs
2) Get diagnostics with az container attach
3) Run az container exec to run programs direclty in the container, for example start /bin/sh to use ls to list folder content

35
Q

What does ‘az monitor metrics list’ do?

A

List CPU and memory usage on your container, its required to get a CONTAINER_ID

36
Q

Which restart policy is typically the best choice for long-running tasks that service requests?

A

Always

The restart policy Always will ensure needed processes continue to be available even if a restart is required.

37
Q

True or false: by default, the values of an environment variable can be seen in the Azure portal and the Azure CLI output.

A

True

38
Q

Which troubleshooting command can be used to view container startup events?

  • az container logs
  • az container attach
  • az container exec
A

az container attach

The az container attach command shows container events and logs. By contrast, the az container logs only shows the logs and not the startup events.

39
Q

What is Azure Container Instances?

A

Containers are becoming the preferred way to package, deploy, and manage cloud applications. Azure Container Instances offers the fastest and simplest way to run a container in Azure, without having to manage any virtual machines and without having to adopt a higher-level service.