Quickstart: Auto generating Kubernetes Manifests with K8s Initializer
Tags: kubernetes, devops, cloud, git
Published: 2022-07-13 11:09:26

Creating and managing Kubernetes Manifests can be a pain and let’s be honest, no one actually ever remembers the syntax of a Manifest without either looking at one they already created or Googling it. Because the idea of memorizing every list, map, and style of configuration for a Manifest isn’t exactly necessary, you can automate the process. Although there are a few different ways to do this, a popular choice within the engineering community is K8s Initializer by Ambassador Labs.

In this blog post, you’ll learn what K8s Initializer is and how to get started with it.

## What Is K8s Initializer

The idea behind K8s Initializer is to have a production-level Kubernetes environment that is built in an automatic fashion. When you’re building a Kubernetes environment, there’s a lot of configuration that needs to happen to get it production-ready. Although K8s Initialize doesn’t cover everything you need for a production-ready environment, it does cover a lot of the important aspects of a production environment including:

- Observability
- Knative if you want Serverless
- ArgoCD
- Consul for Service Mesh
- Ambassador Edge Stack for Ingress
- Keycloak for Auth

For example, there’s an option to enable ArgoCD if you want to run a GitOps workflow.

Underneath the hood, K8s Initializer is essentially creating a bunch of Custom Resource Definitions (CRD) to extend the Kubernetes API to use the tools listed on the K8s Initializer setup page, like ArgoCD and Prometheus.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kup6js9msjutk2kslvda.png) 

The goal with K8s Initializer is to save you time. For example, the screenshot below shows an output that tells you how many lines of YAML you’d have to write to get the same configuration you get from K8s Initializer if you didn’t use it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cx0fnmgbbz5v8m3l2zz4.png) 

## Getting Started With K8s Initializer

Now that you know what K8s Initializer is and its purpose, let’s learn how to use it in a step-by-step fashion.

1. Go to [https://app.getambassador.io/initializer](https://app.getambassador.io/initializer)

You’ll come up to a page similar to the screenshot below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/auhiqn1edz9yvot8d6o8.png) 

2. You’ll have a few options to choose from, including where your Kubernetes cluster is located and other production-ready settings.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yd0e4nvu2tyt5n60gyrh.png) 

3. For simplicity, use the dropdown under Step 1 and choose **Minikube** along with selecting **No, don’t terminate TLS**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngaewfpfzceipc6wu4hn.png) 

4. Depending on your use case, there are several options around observability, automation, and security. Feel free to pick and choose if you’d like any of these options, or skip doing it to keep the configuration simple.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t2dzwyn6gp2icwifagur.png) 

5. Click the blue **Review and Install** button.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whbfqvchc7b9e1j54q8c.png) 

6. You’ll see several options on how to install the Kubernetes Manifest, including:
    1. From Ambassador via `kubectl apply`
    2. From Helm
    3. By downloading the Kubernetes Manifest manually and running it from `localhost`

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0e5dlskf8265dpyvbc0.png) 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sv1tg7qc4gxqxzk3wmjv.png) 

Looking at the Kubernetes Manifest files, you can see the underlying code of what K8s Initializer creates. For example, below is a screenshot of it creating a Deployment for Consul Service Mesh.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oq2bwqafhlglorgmvy1f.png)

Congrats! You've officially auto-generated a Kubernetes Manifest with K8s Initializer.