Deploy containers to Kubernetes is failing

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

Hi @denis.pesikov!

Thanks for reaching out, and sorry to hear you’re having issues with this. We had this error spring up in our most recent Octopus cloud build, and we’re in the process of building a new version to correct this. We hope to have the rollout of the fixed version across the cloud fleet starting ASAP.

In the meantime, you can work around this issue by manually creating those computed variables, as noted in the issue link above:

This should get you back up and deploying until the fix hits your instance.

Apologies for the inconvenience caused by this bug.

Hello Justin. Thank you for your reply.
Do you have a specific eta for rolling out the fix?
Kind regards
Denis

@Justin_Walsh would this also be affecting variable substitutions for raw kubernetes yaml? been having issues for the past 20 hours or so… for example when trying to do variable substitution on containerName:#{Octopus.Release.Number} in a yaml file packaged with nuget.

thanks!

Luis

@denis.pesikov The fixed version should start rolling out on Monday, so you should expect it early next week as it rolls out across each instance in their maintenance window.

@luis.echegaray It might be tangentially-related, I’ll spin up a repro on my cloud instance to see.

@Justin_Walsh I’m on Octopus Deploy Cloud. I have just noticed this occurring for all YAML substitutions ‘#{EXAMPLE VARIABLE}’ in my raw K8s yaml manifests. My last successful deploy was 7th September (Server version 2020.4.0-rc.4+Branch.release-2020.4.Sha.125f0084e14f58c9b55dc203fb16a89c45561aea / Calamari Version: 14.9.0) and the first failure was 12th September (Server version 2020.4.0-rc.5+Branch.tags-2020.4.0-rc.5.Sha.f46900db4312e315041e749d02b6ac7e16188c22 / Calamari Version: 14.10.0)

Thank you,
Peter

A fixed version should be rolling out across the fleet in your maintenance in the coming days. If you are blocked and need the version sooner, please drop me a private message with your instance details, and I’ll work on getting this updated for you.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.