syntasso / helm-charts

Helm charts for Kratix
Apache License 2.0
0 stars 2 forks source link

Install operator at a fixed version #13

Closed SaphMB closed 1 month ago

SaphMB commented 1 month ago

Expected behaviour for acceptance

Default with no attempt to set the tag

Context: A Chart.yaml where appVersion = v0.3.1 (reflecting the Operator version). imageRegistry.tag is not set.

Setup cluster with cert-manager

// from helm-charts/ske-operator

kind create cluster

kubectl apply --filename https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml
namespace/cert-manager

Update values.yaml

skeLicense: "a-real-token"

Install Chart with values.yaml

helm install ske-operator . \
  --namespace kratix-platform-system \
  --create-namespace \
  --values values.yaml

Check operator version

helm list --all-namespaces

-> ske-operator kratix-platform-system  1           2024-10-16 12:31:55.732419 +0100 BST    deployed    ske-operator-0.17.0 v0.3.1

SKE Operator version should match the appVersion in Chart.yaml

k get pods --selector=control-plane=ske-operator -A -o yaml | yq '.items[0].spec.containers[0].image'

-> ghcr.io/syntasso/ske-operator:v0.3.1

Image tag should match the appVersion in Chart.yaml

Attempting to set the deprecated tag

Context: A Chart.yaml where appVersion = v0.3.1 (reflecting the Operator version). imageRegistry.tag is set to v0.2.0.

tl;dr same behaviour with the tag ignored

Setup cluster with cert-manager

// from helm-charts/ske-operator

kind create cluster

kubectl apply --filename https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml
namespace/cert-manager

Update values.yaml

skeLicense: "a-real-token"

Install Chart with values.yaml

helm install ske-operator . \
  --namespace kratix-platform-system \
  --create-namespace \
  --values values.yaml

Check operator version

helm list --all-namespaces

-> ske-operator kratix-platform-system  1           2024-10-16 12:31:55.732419 +0100 BST    deployed    ske-operator-0.17.0 v0.3.1

SKE Operator version should match the appVersion in Chart.yaml

k get pods --selector=control-plane=ske-operator -A -o yaml | yq '.items[0].spec.containers[0].image'

-> ghcr.io/syntasso/ske-operator:v0.3.1

Image tag should match the appVersion in Chart.yaml

aclevername commented 1 month ago

acceptance worked:

helm install ske-operator . \
  --namespace kratix-platform-system \
  --create-namespace \
  --values values.yaml
NAME: ske-operator
LAST DEPLOYED: Wed Oct 16 14:10:33 2024
NAMESPACE: kratix-platform-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
(⎈|kind-platform:default) | jake@Jakes-MacBook-Pro-2 [14:10:34] [~/workspace/helm-charts/ske-operator] [install-operator-at-fixed-version]
-> % k -n kratix-platform-system get pod ske-operator-controller-manager-5f74dd4d5b-4b864 -o yaml | grep image:
    image: ghcr.io/syntasso/ske-operator:v0.3.1
  - image: ghcr.io/syntasso/ske-operator:v0.3.1