How to change the deployed Kubernetes resources from the release name to it’s actual service name

image
How to change the deployed Kubernetes resources from the release name to its actual service name?

Usecase:

  1. I don’t need to change the release name of an infrastructure definition. I need to change the deployed Kubernetes resources from the release name to its service name. Release names can be unique to a cluster but not services.
  2. I would expect this configuration to reside in the service configuration or pipeline, not the environment/infrastructure.

As part of this article, we will answer how to achieve this usecase:

  • The harness doesn’t control the resource’s name. Whatever the user configures in their manifest will be deployed to the cluster. If you are using it as part of your helm chart:
apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}
...

It will work if it matches the release’s name.

  • If you want to have a constant name, then you should use instead:
apiVersion: v1
kind: Service
metadata:
  name: grafana

If you notice the tooltip in the manifest section of the service customization screen. It leads you to this video: Using Values YAML files, Kustomize Patches, and OpenShift Templates in single and multiple repos. - YouTube.

So this is how you can change the deployed Kubernetes resources from the release name to its actual service name.

1 Like