Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.25] - Update klipper-helm to support PodDisruptionBudget API deprecation #7238

Closed
galal-hussein opened this issue Apr 6, 2023 · 1 comment
Assignees
Milestone

Comments

@galal-hussein
Copy link
Contributor

Backport fix for Update klipper-helm to support PodDisruptionBudget API deprecation

@est-suse
Copy link
Contributor

Validated on 1.25 branch using commit id 540d19b

k3s version v1.25.8+k3s-540d19b0 (540d19b0)
go version go1.19.7

Environment Details

Infrastructure
Cloud EC2 instance

Node(s) CPU architecture, OS, and Version:
Ubuntu 20.04

Cluster Configuration:
Single node

Steps to validate the issue

Install k3s using latest commit
Validate helm install, helm upgrade, helm delete of any chart to verify there is no regresssion
Install and upgrade helm chart with PDB and upgrade k3s from v1.25.8 to latest commit

Results from validation:
Scenario 1: Chart without PDB

Install k3s from commit id from 1.25 branch

helm install nginx bitnami/nginx  --version 13.2.32
helm list

WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
NAME 	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART        	APP VERSION
nginx	default  	1       	2023-04-12 04:05:17.389334595 +0000 UTC	deployed	nginx-13.2.32	1.23.4  

kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
nginx-5dc98cf47b-l4b86   1/1     Running   0          23s


helm upgrade nginx bitnami/nginx  --version 13.2.33

helm list
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
NAME 	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART        	APP VERSION
nginx	default  	2       	2023-04-12 04:05:50.220235326 +0000 UTC	deployed	nginx-13.2.33	1.23.4  

helm delete  nginx

helm list
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
NAME	NAMESPACE	REVISION	UPDATED	STATUS	CHART	APP VERSION

Scenario 2: Chart with PDB

Install k3s version 1.25.8
Install chart with PDB
Upgrade k3s to commit from master branch
Upgrade chart with PDB

$ curl -fL https://get.k3s.io| INSTALL_K3S_VERSION=v1.25.8+k3s1 sh -s - server
$ sudo chmod 644 /etc/rancher/k3s/k3s.yaml 
$ helm repo add cockroachdb https://charts.cockroachdb.com/
$ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
$ helm install my-release cockroachdb/cockroachdb --version 10.0.6
helm list

my-release	default  	1       	2023-04-12 04:12:20.642543144 +0000 UTC	deployed	cockroachdb-10.0.6	22.2.6    
helm get manifest my-release | grep -B 2 'kind: PodDisruptionBudget'
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
---
# Source: cockroachdb/templates/poddisruptionbudget.yaml
ubuntu@ip-172-31-5-202:~$ kubectl get pods
NAME                                READY   STATUS      RESTARTS   AGE
my-release-cockroachdb-init-s6t2h   0/1     Completed   0          42s
my-release-cockroachdb-0            1/1     Running     0          42s
my-release-cockroachdb-2            1/1     Running     0          42s
my-release-cockroachdb-1            1/1     Running     0          42s
ubuntu@ip-172-31-5-202:~$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
pvc-25e8ba7d-ee3d-472e-b3b9-4a1b13fd315f   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-2   local-path              43s
pvc-f68b66a1-973f-42f1-9686-069964ea0bbc   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-0   local-path              43s
pvc-782d1bd0-78c7-4042-8f63-65812a9e34a8   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-1   local-path              43s
ubuntu@ip-172-31-5-202:~$ kubectl get secrets
NAME                                   TYPE                 DATA   AGE
my-release-cockroachdb-ca-secret       Opaque               2      61s
my-release-cockroachdb-client-secret   kubernetes.io/tls    3      61s
my-release-cockroachdb-node-secret     kubernetes.io/tls    3      61s
sh.helm.release.v1.my-release.v1       helm.sh/release.v1   1      73s

Upgrade k3s and upgrade helm chart

curl -sfL https://get.k3s.io |  INSTALL_K3S_COMMIT=540d19b09730db2c55facb16f64c930d599a39e5 sh -s - server

ubuntu@ip-172-31-5-202:~$ helm list
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /etc/rancher/k3s/k3s.yaml
NAME      	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART             	APP VERSION
my-release	default  	2       	2023-04-12 04:16:02.243227807 +0000 UTC	deployed	cockroachdb-10.0.7	22.2.7     
ubuntu@ip-172-31-5-202:~$ 
ubuntu@ip-172-31-5-202:~$ 
ubuntu@ip-172-31-5-202:~$ kubectl get pods
NAME                                READY   STATUS      RESTARTS   AGE
my-release-cockroachdb-0            1/1     Running     0          4m4s
my-release-cockroachdb-init-xkjmh   0/1     Completed   0          31s
my-release-cockroachdb-2            1/1     Running     0          24s
my-release-cockroachdb-1            0/1     Running     0          6s
ubuntu@ip-172-31-5-202:~$ kubectl get pods
NAME                                READY   STATUS      RESTARTS   AGE
my-release-cockroachdb-0            1/1     Running     0          4m6s
my-release-cockroachdb-init-xkjmh   0/1     Completed   0          33s
my-release-cockroachdb-2            1/1     Running     0          26s
my-release-cockroachdb-1            0/1     Running     0          8s
ubuntu@ip-172-31-5-202:~$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
pvc-25e8ba7d-ee3d-472e-b3b9-4a1b13fd315f   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-2   local-path              4m6s
pvc-f68b66a1-973f-42f1-9686-069964ea0bbc   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-0   local-path              4m6s
pvc-782d1bd0-78c7-4042-8f63-65812a9e34a8   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-1   local-path              4m6s
ubuntu@ip-172-31-5-202:~$ kubectl get secrets
NAME                                   TYPE                 DATA   AGE
my-release-cockroachdb-ca-secret       Opaque               2      4m29s
my-release-cockroachdb-client-secret   kubernetes.io/tls    3      4m29s
my-release-cockroachdb-node-secret     kubernetes.io/tls    3      4m29s
sh.helm.release.v1.my-release.v1       helm.sh/release.v1   1      4m41s
sh.helm.release.v1.my-release.v2       helm.sh/release.v1   1      59s
ubuntu@ip-172-31-5-202:~$ kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[0].image}{"\n"}'
my-release-cockroachdb-init-xkjmh	cockroachdb/cockroach:v22.2.7
my-release-cockroachdb-2	cockroachdb/cockroach:v22.2.7
my-release-cockroachdb-1	cockroachdb/cockroach:v22.2.7
my-release-cockroachdb-0	cockroachdb/cockroach:v22.2.7

@github-project-automation github-project-automation bot moved this from To Test to Done Issue in K3s Development Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants