Search code examples
kubernetesgoogle-kubernetes-enginekubernetes-secrets

Kubernetes Secret in google container engine fails -/ setting oom score for ready process caused error


I created a service which works perfectly in kubernetes.

Then i moved the connection string to a kubernetes secret; this is my yaml config:

    env:
      - name: AZURE_CONNECTION
        valueFrom:
          secretKeyRef:
            name: azure
            key: connection-string

But since then the the scheduling of the pod fails

Error: failed to start container "myservice-api-host": Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:295: setting oom score for ready process caused \"write /proc/22658/oom_score_adj: invalid argument\""


Solution

  • The reason was that the secret was base64 encoded based on a UTF16 string.

    After encoding the secret in UTF8 then Base64 everything works fine