0
0
Kubernetesdevops~20 mins

Database operators example in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Database Operator Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of a Database Operator in Kubernetes?

In Kubernetes, a Database Operator helps manage database lifecycle. What is its main job?

AAutomatically manage database deployment, backups, scaling, and updates
BOnly monitor database performance without making changes
CReplace the Kubernetes scheduler for database pods
DServe as a database client to query data
Attempts:
2 left
💡 Hint

Think about automation tasks related to databases in Kubernetes.

💻 Command Output
intermediate
1:30remaining
Output of checking PostgreSQL Operator pods status

You run the command kubectl get pods -n postgres-operator after installing a PostgreSQL Operator. What output indicates the operator is running correctly?

Kubernetes
kubectl get pods -n postgres-operator
AError from server (NotFound): namespaces "postgres-operator" not found
Bpostgres-operator-abc123 1/1 Running 0 2m
CNo resources found in postgres-operator namespace.
Dpostgres-operator-abc123 0/1 CrashLoopBackOff 3 2m
Attempts:
2 left
💡 Hint

Look for pods with all containers ready and status Running.

Configuration
advanced
2:00remaining
Correct Custom Resource for a MySQL Cluster using an Operator

Which YAML snippet correctly defines a MySQL cluster custom resource for a MySQL Operator?

A
apiVersion: mysql.oracle.com/v1alpha1
kind: MySQLCluster
metadata:
  name: my-mysql
spec:
  replicas: 3
  version: "8.0"
B
apiVersion: mysql.oracle.com/v1alpha1
kind: Cluster
metadata:
  name: my-mysql
spec:
  replicas: 3
  version: "8.0"
C
apiVersion: mysql.oracle.com/v1alpha1
kind: MySQL
metadata:
  name: my-mysql
spec:
  nodes: 3
  version: "8.0"
D
apiVersion: mysql.oracle.com/v1alpha1
kind: Cluster
metadata:
  name: my-mysql
spec:
  nodes: 3
  version: "8.0"
Attempts:
2 left
💡 Hint

Check the kind field for the correct resource type the operator expects.

Troubleshoot
advanced
2:00remaining
Troubleshooting a Failed Backup Job in a Database Operator

A backup job created by your database operator fails with the error 'permission denied'. What is the most likely cause?

AThe database cluster has no replicas
BThe database operator pod is not running
CThe service account used by the backup job lacks permissions to access the storage location
DThe Kubernetes API server is down
Attempts:
2 left
💡 Hint

Consider what permissions are needed for backup jobs to write data.

🔀 Workflow
expert
2:30remaining
Order the steps to deploy a database using an Operator in Kubernetes

Put the following steps in the correct order to deploy a database using an Operator.

A3,1,2,4
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about installing the operator first before creating and applying resources.