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

Test a Dynamic Admission Controller with Terraform

In this lab, you will be asked to test the dynamic admission controller with test pods that you will create and deploy with Terraform. Two of the pods will have labels that will match the validating webhooks policy, and one of the test pods will not.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 1h 30m
Clock icon Apr 20, 2023

Contact sales

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

Table of Contents

  1. Challenge

    Lab Setup

    1. Move to the validating-admission-webhook directory.

    2. Create an access key in the AWS Management Console.

      Note: You need to copy the access key ID and secret key somewhere safe and accessible for the next step.

    3. Make the script executable.

    4. Run the script.

      Note: This script will run for about 10–15 minutes.

  2. Challenge

    Create and Deploy the Webhook

    1. Move to the validating-webhook directory.

    2. Log in to Docker Hub from the command line.

    3. Update the Makefile with your Docker Hub username.

    4. Build the webhook.

      Note: This can take 5–10 minutes.

    5. Build the Docker image.

    6. Push the Docker image to Docker Hub.

    7. Deploy the certs.

    8. Deploy the validating webhook.

  3. Challenge

    Create and Deploy the Test Pods with Terraform

    1. Create a directory called test-pods.

    2. Move to the test-pods directory.

    3. Create three test pods called test-app-1 , test-app-2, and test-app-3, and add a label called hello = "world" to test-app-2 and hello = "universe" to test-app-3.

    4. Initialize your working directory.

    5. Apply the webhook configuration.

  4. Challenge

    Confirm the Dynamic Admission Controller Is Working

    1. Confirm that your validating webhook is working:
      • test-app-1 should error and not deploy.
      • test-app-2 and test-app-3 should deploy without issue.

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