OT-CONTAINER-KIT / helm-charts

A repository which that will contain helm charts with best and security practices.
https://ot-container-kit.github.io/helm-charts
49 stars 84 forks source link

Redis-Operator: CRDs not updated/installed when upgrading from 0.5.0 to newer versions #7

Closed Boeller666 closed 2 years ago

Boeller666 commented 3 years ago

When upgrading the redis-operator from 0.5.0 to 0.6.0 the rediscluster CRD is not added.

Release "redis-operator" has been upgraded. Happy Helming!
NAME: redis-operator
LAST DEPLOYED: Thu Sep  2 12:08:33 2021
NAMESPACE: redis-operator
STATUS: deployed
REVISION: 2
TEST SUITE: None

The running operator pod:

$ kubectl describe pod redis-operator-6f7dd898d9-bhf92 -n redis-operator
Name:         redis-operator-6f7dd898d9-bhf92
Namespace:    redis-operator
Priority:     0
Node:         worker-3/10.100.0.44
Start Time:   Thu, 02 Sep 2021 12:14:13 +0200
Labels:       name=redis-operator
              pod-template-hash=6f7dd898d9
Annotations:  cni.projectcalico.org/podIP: 10.42.2.110/32
              cni.projectcalico.org/podIPs: 10.42.2.110/32
Status:       Running
IP:           10.42.2.110
IPs:
  IP:           10.42.2.110
Controlled By:  ReplicaSet/redis-operator-6f7dd898d9
Containers:
  redis-operator:
    Container ID:  docker://18689117ef5b777a7a19ae4037bfddc8ad99c74e48b15d90fd2ef75998e18730
    Image:         quay.io/opstree/redis-operator:v0.6.0
    Image ID:      docker-pullable://quay.io/opstree/redis-operator@sha256:c7d9f2f991818aeb2f6de1faafb08922fe88d2f4b3b0e4e023039d1c34f9f1d9
    Port:          <none>
    Host Port:     <none>
    Command:
      /manager
    Args:
      --leader-elect
    State:          Running
      Started:      Thu, 02 Sep 2021 12:17:12 +0200
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Thu, 02 Sep 2021 12:16:05 +0200
      Finished:     Thu, 02 Sep 2021 12:16:26 +0200
    Ready:          True
    Restart Count:  4
    Limits:
      cpu:     100m
      memory:  100Mi
    Requests:
      cpu:        100m
      memory:     100Mi
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from redis-operator-token-cqjd2 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  redis-operator-token-cqjd2:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  redis-operator-token-cqjd2
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   Scheduled  3m5s                 default-scheduler  Successfully assigned redis-operator/redis-operator-6f7dd898d9-bhf92 to worker-3
  Normal   Pulled     3m3s                 kubelet            Successfully pulled image "quay.io/opstree/redis-operator:v0.6.0" in 1.252186747s
  Normal   Pulled     2m39s                kubelet            Successfully pulled image "quay.io/opstree/redis-operator:v0.6.0" in 1.249386139s
  Normal   Pulled     2m4s                 kubelet            Successfully pulled image "quay.io/opstree/redis-operator:v0.6.0" in 1.299940511s
  Normal   Started    73s (x4 over 3m2s)   kubelet            Started container redis-operator
  Normal   Pulled     73s                  kubelet            Successfully pulled image "quay.io/opstree/redis-operator:v0.6.0" in 1.231768981s
  Warning  BackOff    22s (x6 over 2m17s)  kubelet            Back-off restarting failed container
  Normal   Pulling    7s (x5 over 3m4s)    kubelet            Pulling image "quay.io/opstree/redis-operator:v0.6.0"
  Normal   Created    6s (x5 over 3m3s)    kubelet            Created container redis-operator
  Normal   Pulled     6s                   kubelet            Successfully pulled image "quay.io/opstree/redis-operator:v0.6.0" in 1.264089192s

Installed opstree CRDs:

$ kubectl get crd | grep "opstreelabs"
redis.redis.redis.opstreelabs.in                      2021-09-02T10:10:58Z

Same issue when trying to move directly to 0.7.0.

Maybe it's an issue in how helm works with the crds folder?!

Helm version:

$ helm version --short
v3.6.3+gd506314

The only way I got the CRDs was:

  1. uninstall the old version of the operator including deletion of the CRDs and then installing a new version (not an option for clusters with running redis instances)
  2. installing the CRDs manually (not nice but seems to work)