Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Create Your First Kubernetes Operator

Hey, Gurus! Welcome to this hands-on lab. In this lab, we will take what we have learned and build our Kubernetes operator.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 45m
Published
Clock icon Dec 02, 2022

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create the Operator Project

    1. Create the operator project directory called memcached-operator in a directory called projects.
    2. Move into the operator project directory that you just created.
    3. Set your GOPATH and enable the Go modules.
    4. Initialize your operator project directory.
  2. Challenge

    Create the API and Controller

    1. Create the API and controller.

      Note: Remember you will need to use additional flags for the memcached image as follows: --plugins="deploy-image/v1-alpha" --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,modern,-v" --run-as-user="1001"

    2. Edit the api/v1alpha1/memcached_types.go file.
    3. Change the validation marker for the maximum nodes that can be run from 3 to 5.
    4. Update the code.
    5. Generate the CRD manifests and RBAC manifests.
  3. Challenge

    Deploy the Operator

    1. Log in to Docker Hub from the command line.
    2. Create an enviroment variable for your image.
    3. Make the operator image.
    4. Push your operator image to Docker Hub.
    5. Deploy your operator image to the cluster.
    6. Verify that your image was deployed.
  4. Challenge

    Create the Memcached Custom Resource

    1. Create the memcached custom resource from the cache_v1alpha1_memcached.yaml sample file and change the size from 1 to 3.
    2. Apply your CR to the cluster.
    3. Verify the deployment.
    4. Edit the CR and change the size from 3 to 5.
    5. Apply the changes to the CR.
    6. Verify the changes to test and complete the lab.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans