Skip to content

Part 2: Utilize

This is Part 2 of the exercise that will focus on using cluster overrides to customize add-ons.


What Will You Do

In part 2, you will:

  • View add-on replica count
  • Create a YAML cluster override
  • Create a Helm cluster override
  • Apply cluster blueprint
  • View add-on replica count

Step 1: View Replica Count

In this step, we will view the current replica counts for the previously deployed add-ons.

  • Navigate to the project in your Org where the cluster is located.
  • Select Infrastructure -> Clusters
  • Click "Kubectl" on the cluster card
  • Enter the following command (Note, update the name of the namespace with the namespace you previously created)
kubectl get deployments -n overrides-namepsace

You will see that both the YAML and HELM deployments each have one pod.

Replica Count


Step 2: Create YAML Cluster Override

In this step, we will create a cluster override for the YAML based add-on which will increase the number of pods in the add-on for a specific cluster. The override will not be applied until the blueprint is applied to the cluster.

  • Navigate to the project in your Org where the cluster is located.
  • Select Infrastructure -> Cluster Overrides
  • Select "New Override"
  • Enter a name for the override
  • Select "YAML" for the File Type
  • Click "Create"

YAML Override

Navigate to the "Selectors" section of the window.

  • Select the YAML workload for the Resource Selector
  • Select "Specific Clusters" for the Placement Type
  • Select the cluster where the blueprint was applied

YAML Override

Navigate to the "Override Configuration" section of the window.

  • Select "Upload file manually"
  • Enter the below override
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-yaml
patch:
- op: replace
  path: /spec/replicas
  value: 3
  • Click "Save Changes"

YAML Override


Step 3: Create Helm Cluster Override

In this step, we will create a cluster override for the Helm based add-on which will increase the number of pods in the add-on for clusters with a specific label. The override will not be applied until the blueprint is applied to the cluster.

  • Navigate to the project in your Org where the cluster is located.
  • Select Infrastructure -> Cluster Overrides
  • Select "New Override"
  • Enter a name for the override
  • Select "Helm" for the File Type
  • Click "Create"

Helm Override

Navigate to the "Selectors" section of the window.

  • Select the Helm workload for the Resource Selector
  • Select "Custom Labels" for the Placement Type
  • Select the custom label with the cluster name (rafay.dev/clustername)

Helm Override

Navigate to the "Override Configuration" section of the window.

  • Select "Upload file manually"
  • Enter the below override
replicaCount: 4
  • Click "Save Changes"

Helm Override

You will now see both the YAML and Helm overrides.

Helm Override


Step 4: Apply Blueprint

In this step, we will apply the blueprint to an existing cluster. This time, the cluster overrides will be used which will update the pod counts for the add-on deployments.

  • Navigate to the project in your Org where the cluster is located
  • Select Infrastructure -> Clusters
  • Click the gear icon on the cluster card
  • Select "Update Blueprint"
  • Select the previosuly created blueprint
  • Select the blueprint version
  • Click "Save and Publish"

Apply Blueprint

The blueprint will begin to be applied to the cluster.

Apply Blueprint

The blueprint is now applied to the cluster.

Apply Blueprint


Step 5: View Replica Count

In this step, we will view the current replica counts for the previously deployed add-ons. The pod counts for the add-ons will be higher this time as the cluster overrides were in place.

  • Navigate to the project in your Org where the cluster is located.
  • Select Infrastructure -> Clusters
  • Click "Kubectl" on the cluster card
  • Enter the following command (Note, update the name of the namespace with the namespace you previously created)
kubectl get deployments -n overrides-namepsace

You will that both the YAML and Helm deployemnts each have the same pod count as defined in the cluster overrides.

Replica Count


Recap

Congratulations! You have successfully used cluster overrides to customize the add-on replica count for both YAML and Helm based add-ons.