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.24] - Update klipper-helm to support PodDisruptionBudget API deprecation #7239

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

est-suse commented Apr 12, 2023

Validated on 1.25 branch using commit id 540d19b

k3s version v1.24.12+k3s-a6bd15fb (a6bd15fb)
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
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 12:32:09.250114355 +0000 UTC	deployed	nginx-13.2.32	1.23.4     

helm upgrade nginx bitnami/nginx  --version 13.2.33

NAME 	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART        	APP VERSION
nginx	default  	2       	2023-04-12 12:37:19.940293373 +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.24.11+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 12:44:30.715297955 +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
kind: PodDisruptionBudget
ubuntu@ip-172-31-5-202:~$
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
kind: PodDisruptionBudget
ubuntu@ip-172-31-5-202:~$
$ kubectl get pods
NAME                                READY   STATUS      RESTARTS   AGE
my-release-cockroachdb-init-h6k6r   0/1     Completed   0          45s
my-release-cockroachdb-1            1/1     Running     0          45s
my-release-cockroachdb-0            1/1     Running     0          45s
my-release-cockroachdb-2            1/1     Running     0          45s
$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
pvc-c98e3e5e-6372-4bb0-b54e-5e256a62ceee   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-1   local-path              47s
pvc-151c1bf8-5e92-4f4d-89e4-4c99884705a2   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-2   local-path              47s
pvc-eeb7456c-bb0a-43c9-b6b2-b0a94e141536   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-0   local-path              47s
$ kubectl get secrets
NAME                                   TYPE                 DATA   AGE
my-release-cockroachdb-ca-secret       Opaque               2      62s
my-release-cockroachdb-client-secret   kubernetes.io/tls    3      62s
my-release-cockroachdb-node-secret     kubernetes.io/tls    3      61s
sh.helm.release.v1.my-release.v1       helm.sh/release.v1   1      71s

Upgrade k3s and upgrade helm chart

 curl -fL https://get.k3s.io| INSTALL_K3S_COMMIT=a6bd15fb71fb768416aefc17a9472b09fd1649af sh -s - server
$ helm upgrade my-release cockroachdb/cockroachdb --version 10.0.7
$ 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 12:49:24.056692903 +0000 UTC	deployed	cockroachdb-10.0.7	22.2.7     


ubuntu@ip-172-31-5-202:~$ kubectl get pods
NAME                                READY   STATUS      RESTARTS   AGE
my-release-cockroachdb-init-27p8n   0/1     Completed   0          57s
my-release-cockroachdb-2            1/1     Running     0          51s
my-release-cockroachdb-1            1/1     Running     0          23s
my-release-cockroachdb-0            0/1     Running     0          4s

kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
pvc-c98e3e5e-6372-4bb0-b54e-5e256a62ceee   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-1   local-path              6m42s
pvc-151c1bf8-5e92-4f4d-89e4-4c99884705a2   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-2   local-path              6m42s
pvc-eeb7456c-bb0a-43c9-b6b2-b0a94e141536   100Gi      RWO            Delete           Bound    default/datadir-my-release-cockroachdb-0   local-path              6m42s

kubectl get secrets
NAME                                   TYPE                 DATA   AGE
my-release-cockroachdb-ca-secret       Opaque               2      6m59s
my-release-cockroachdb-client-secret   kubernetes.io/tls    3      6m59s
my-release-cockroachdb-node-secret     kubernetes.io/tls    3      6m58s
sh.helm.release.v1.my-release.v1       helm.sh/release.v1   1      7m8s
sh.helm.release.v1.my-release.v2       helm.sh/release.v1   1      2m14s

 kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[0].image}{"\n"}'
my-release-cockroachdb-init-27p8n	cockroachdb/cockroach:v22.2.7
my-release-cockroachdb-2	cockroachdb/cockroach:v22.2.7
my-release-cockroachdb-1	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

3 participants