Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to specify the number of master nodes in a Kubernetes HA cluster.
Kubernetes
apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration controlPlaneEndpoint: "loadbalancer.example.com:6443" controllerManager: extraArgs: node-monitor-grace-period: "40s" node-monitor-period: "5s" pod-eviction-timeout: "1m0s" scheduler: extraArgs: leader-elect: "true" --- apiVersion: kubeadm.k8s.io/v1beta3 kind: InitConfiguration nodeRegistration: name: master-1 kubeletExtraArgs: node-labels: "node-role.kubernetes.io/master=" authorization-mode: AlwaysAllow --- apiVersion: kubeadm.k8s.io/v1beta3 kind: JoinConfiguration controlPlane: localAPIEndpoint: advertiseAddress: "192.168.1.10" bindPort: 6443 [1]: 3
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'replicaCount' which is common in Helm charts but not in kubeadm config.
Using 'masterCount' which is not a valid kubeadm key.
✗ Incorrect
The correct key to specify the number of master nodes in kubeadm HA setup is 'replicas'.
2fill in blank
mediumComplete the command to initialize the Kubernetes control plane with high availability.
Kubernetes
kubeadm init --control-plane-endpoint [1] --upload-certs Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a single master node IP instead of the load balancer.
Using localhost which is not accessible externally.
✗ Incorrect
The control plane endpoint should be the load balancer address that fronts the master nodes.
3fill in blank
hardFix the error in the kubeadm join command to add a new control plane node.
Kubernetes
kubeadm join loadbalancer.example.com:6443 --token [1] --discovery-token-ca-cert-hash sha256:abcdef1234567890 --control-plane --certificate-key abcdef1234567890
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incomplete or partial token strings.
Omitting the dot separator in the token.
✗ Incorrect
The token must be in the correct format with a dot separating two parts, e.g., 'abcdef.0123456789abcdef'.
4fill in blank
hardFill both blanks to create a Kubernetes Service manifest for the HA control plane load balancer.
Kubernetes
apiVersion: v1 kind: Service metadata: name: kubernetes namespace: default spec: type: [1] ports: - port: 6443 targetPort: 6443 selector: [2]: master-node
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ClusterIP' which does not expose the service externally.
Using incorrect selector keys like 'app' when 'role' is expected.
✗ Incorrect
The service type for external load balancing is 'LoadBalancer', and the selector key is commonly 'role' to select master nodes.
5fill in blank
hardFill all three blanks to define a Pod Anti-Affinity rule to spread master nodes across failure domains.
Kubernetes
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: [1]
operator: In
values:
- master
topologyKey: [2]
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: [3]
operator: In
values:
- zone-a
- zone-b Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect label keys for roles or topology.
Confusing node labels with pod labels.
✗ Incorrect
The podAntiAffinity key is 'node-role.kubernetes.io/master', topologyKey is 'kubernetes.io/hostname' to spread pods across nodes, and nodeAffinity key is the zone label 'failure-domain.beta.kubernetes.io/zone'.