Azure Kunernetes Service AKS Flashcards

1
Q

What is a cluster preset configuration when deploying a new ALS cluster?

A

A set of configuration templates optimised for a specific cost and performance targets. When deploying a new cluster you can use this as a base to get started.

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

What are the pricing tiers for AKS?

A

Free: only charged for network, storage and vm costs incurred by the cluster , with a maximum
Of around 10 nodes.

Standard: charged for kubernetes control plane and includes autoscaling up to around 5000 nodes.

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

What kubernetes automatic upgrade options are available?

A
  • Enabled with patches
  • Enabled with stable releases
  • Enabled with rapid ( minor)
  • enabled with node image ( don’t update kubernetes but update os)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the concept of node pools?

A

One K8s cluster can have multiple clusters, and different pools have different configurations/ sizes. Each agent pool is used and optimised for a specific type of user defined tasks or applications like back end, front end etc.

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

What are virtual instances/nodes and what is burstable scaling?

A

Burstable scaling uses azure virtual instances which are already inside ready state so they don’t need to be created and provisioned meaning extremely fast scaling up or out.

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

What is the kubernetes cli?

A

It is a cli used to interact with kubernetes clusters. It’s native.

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

What is kubenet?

A

Kubenet is a networking plugin for Kubernetes in Azure, providing a simpler implementation of networking for AKS clusters compared to Azure Container Networking Interface (CNI).

With KubeNet, each node in an AKS cluster is assigned a single IP address in the Azure virtual network, and pods on a node are assigned IP addresses from a logically separate address space. Pod-to-pod communication across nodes requires NAT (Network Address Translation), handled by the node’s IP. This approach can be more straightforward and easier to manage, especially for smaller or simpler deployments.

This can help set up
A smaller cluster more quickly but sacrifices some scaling and performance when compared with Azure CNI

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

What is the azure CNI?

A

Azure CNI (Container Networking Interface) is a plugin that integrates Azure Kubernetes Service (AKS) with Azure’s virtual network (VNet), providing each pod with an IP address from the VNet. This setup allows pods to communicate with each other, and with other services, directly across the VNet without needing NAT, offering improved network performance and simplifying network configuration for services requiring direct access to the network.

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

Can you load balance between cluster pods?

A

Yes

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

What are the network privacy settings available for new cluster deployment?

A
  • enable private cluster
  • set authorised ip ranges
  • network policy (set policies for ingree and egress between pods)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is virus control managed in AKS

A

Microsoft defender is activated by default

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

How can you use custom
Container images as part of your k8s deployments?

A

Connect optionally to azure container registry to store container images there and use them in new pod deployments

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

What is azure monitor ?

A

A centralised way to
Monitor azure resources. It can be configured to monitor your AKS cluster.

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

What is azure policy for AKS?

A

You are allowing azure policies to be translated and used to manage the kubernetes policies. This avoids having multiple different sources and mechanisms of policies.

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

How long does it take to deploy a simple AKS cluster?

A

Depends on many factors but in my test it was finished in less than 4 minutes

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

How do you communicate with the cluster?

A

Using the command line. You can use this button here from the interface of the AKS resource to open cloud shell (which opens as powershell) and then switch to bash in the top left of the cli window.

You then need to ‘az AKS get-credentials —resource-group newaks —name newaks’ to login to the targeted AKS cluster ( you may have many but you need one shell per cluster and that shell has to Haba the appropriate credentials).

You can then begin using the ‘kubectl’ cli tool to issue commands to your cluster.

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

How to list the available nodes using kubectl?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get-nodes

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

How to deploy an app to an AKS cluster?

A
  • press the create button on the AKS azure portal ui for the cluster (see image) for two either apply/create a kubernetes yaml file or create a starter application ( wizard which outputs a k8s yaml file which you can verify in the review yaml step ).
19
Q

How to list the namespaces in an AKS cluster ?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get namespaces

Note:

Namespaces are a way to organize clusters into virtual sub-clusters — they can be helpful when different teams or projects share a Kubernetes cluster. Any number of namespaces are supported within a cluster, each logically separated from others but with the ability to communicate with each other.

essentially, namespaces represent the applications your AKS cluster is running

20
Q

How to list deployments in an AKS cluster?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get deployments -n <namespace></namespace>

Note:

A Kubernetes Deployment is a resource object that provides declarative updates to applications. It enables administrators to describe the application’s life cycle, defining specific images, the desired number of pods, and more. essentially it is the act of updating your yaml file

21
Q

How to list services in an AKS cluster?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get services -n <namespace></namespace>

Note:

A Kubernetes service is a logical abstraction for a deployed group of pods in a cluster (which all perform the same function). Since pods are ephemeral, a service enables a group of pods, which provide specific functions (web services, image processing, etc.) to be assigned a name and unique IP address (clusterIP).

22
Q

How to list nodes in an AKS cluster?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get nodes -n <namespace></namespace>

Note:

A Kubernetes node is a logical collection of IT resources that runs workloads for one or more containers in a Kubernetes cluster. K8s creates the application containers automatically so nodes can be VMs themselves or standard hardware but nodes are not ephemeral.
Se

23
Q

How to list pods in an AKS cluster?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get pods -n <namespace></namespace>

Note:

A Kubernetes pod is a collection of one or more Linux® containers, and is the smallest unit of a Kubernetes application. Any given pod can be composed of multiple, tightly coupled containers (an advanced use case) or just a single container (a more common use case). Containers are grouped into Kubernetes pods in order to increase the intelligence of resource sharing. Pods are used because it allows k8s to share compute resources more intelligently between containers and across the various pods in the cluster.

24
Q

What is the difference between nodes and pods?

A

Pods are like individual application instances and consist of one or more
Linux containers. Nodes are the machines that run these containers, and Cluster holds them all together.

25
Q

In AKS what is the difference between a node and a node pool?

A

In Azure Kubernetes Service (AKS), nodes of the same configuration are grouped together into node pools. These node pools contain the underlying VMs that run your applications. The initial number of nodes and their size (SKU) is defined when you create an AKS cluster, which creates a system node pool.

26
Q

How to get more information about pods from the cli?

A

az AKS get-credentials —resource-group <RG> —name <AKS></AKS></RG>

kubectl get pods -n <namespace> *-o wide*</namespace>

Note:

The -o means output

27
Q

How can you scale out your k8s applications?

A

Assuming you have sufficient availability of resources in your cluster, you can use the command:

*kubectl scale —replicas=<2> deployment/<deployment> -n <name>*</name></deployment>

…where N is the number of replicas you want.

28
Q

What happens if you scale the number of applications to a number that is higher than the number of your available nodes?

A

Multiple replicas will run simultaneously on the same server.

29
Q

Scaling and creating/removing replicas are are different in terms of cost. How so?

A

Scaling deploys new VMs. Auto scaling incurs the cost of the vm resources whereas increasing the number of replicas will run more application containers on the existing nodes and so may have a performance impact depending on the resources demanded by the application but will not incur additional costs.

30
Q

What kind of storage does an AKS cluster pod have?

A

Ephemeral- it lasts by default as long as the pod. Volumes can be used to set up persistent storage.

31
Q

What type of azure storage can be used to create a volume?

A
  • Azure disks ( only single node read write once access mode)
  • Azure files (smb 111 or nfs 4.1 fileshare, multi node and pod access, add or magnetic disk )
  • Azure net app files (seems like premium cross platform but no obvious distinction between other premium volume types)
  • Azure blobs (nfs 3 block blob)
32
Q

What types of volume exist for AKS clusters?

A
  • Empty dir ( regular file system)
  • secret ( secret filesystem only ever written to volatile storage for confidential data storage)
  • Config map ( key value)
33
Q

How to create a persistent volume?

A
  • define storage class
  • configure persistent volume claim using defined storage class
  • create persistent volume claim in AKS application yaml to provision the volume
  • attach the volume to the pod
34
Q

How would you define a storage class yaml for k8s?

A
35
Q

What is the reclaim policy property in a storage class AKS yaml?

A

That is an option setting the storage as persistent or not. If set to ‘reclaimPolicy: Retain’ then the storage will not be repurposed after a pod has finished accessing it and is therefore persistent

36
Q

What is the kubectl command to apply the changes of a yaml file to an AKS cluster?

A

Kubectl apply -f <yourfile.yaml></yourfile.yaml>

37
Q

How would you make a persistent storage claim in an AKS application yaml?

A
38
Q

How would you attach your pod to a volume for which you have created a persistent volume claim?

A
39
Q

What is the relationship between a storage class, a persistent volume claim and an application yaml?

A

The storage class defines the type of storage , its function and performance, where it comes from etc.

A persistent volume claim then uses storage class and requests a specific amount of that storage type.

The application yaml can then use the persistent volume claim and mount it on the container device(s).

40
Q

What Linux distributions are available as part of WSL (windows subsystem for Linux)?

A

Ubuntu
Opensuse
Kali
Debian
Arch

41
Q

How to install WSL on windows?

A

In powershell you’re the command ‘wsl —install’

42
Q

How to update WSL?

A

Type the powershell command ‘wsl —update’

43
Q

How to list wsl processes and their status?

A

wsl -l -v