Tutorial to learn the basics about creating a Kubernetes operator.
Most of the content is copied from the work done by Abby Bangser for this talk:
- The slides of the talk.
- The online tutorial.
- The instruqt track of the online tutorial.
- The source code of the instruqt track.
I found this tutorial quite helpful so I wanted to document it here.
As the original work is licensed under the MIT license, I'll use the same license for this repository.
💡 This tutorial assumes that you have three terminal tabs open: •
K8S Shell
: A terminal to run quick responding commands. •Run Shell
: A terminal to run commands that take long time. •Code editor
: A terminal to edit files. You can use a GUI text editor instead.
This tutorial is divided in several chapters, each of them into a different subdirectory containing:
- The
README.md
file with documentation and exercises. - The
demo
directory with the source code ready to complete the exercises.
Chapters:
- Setup environment
- Generate application scaffolding
- Generate a new operator and custom resource
- Install the new crd on kubernetes
- Understand the new operator by adding logs
- Use data defined in the crd within the operator
- Deploy your website from the operator
- View your website by including a service
- Gracefully detect an update request
- Update the deployment when imagetag changes
- Delete a website deployment
- Bonus: Deploy operator to kubernetes
⬅️ ➡️