Scenario #1:

You are deploying resources (pods, service and deployments etc) in Kubernetes cluster using Helm charts. This is deployed by release pipeline in Azure DevOps. In the Release pipeline you start getting errors like below and the task fails to deploy the resources. This started happening for Helm chart versions 3.3.0 and later.

##[error]WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /agent/_work/_temp/helmTask/1642342343233/config

WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /agent/_work/_temp/helmTask/163432432432933/config

 

Solution:

You can suppress this error to allow Helm Chart to rollout the deployment by unchecking the “Fail on Standard Error” setting as shown in the screen shot.

 

Scenario #2:

You are updating environment variable for your container in pod using Helm chart. Your deployment yaml looks like below

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        env:
        - name:  SERVICE_PORT
          value: {{ .Values.SERVICE_PORT }}

The value for SERVICE_PORT is set in values.yaml file

SERVICE_PORT: 8080

When you try to deploy the Helm chart, it fails with following error

[]v1.Container: v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects " or n, but found 8, error found in #10 byte of ...|,"value":8080}

 

Solution:

This error shows up due to quotes missing around the port number. You can fix it by changing the deployment yaml as shown below

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        env:
        - name:  SERVICE_PORT
          value: {{ .Values.SERVICE_PORT | quote }}