Hey there! We are using octopus for deploying our containers to K8S , lately all the deployments are failing with following errors:
The Deployment "xxx-api" is invalid:
September 10th 2020 15:22:40Error
* spec.template.spec.containers[0].env[1].valueFrom.secretKeyRef.name: Invalid value: "#{Octopus.Action.KubernetesContainers.ComputedSecretName}": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
September 10th 2020 15:22:40Error
* spec.template.spec.containers[0].env[2].valueFrom.secretKeyRef.name: Invalid value: "#{Octopus.Action.KubernetesContainers.ComputedSecretName}": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
The references are defined as Variables and then translated to the manifest using {Octopus.Action.KubernetesContainers.ComputedSecretName}
eg.
- name: MessageBus__EndpointName
valueFrom:
configMapKeyRef:
name: '#{Octopus.Action.KubernetesContainers.ComputedConfigMapName}'
key: MessageBus__EndpointName
Octopus server used : https://octopus.com/downloads/2020.4.0-rc0005
We are not able to find the root cause of this error and need assistance there.
Best Regards
Denis Pesikov