Challenge - 5 Problems
Operator SDK Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Operator SDK: Initializing a new operator project
What is the output when you run
operator-sdk init --domain=example.com --repo=github.com/example/memcached-operator in an empty directory?Attempts:
2 left
💡 Hint
The init command sets up the project structure and Go modules for a new operator.
✗ Incorrect
The operator-sdk init command creates a new operator project with the specified domain and repository path. It initializes Go modules and creates folders like api and controllers for further development.
🧠 Conceptual
intermediate1:30remaining
Understanding Operator SDK project structure
Which folder in an Operator SDK Go project contains the Custom Resource Definitions (CRDs) and API types?
Attempts:
2 left
💡 Hint
Think about where you define the schema and types for your custom resources.
✗ Incorrect
The api folder contains the API definitions and Custom Resource Definitions (CRDs) for the operator. It holds the Go structs that define the custom resource schema.
🔀 Workflow
advanced2:00remaining
Operator SDK: Adding a new API version
You want to add a new version v2 to your existing API group memcached.example.com. Which command correctly adds this new version?
Attempts:
2 left
💡 Hint
Use the command that creates API and controller code for a new version.
✗ Incorrect
The create api command adds a new API version and generates resource and controller code. The init command is for project creation, and generate api is not a valid command.
❓ Troubleshoot
advanced2:30remaining
Operator SDK: Debugging a failed operator build
You run
make docker-build but get an error: cannot find module providing package sigs.k8s.io/controller-runtime. What is the most likely cause?Attempts:
2 left
💡 Hint
Check if your Go dependencies are correctly set up before building.
✗ Incorrect
The error indicates missing Go dependencies. This usually happens if go.mod or go.sum files are missing or if 'go mod tidy' was not run to fetch dependencies.
✅ Best Practice
expert3:00remaining
Operator SDK: Recommended way to test your operator locally
Which approach is the best practice to test your Operator SDK Go operator locally before deploying to a Kubernetes cluster?
Attempts:
2 left
💡 Hint
Local testing usually involves running the operator process directly connected to a test cluster.
✗ Incorrect
Running the operator binary locally with 'make run' allows you to debug and test your operator against a local Kubernetes cluster like kind or minikube before building and deploying images.