2
votes

I am trying to upgrade one of my chart. But the changes which I have made in the "deployment.yaml" template in the chart is not there after the upgrade. I added the following lines in the spec of my kubernetes deployment.yaml file

spec:
  containers:
  - env:
    - name: LOGBACK_DB_ACQUIRE_INCREMENT
      value: "1"
    - name: LOGBACK_DB_MAX_IDLE_TIME_EXCESS_CONNECTIONS
      value: "10"
    - name: LOGBACK_DB_MAX_POOL_SIZE
      value: "2"
    - name: LOGBACK_DB_MIN_POOL_SIZE
      value: "1"

I tried upgrading using the following command

helm upgrade ironic-molly spring-app-0.1.2.tgz --recreate-pods

Where "ironic-molly" is the release-name and spring-app-0.1.2.tgz is my chart with changes.

Helm output says that the package is upgraded, but the changes which i have made is missing in the deployment.yaml. What might be causing this issue.?

Regards,

Muhammed Roshan

3
look at the deployment from cluster kubectl get deploy <deploymnet name> -o yaml see it has the entry.sfgroups
No. it does not have these entries. That is the issue I am facing. Upgrade is successful, but the changes are not getting reflected in the deployments.Muhammed Roshan

3 Answers

1
votes

syntax (indents)

spec:
  containers:
  - env:
    - name: LOGBACK_DB_ACQUIRE_INCREMENT
      value: "1"
    - name: LOGBACK_DB_MAX_IDLE_TIME_EXCESS_CONNECTIONS
      value: "10"
    - name: LOGBACK_DB_MAX_POOL_SIZE
      value: "2"
    - name: LOGBACK_DB_MIN_POOL_SIZE
      value: "1"

should do the trick

1
votes

(If the problem is not with indents - adding an answer that also matches the title in general).


A few points to consider when you upgrade your helm charts:

1 ) Add the --debug to the helm upgrade command.

2 ) Check the current values of the specific resource - for example deployment:
kubectl get deploy <deploymnet name> -o yaml.

3 ) Check latest events: kubectl get events -n <namespace>.

4 ) Check latest logs: kubectl logs -l name=myLabel.

5 ) If you want to ensure that pods are re-created - add a specific timestamp via annotation:

kind: Deployment
metadata:
...
spec:
  template:
    metadata:
      labels:
        app: k8s-dashboard
      annotations:
        timestamp: "{{ date "20060102150405" .Release.Time }}"
0
votes

I think issue with your indents. I tested with my cluster it works. env tag should start same place as image: in your example it start below containers.

spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: envtest
        release: ugly-lizzard
    spec:
      containers:
        - name: envtest
          image: "nginx:stable"
          imagePullPolicy: IfNotPresent
          env:
          - name: SSHD
            value: disalbe
          ports:
            - containerPort: 80