Customizing Installation

    To get started, save the output of install to a YAML file. This will be the base resource that Kustomize uses to patch and generate what is added to your cluster.

    Note

    When upgrading, make sure you populate this file with the content from linkerd upgrade. Using the latest kustomize releases, it would be possible to automate this with an exec plugin.

    Next, create a kustomization.yaml file. This file will contain the instructions for Kustomize listing the base resources and the transformations to do on those resources. Right now, this looks pretty empty:

    1. resources:
    2. - linkerd.yaml

    Now, let’s look at how to do some example customizations.

    Kustomize allows as many patches, transforms and generators as you’d like. These examples show modifications one at a time but it is possible to do as many as required in a single kustomization.yaml file.

    There are a couple components in the control plane that can benefit from being associated with a critical PriorityClass. While this configuration isn’t currently supported as a flag to linkerd install, it is not hard to add by using Kustomize.

    First, create a file named priority-class.yaml that will create define a PriorityClass resource.

    1. apiVersion: scheduling.k8s.io/v1
    2. kind: PriorityClass
    3. metadata:
    4. name: linkerd-critical
    5. value: 1000000000

    Note

    1000000000 is the max. allowed user-defined priority, adjust accordingly.

    Then, add this as a strategic merge option to kustomization.yaml:

    1. resources:
    2. - priority-class.yaml
    3. patchesStrategicMerge:

    Applying this to your cluster requires taking the output of kustomize build and piping it to kubectl apply. For example you can run:

    1. kubectl kustomize build . | kubectl apply -f -

    Modify Grafana Configuration

    Interested in enabling authentication for Grafana? It is possible to modify the ConfigMap as a one off to do this. Unfortunately, the changes will end up being reverted every time linkerd upgrade happens. Instead, create a file named grafana.yaml and add your modifications:

    Then, add this as a strategic merge option to kustomization.yaml:

    1. resources:
    2. - linkerd.yaml
    3. patchesStrategicMerge:

    Finally, apply this to your cluster by generating YAML with kustomize build and piping the output to .

    1. kubectl kustomize build . | kubectl apply -f -