From 49fb98a475ba231842ce64f9ce429ade66b4e566 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Sat, 1 Jul 2023 08:57:19 +0200 Subject: [PATCH 01/16] introduce helm chart --- helm/system-upgrade-contoller/.helmignore | 23 + helm/system-upgrade-contoller/Chart.yaml | 24 + .../templates/NOTES.txt | 4 + .../templates/_helpers.tpl | 62 +++ .../templates/cm.yaml | 16 + .../templates/crb.yaml | 13 + .../templates/crd.yaml | 461 ++++++++++++++++++ .../templates/deployment.yaml | 91 ++++ .../templates/ns.yaml | 6 + .../templates/plan.yaml | 44 ++ .../templates/serviceaccount.yaml | 6 + helm/system-upgrade-contoller/values.yaml | 8 + 12 files changed, 758 insertions(+) create mode 100644 helm/system-upgrade-contoller/.helmignore create mode 100644 helm/system-upgrade-contoller/Chart.yaml create mode 100644 helm/system-upgrade-contoller/templates/NOTES.txt create mode 100644 helm/system-upgrade-contoller/templates/_helpers.tpl create mode 100644 helm/system-upgrade-contoller/templates/cm.yaml create mode 100644 helm/system-upgrade-contoller/templates/crb.yaml create mode 100644 helm/system-upgrade-contoller/templates/crd.yaml create mode 100644 helm/system-upgrade-contoller/templates/deployment.yaml create mode 100644 helm/system-upgrade-contoller/templates/ns.yaml create mode 100644 helm/system-upgrade-contoller/templates/plan.yaml create mode 100644 helm/system-upgrade-contoller/templates/serviceaccount.yaml create mode 100644 helm/system-upgrade-contoller/values.yaml diff --git a/helm/system-upgrade-contoller/.helmignore b/helm/system-upgrade-contoller/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm/system-upgrade-contoller/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/system-upgrade-contoller/Chart.yaml b/helm/system-upgrade-contoller/Chart.yaml new file mode 100644 index 00000000..025c5020 --- /dev/null +++ b/helm/system-upgrade-contoller/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: system-upgrade-contoller +description: This project aims to provide a general-purpose, Kubernetes-native upgrade controller (for nodes). + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "12.0.0" diff --git a/helm/system-upgrade-contoller/templates/NOTES.txt b/helm/system-upgrade-contoller/templates/NOTES.txt new file mode 100644 index 00000000..da0c83f2 --- /dev/null +++ b/helm/system-upgrade-contoller/templates/NOTES.txt @@ -0,0 +1,4 @@ + +This project aims to provide a general-purpose, Kubernetes-native upgrade controller (for nodes). +It introduces a new CRD, the Plan, for defining any and all of your upgrade policies/requirements. +A Plan is an outstanding intent to mutate nodes in your cluster. \ No newline at end of file diff --git a/helm/system-upgrade-contoller/templates/_helpers.tpl b/helm/system-upgrade-contoller/templates/_helpers.tpl new file mode 100644 index 00000000..4ba9e87a --- /dev/null +++ b/helm/system-upgrade-contoller/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "system-upgrade-contoller.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "system-upgrade-contoller.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "system-upgrade-contoller.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "system-upgrade-contoller.labels" -}} +helm.sh/chart: {{ include "system-upgrade-contoller.chart" . }} +{{ include "system-upgrade-contoller.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "system-upgrade-contoller.selectorLabels" -}} +app.kubernetes.io/name: {{ include "system-upgrade-contoller.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "system-upgrade-contoller.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "system-upgrade-contoller.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/system-upgrade-contoller/templates/cm.yaml b/helm/system-upgrade-contoller/templates/cm.yaml new file mode 100644 index 00000000..b4375afd --- /dev/null +++ b/helm/system-upgrade-contoller/templates/cm.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: default-controller-env + namespace: {{.Values.targetns }} +data: + SYSTEM_UPGRADE_CONTROLLER_DEBUG: "false" + SYSTEM_UPGRADE_CONTROLLER_THREADS: "2" + SYSTEM_UPGRADE_JOB_ACTIVE_DEADLINE_SECONDS: "900" + SYSTEM_UPGRADE_JOB_BACKOFF_LIMIT: "99" + SYSTEM_UPGRADE_JOB_IMAGE_PULL_POLICY: "Always" + SYSTEM_UPGRADE_JOB_KUBECTL_IMAGE: "rancher/kubectl:v1.25.4" + SYSTEM_UPGRADE_JOB_PRIVILEGED: "true" + SYSTEM_UPGRADE_JOB_TTL_SECONDS_AFTER_FINISH: "900" + SYSTEM_UPGRADE_PLAN_POLLING_INTERVAL: "15m" \ No newline at end of file diff --git a/helm/system-upgrade-contoller/templates/crb.yaml b/helm/system-upgrade-contoller/templates/crb.yaml new file mode 100644 index 00000000..9a5be20e --- /dev/null +++ b/helm/system-upgrade-contoller/templates/crb.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: system-upgrade +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: +- kind: ServiceAccount + name: system-upgrade + namespace: {{.Values.targetns }} \ No newline at end of file diff --git a/helm/system-upgrade-contoller/templates/crd.yaml b/helm/system-upgrade-contoller/templates/crd.yaml new file mode 100644 index 00000000..dbb26997 --- /dev/null +++ b/helm/system-upgrade-contoller/templates/crd.yaml @@ -0,0 +1,461 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: plans.upgrade.cattle.io +spec: + group: upgrade.cattle.io + names: + categories: + - upgrade + kind: Plan + plural: plans + singular: plan + preserveUnknownFields: false + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.upgrade.image + name: Image + type: string + - jsonPath: .spec.channel + name: Channel + type: string + - jsonPath: .spec.version + name: Version + type: string + name: v1 + schema: + openAPIV3Schema: + properties: + spec: + properties: + channel: + nullable: true + type: string + concurrency: + type: integer + cordon: + type: boolean + drain: + nullable: true + properties: + deleteEmptydirData: + nullable: true + type: boolean + deleteLocalData: + nullable: true + type: boolean + disableEviction: + type: boolean + force: + type: boolean + gracePeriod: + nullable: true + type: integer + ignoreDaemonSets: + nullable: true + type: boolean + podSelector: + nullable: true + properties: + matchExpressions: + items: + properties: + key: + nullable: true + type: string + operator: + nullable: true + type: string + values: + items: + nullable: true + type: string + nullable: true + type: array + type: object + nullable: true + type: array + matchLabels: + additionalProperties: + nullable: true + type: string + nullable: true + type: object + type: object + skipWaitForDeleteTimeout: + type: integer + timeout: + nullable: true + type: integer + type: object + nodeSelector: + nullable: true + properties: + matchExpressions: + items: + properties: + key: + nullable: true + type: string + operator: + nullable: true + type: string + values: + items: + nullable: true + type: string + nullable: true + type: array + type: object + nullable: true + type: array + matchLabels: + additionalProperties: + nullable: true + type: string + nullable: true + type: object + type: object + prepare: + nullable: true + properties: + args: + items: + nullable: true + type: string + nullable: true + type: array + command: + items: + nullable: true + type: string + nullable: true + type: array + envFrom: + items: + properties: + configMapRef: + nullable: true + properties: + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + prefix: + nullable: true + type: string + secretRef: + nullable: true + properties: + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + type: object + nullable: true + type: array + envs: + items: + properties: + name: + nullable: true + type: string + value: + nullable: true + type: string + valueFrom: + nullable: true + properties: + configMapKeyRef: + nullable: true + properties: + key: + nullable: true + type: string + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + fieldRef: + nullable: true + properties: + apiVersion: + nullable: true + type: string + fieldPath: + nullable: true + type: string + type: object + resourceFieldRef: + nullable: true + properties: + containerName: + nullable: true + type: string + divisor: + nullable: true + type: string + resource: + nullable: true + type: string + type: object + secretKeyRef: + nullable: true + properties: + key: + nullable: true + type: string + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + type: object + type: object + nullable: true + type: array + image: + nullable: true + type: string + volumes: + items: + properties: + destination: + nullable: true + type: string + name: + nullable: true + type: string + source: + nullable: true + type: string + type: object + nullable: true + type: array + type: object + secrets: + items: + properties: + name: + nullable: true + type: string + path: + nullable: true + type: string + type: object + nullable: true + type: array + serviceAccountName: + nullable: true + type: string + tolerations: + items: + properties: + effect: + nullable: true + type: string + key: + nullable: true + type: string + operator: + nullable: true + type: string + tolerationSeconds: + nullable: true + type: integer + value: + nullable: true + type: string + type: object + nullable: true + type: array + upgrade: + nullable: true + properties: + args: + items: + nullable: true + type: string + nullable: true + type: array + command: + items: + nullable: true + type: string + nullable: true + type: array + envFrom: + items: + properties: + configMapRef: + nullable: true + properties: + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + prefix: + nullable: true + type: string + secretRef: + nullable: true + properties: + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + type: object + nullable: true + type: array + envs: + items: + properties: + name: + nullable: true + type: string + value: + nullable: true + type: string + valueFrom: + nullable: true + properties: + configMapKeyRef: + nullable: true + properties: + key: + nullable: true + type: string + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + fieldRef: + nullable: true + properties: + apiVersion: + nullable: true + type: string + fieldPath: + nullable: true + type: string + type: object + resourceFieldRef: + nullable: true + properties: + containerName: + nullable: true + type: string + divisor: + nullable: true + type: string + resource: + nullable: true + type: string + type: object + secretKeyRef: + nullable: true + properties: + key: + nullable: true + type: string + name: + nullable: true + type: string + optional: + nullable: true + type: boolean + type: object + type: object + type: object + nullable: true + type: array + image: + nullable: true + type: string + volumes: + items: + properties: + destination: + nullable: true + type: string + name: + nullable: true + type: string + source: + nullable: true + type: string + type: object + nullable: true + type: array + type: object + version: + nullable: true + type: string + required: + - upgrade + type: object + status: + properties: + applying: + items: + nullable: true + type: string + nullable: true + type: array + conditions: + items: + properties: + lastTransitionTime: + nullable: true + type: string + lastUpdateTime: + nullable: true + type: string + message: + nullable: true + type: string + reason: + nullable: true + type: string + status: + nullable: true + type: string + type: + nullable: true + type: string + type: object + nullable: true + type: array + latestHash: + nullable: true + type: string + latestVersion: + nullable: true + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/helm/system-upgrade-contoller/templates/deployment.yaml b/helm/system-upgrade-contoller/templates/deployment.yaml new file mode 100644 index 00000000..8bddf6f4 --- /dev/null +++ b/helm/system-upgrade-contoller/templates/deployment.yaml @@ -0,0 +1,91 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: system-upgrade-controller + namespace: {{.Values.targetns }} +spec: + selector: + matchLabels: + upgrade.cattle.io/controller: system-upgrade-controller + template: + metadata: + labels: + upgrade.cattle.io/controller: system-upgrade-controller # necessary to avoid drain + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + serviceAccountName: system-upgrade + tolerations: + - key: "CriticalAddonsOnly" + operator: "Exists" + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/controlplane" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/etcd" + operator: "Exists" + effect: "NoExecute" + containers: + - name: system-upgrade-controller + image: rancher/system-upgrade-controller:v0.11.0 + imagePullPolicy: IfNotPresent + securityContext: + runAsNonRoot: true + runAsUser: 65534 + runAsGroup: 65534 + allowPrivilegeEscalation: false + seccompProfile: + type: RuntimeDefault + capabilities: + drop: + - ALL + envFrom: + - configMapRef: + name: default-controller-env + env: + - name: SYSTEM_UPGRADE_CONTROLLER_NAME + valueFrom: + fieldRef: + fieldPath: metadata.labels['upgrade.cattle.io/controller'] + - name: SYSTEM_UPGRADE_CONTROLLER_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - name: etc-ssl + mountPath: /etc/ssl + readOnly: true + - name: etc-pki + mountPath: /etc/pki + readOnly: true + - name: etc-ca-certificates + mountPath: /etc/ca-certificates + readOnly: true + - name: tmp + mountPath: /tmp + volumes: + - name: etc-ssl + hostPath: + path: /etc/ssl + type: DirectoryOrCreate + - name: etc-pki + hostPath: + path: /etc/pki + type: DirectoryOrCreate + - name: etc-ca-certificates + hostPath: + path: /etc/ca-certificates + type: DirectoryOrCreate + - name: tmp + emptyDir: {} diff --git a/helm/system-upgrade-contoller/templates/ns.yaml b/helm/system-upgrade-contoller/templates/ns.yaml new file mode 100644 index 00000000..970f355d --- /dev/null +++ b/helm/system-upgrade-contoller/templates/ns.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{.Values.targetns }} + labels: + pod-security.kubernetes.io/enforce: privileged \ No newline at end of file diff --git a/helm/system-upgrade-contoller/templates/plan.yaml b/helm/system-upgrade-contoller/templates/plan.yaml new file mode 100644 index 00000000..496219eb --- /dev/null +++ b/helm/system-upgrade-contoller/templates/plan.yaml @@ -0,0 +1,44 @@ +{{- if .Values.installPlan -}} +# Server plan +apiVersion: upgrade.cattle.io/v1 +kind: Plan +metadata: + name: server-plan + namespace: {{.Values.targetns }} +spec: + concurrency: 1 + cordon: true + nodeSelector: + matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: In + values: + - "true" + serviceAccountName: system-upgrade + upgrade: + image: rancher/k3s-upgrade + version: v1.24.6+k3s1 +--- +# Agent plan +apiVersion: upgrade.cattle.io/v1 +kind: Plan +metadata: + name: agent-plan + namespace: {{.Values.targetns }} +spec: + concurrency: 1 + cordon: true + nodeSelector: + matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: DoesNotExist + prepare: + args: + - prepare + - server-plan + image: rancher/k3s-upgrade + serviceAccountName: system-upgrade + upgrade: + image: rancher/k3s-upgrade + version: v1.24.6+k3s1 +{{- end -}} \ No newline at end of file diff --git a/helm/system-upgrade-contoller/templates/serviceaccount.yaml b/helm/system-upgrade-contoller/templates/serviceaccount.yaml new file mode 100644 index 00000000..70109917 --- /dev/null +++ b/helm/system-upgrade-contoller/templates/serviceaccount.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: system-upgrade + namespace: {{.Values.targetns }} \ No newline at end of file diff --git a/helm/system-upgrade-contoller/values.yaml b/helm/system-upgrade-contoller/values.yaml new file mode 100644 index 00000000..dad67c39 --- /dev/null +++ b/helm/system-upgrade-contoller/values.yaml @@ -0,0 +1,8 @@ +# Default values for system-upgrade-contoller. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# Namespace created on installation +targetns: system-upgrade + +installPlan: false \ No newline at end of file From 9f1465526b6f238b168c846663f0a844cb6ea635 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 14:41:26 +0200 Subject: [PATCH 02/16] Update Dockerfile.dapper --- Dockerfile.dapper | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 933a6b64..0312954d 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -9,7 +9,8 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk +RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.rep +RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk buildkit RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.0.3/kustomize_v5.0.3_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin; \ From 2c63cedc33e391a2579eea8ae7b1fde4b5ab12d1 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 14:45:53 +0200 Subject: [PATCH 03/16] Update Dockerfile.dapper --- Dockerfile.dapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 0312954d..f6f186d1 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -9,7 +9,7 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.rep +RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.repo && zypper refresh RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk buildkit RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ From 8d680c6d0532e43f44ee01644702ff5ba6c004a0 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 14:49:23 +0200 Subject: [PATCH 04/16] Update Dockerfile.dapper --- Dockerfile.dapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index f6f186d1..5712d9d8 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -9,7 +9,7 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.repo && zypper refresh +RUN zypper addrepo https://download.opensuse.org/repositories/home:RBrownSUSE/openSUSE_Tumbleweed/home:RBrownSUSE.repo && zypper refresh RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk buildkit RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ From afa9eaf94ced630e3685d8f493bdf2a5b2f22a4f Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 14:51:50 +0200 Subject: [PATCH 05/16] Update Dockerfile.dapper --- Dockerfile.dapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 5712d9d8..38aab107 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -9,7 +9,7 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -RUN zypper addrepo https://download.opensuse.org/repositories/home:RBrownSUSE/openSUSE_Tumbleweed/home:RBrownSUSE.repo && zypper refresh +#RUN zypper addrepo https://download.opensuse.org/repositories/home:RBrownSUSE/openSUSE_Tumbleweed/home:RBrownSUSE.repo && zypper refresh RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk buildkit RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ From 75b8ec6450a3ec2887fd5f9db14b5e65da63a0fb Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 16:12:18 +0200 Subject: [PATCH 06/16] revert Dockerfile.dapper --- Dockerfile.dapper | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 38aab107..933a6b64 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -9,8 +9,7 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -#RUN zypper addrepo https://download.opensuse.org/repositories/home:RBrownSUSE/openSUSE_Tumbleweed/home:RBrownSUSE.repo && zypper refresh -RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk buildkit +RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.0.3/kustomize_v5.0.3_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin; \ From b54be3c633207088edb8d66f6391a0c5ae1eadef Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 16:19:57 +0200 Subject: [PATCH 07/16] Update Dockerfile.dapper --- Dockerfile.dapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 933a6b64..be1ef386 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -9,7 +9,7 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk +RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk docker-buildx-plugin RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.0.3/kustomize_v5.0.3_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin; \ From e4809864a8069c738cf2a3da247f82489b88681d Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 16:39:46 +0200 Subject: [PATCH 08/16] add buildx --- Dockerfile.dapper | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index be1ef386..c029d4ca 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -8,14 +8,15 @@ COPY --from=kubectl /bin/kubectl /usr/local/bin/kubectl ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 - -RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk docker-buildx-plugin +RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.0.3/kustomize_v5.0.3_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin; \ curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_linux_${ARCH}.tar.gz" | tar -xz -C /usr/local/bin; \ curl -sL "https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose && \ chmod +x /usr/local/bin/docker-compose; \ + curl -sL "https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64" -o $HOME/.docker/cli-plugins/docker-buildx && \ + chmod +x $HOME/.docker/cli-plugins/docker-buildx; \ fi ENV DAPPER_ENV REPO TAG DRONE_TAG ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/ From 0fb37587d363b861218bc157133fc1c22df1e1bc Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 16:50:37 +0200 Subject: [PATCH 09/16] Update Dockerfile.dapper --- Dockerfile.dapper | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index c029d4ca..4543ae8b 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -15,8 +15,6 @@ RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_linux_${ARCH}.tar.gz" | tar -xz -C /usr/local/bin; \ curl -sL "https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose && \ chmod +x /usr/local/bin/docker-compose; \ - curl -sL "https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64" -o $HOME/.docker/cli-plugins/docker-buildx && \ - chmod +x $HOME/.docker/cli-plugins/docker-buildx; \ fi ENV DAPPER_ENV REPO TAG DRONE_TAG ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/ From a285e06c4b32161f17f0c1b7b007e41c0e8c85a1 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 16:59:47 +0200 Subject: [PATCH 10/16] Update package-controller --- scripts/package-controller | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/package-controller b/scripts/package-controller index 814b69af..012fe50b 100755 --- a/scripts/package-controller +++ b/scripts/package-controller @@ -5,9 +5,10 @@ source $(dirname $0)/version cd $(dirname $0)/.. -if [ "$ARCH" != "arm" ]; then - export DOCKER_BUILDKIT=1 -fi +# disable buildkit +#if [ "$ARCH" != "arm" ]; then +# export DOCKER_BUILDKIT=1 +#fi docker build \ --build-arg ARCH=${ARCH} \ From 9559398a9afd77100f01315470d3ab2e58ed3824 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Tue, 4 Jul 2023 17:00:23 +0200 Subject: [PATCH 11/16] Update package-e2e-tests --- scripts/package-e2e-tests | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/package-e2e-tests b/scripts/package-e2e-tests index 6d1f2e09..8a16e28b 100755 --- a/scripts/package-e2e-tests +++ b/scripts/package-e2e-tests @@ -5,9 +5,10 @@ source $(dirname $0)/version cd $(dirname $0)/.. -if [ "$ARCH" != "arm" ]; then - export DOCKER_BUILDKIT=1 -fi +#dissable Buildkit +#if [ "$ARCH" != "arm" ]; then +# export DOCKER_BUILDKIT=1 +#fi docker build \ --build-arg ARCH=${ARCH} \ From 0b414a1a7da5cce4ba33f853903501b7e6d21482 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Sat, 22 Jul 2023 07:01:32 +0200 Subject: [PATCH 12/16] Update Dockerfile.dapper to current master --- Dockerfile.dapper | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 4543ae8b..86f551ab 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -8,7 +8,8 @@ COPY --from=kubectl /bin/kubectl /usr/local/bin/kubectl ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ARG SONOBUOY_VERSION=0.56.16 -RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk + +RUN zypper -n install expect git jq docker vim less file curl wget iproute2 gawk RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \ curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.0.3/kustomize_v5.0.3_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin; \ @@ -16,6 +17,9 @@ RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \ curl -sL "https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose && \ chmod +x /usr/local/bin/docker-compose; \ fi +RUN mkdir -p /usr/local/lib/docker/cli-plugins; \ + curl -o /usr/local/lib/docker/cli-plugins/docker-buildx -fsSL "https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-${ARCH}"; \ + chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx ENV DAPPER_ENV REPO TAG DRONE_TAG ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/ ENV DAPPER_OUTPUT ./bin ./dist From 5d75207725617aa10f03df91c4c2184edf41ff41 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Sat, 22 Jul 2023 07:19:04 +0200 Subject: [PATCH 13/16] made chart configurable --- helm/system-upgrade-contoller/Chart.yaml | 2 +- .../system-upgrade-contoller/templates/deployment.yaml | 2 +- helm/system-upgrade-contoller/templates/plan.yaml | 10 +++++----- helm/system-upgrade-contoller/values.yaml | 10 +++++++++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/helm/system-upgrade-contoller/Chart.yaml b/helm/system-upgrade-contoller/Chart.yaml index 025c5020..6571aa06 100644 --- a/helm/system-upgrade-contoller/Chart.yaml +++ b/helm/system-upgrade-contoller/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "12.0.0" +appVersion: "0.13.0" diff --git a/helm/system-upgrade-contoller/templates/deployment.yaml b/helm/system-upgrade-contoller/templates/deployment.yaml index 8bddf6f4..8a17c2ca 100644 --- a/helm/system-upgrade-contoller/templates/deployment.yaml +++ b/helm/system-upgrade-contoller/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: effect: "NoExecute" containers: - name: system-upgrade-controller - image: rancher/system-upgrade-controller:v0.11.0 + image: {{ .Values.controller.image}}:{{ .Values.controller.version}} imagePullPolicy: IfNotPresent securityContext: runAsNonRoot: true diff --git a/helm/system-upgrade-contoller/templates/plan.yaml b/helm/system-upgrade-contoller/templates/plan.yaml index 496219eb..bbe6cf89 100644 --- a/helm/system-upgrade-contoller/templates/plan.yaml +++ b/helm/system-upgrade-contoller/templates/plan.yaml @@ -1,4 +1,4 @@ -{{- if .Values.installPlan -}} +{{- if .Values.plan.install -}} # Server plan apiVersion: upgrade.cattle.io/v1 kind: Plan @@ -16,8 +16,8 @@ spec: - "true" serviceAccountName: system-upgrade upgrade: - image: rancher/k3s-upgrade - version: v1.24.6+k3s1 + image: {{.Values.plan.image }} + version: {{ .Values.plan.version}} --- # Agent plan apiVersion: upgrade.cattle.io/v1 @@ -39,6 +39,6 @@ spec: image: rancher/k3s-upgrade serviceAccountName: system-upgrade upgrade: - image: rancher/k3s-upgrade - version: v1.24.6+k3s1 + image: {{.Values.plan.image }} + version: {{ .Values.plan.version}} {{- end -}} \ No newline at end of file diff --git a/helm/system-upgrade-contoller/values.yaml b/helm/system-upgrade-contoller/values.yaml index dad67c39..9c5c7ab9 100644 --- a/helm/system-upgrade-contoller/values.yaml +++ b/helm/system-upgrade-contoller/values.yaml @@ -5,4 +5,12 @@ # Namespace created on installation targetns: system-upgrade -installPlan: false \ No newline at end of file +controller: + image: rancher/system-upgrade-controller + version: v0.13.0 + +# if install eq true 2 sample plans will installed +plan: + install: false + image: rancher/k3s-upgrade + version: v1.24.6+k3s1 \ No newline at end of file From 8a9949a992be13c6a81bf3f5901f1984da2e131b Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Wed, 3 Apr 2024 14:31:07 +0200 Subject: [PATCH 14/16] rename folder --- {helm => charts}/system-upgrade-contoller/.helmignore | 0 {helm => charts}/system-upgrade-contoller/Chart.yaml | 0 {helm => charts}/system-upgrade-contoller/templates/NOTES.txt | 0 {helm => charts}/system-upgrade-contoller/templates/_helpers.tpl | 0 {helm => charts}/system-upgrade-contoller/templates/cm.yaml | 0 {helm => charts}/system-upgrade-contoller/templates/crb.yaml | 0 {helm => charts}/system-upgrade-contoller/templates/crd.yaml | 0 .../system-upgrade-contoller/templates/deployment.yaml | 0 {helm => charts}/system-upgrade-contoller/templates/ns.yaml | 0 {helm => charts}/system-upgrade-contoller/templates/plan.yaml | 0 .../system-upgrade-contoller/templates/serviceaccount.yaml | 0 {helm => charts}/system-upgrade-contoller/values.yaml | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename {helm => charts}/system-upgrade-contoller/.helmignore (100%) rename {helm => charts}/system-upgrade-contoller/Chart.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/NOTES.txt (100%) rename {helm => charts}/system-upgrade-contoller/templates/_helpers.tpl (100%) rename {helm => charts}/system-upgrade-contoller/templates/cm.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/crb.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/crd.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/deployment.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/ns.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/plan.yaml (100%) rename {helm => charts}/system-upgrade-contoller/templates/serviceaccount.yaml (100%) rename {helm => charts}/system-upgrade-contoller/values.yaml (100%) diff --git a/helm/system-upgrade-contoller/.helmignore b/charts/system-upgrade-contoller/.helmignore similarity index 100% rename from helm/system-upgrade-contoller/.helmignore rename to charts/system-upgrade-contoller/.helmignore diff --git a/helm/system-upgrade-contoller/Chart.yaml b/charts/system-upgrade-contoller/Chart.yaml similarity index 100% rename from helm/system-upgrade-contoller/Chart.yaml rename to charts/system-upgrade-contoller/Chart.yaml diff --git a/helm/system-upgrade-contoller/templates/NOTES.txt b/charts/system-upgrade-contoller/templates/NOTES.txt similarity index 100% rename from helm/system-upgrade-contoller/templates/NOTES.txt rename to charts/system-upgrade-contoller/templates/NOTES.txt diff --git a/helm/system-upgrade-contoller/templates/_helpers.tpl b/charts/system-upgrade-contoller/templates/_helpers.tpl similarity index 100% rename from helm/system-upgrade-contoller/templates/_helpers.tpl rename to charts/system-upgrade-contoller/templates/_helpers.tpl diff --git a/helm/system-upgrade-contoller/templates/cm.yaml b/charts/system-upgrade-contoller/templates/cm.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/cm.yaml rename to charts/system-upgrade-contoller/templates/cm.yaml diff --git a/helm/system-upgrade-contoller/templates/crb.yaml b/charts/system-upgrade-contoller/templates/crb.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/crb.yaml rename to charts/system-upgrade-contoller/templates/crb.yaml diff --git a/helm/system-upgrade-contoller/templates/crd.yaml b/charts/system-upgrade-contoller/templates/crd.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/crd.yaml rename to charts/system-upgrade-contoller/templates/crd.yaml diff --git a/helm/system-upgrade-contoller/templates/deployment.yaml b/charts/system-upgrade-contoller/templates/deployment.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/deployment.yaml rename to charts/system-upgrade-contoller/templates/deployment.yaml diff --git a/helm/system-upgrade-contoller/templates/ns.yaml b/charts/system-upgrade-contoller/templates/ns.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/ns.yaml rename to charts/system-upgrade-contoller/templates/ns.yaml diff --git a/helm/system-upgrade-contoller/templates/plan.yaml b/charts/system-upgrade-contoller/templates/plan.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/plan.yaml rename to charts/system-upgrade-contoller/templates/plan.yaml diff --git a/helm/system-upgrade-contoller/templates/serviceaccount.yaml b/charts/system-upgrade-contoller/templates/serviceaccount.yaml similarity index 100% rename from helm/system-upgrade-contoller/templates/serviceaccount.yaml rename to charts/system-upgrade-contoller/templates/serviceaccount.yaml diff --git a/helm/system-upgrade-contoller/values.yaml b/charts/system-upgrade-contoller/values.yaml similarity index 100% rename from helm/system-upgrade-contoller/values.yaml rename to charts/system-upgrade-contoller/values.yaml From 4d6d834b781ed7bedf28da43e59d4e18279f6ea4 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Wed, 3 Apr 2024 14:53:18 +0200 Subject: [PATCH 15/16] Add pipeline for helm chart like https://github.com/otwld/drone-chart-releaser-github-pages --- .drone.yml | 12 ++ .../{templates => crds}/crd.yaml | 0 .../templates/clusterrole.yaml | 119 ++++++++++++++++++ .../templates/clusterrolebinding.yaml | 36 ++++++ .../templates/crb.yaml | 13 -- charts/system-upgrade-contoller/values.yaml | 4 +- 6 files changed, 169 insertions(+), 15 deletions(-) rename charts/system-upgrade-contoller/{templates => crds}/crd.yaml (100%) create mode 100644 charts/system-upgrade-contoller/templates/clusterrole.yaml create mode 100644 charts/system-upgrade-contoller/templates/clusterrolebinding.yaml delete mode 100644 charts/system-upgrade-contoller/templates/crb.yaml diff --git a/.drone.yml b/.drone.yml index 14ab0377..85e8ecc1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -243,3 +243,15 @@ steps: when: instance: - drone-publish.rancher.io +--- +kind: pipeline +name: default + +steps: +- name: publish + image: otwld/drone-chart-releaser-github-pages + settings: + cr_token: + from_secret: github_access_token + skip_existing: true + charts_dir: 'charts' # Specify the charts directory \ No newline at end of file diff --git a/charts/system-upgrade-contoller/templates/crd.yaml b/charts/system-upgrade-contoller/crds/crd.yaml similarity index 100% rename from charts/system-upgrade-contoller/templates/crd.yaml rename to charts/system-upgrade-contoller/crds/crd.yaml diff --git a/charts/system-upgrade-contoller/templates/clusterrole.yaml b/charts/system-upgrade-contoller/templates/clusterrole.yaml new file mode 100644 index 00000000..471aa079 --- /dev/null +++ b/charts/system-upgrade-contoller/templates/clusterrole.yaml @@ -0,0 +1,119 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: system-upgrade-controller +rules: +- apiGroups: + - batch + resources: + - jobs + verbs: + - get + - list + - watch +- apiGroups: + - "apiextensions.k8s.io" + resources: + - customresourcedefinitions + verbs: + - get + - list + - watch + - create + - patch + - update +- apiGroups: + - "" + resources: + - namespaces + - nodes + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - nodes + verbs: + - update +- apiGroups: + - upgrade.cattle.io + resources: + - plans + - plans/status + verbs: + - get + - list + - watch + - create + - patch + - update + - delete +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: system-upgrade-controller +rules: +- apiGroups: + - batch + resources: + - jobs + verbs: + - create + - delete + - deletecollection + - patch + - update + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch +--- +# Borrowed from https://stackoverflow.com/a/63553032 +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: system-upgrade-controller-drainer +rules: + # Needed to evict pods + - apiGroups: + - "" + resources: + - "pods/eviction" + verbs: + - "create" + # Needed to list pods by Node + - apiGroups: + - "" + resources: + - "pods" + verbs: + - "get" + - "list" + # Needed to cordon Nodes + - apiGroups: + - "" + resources: + - "nodes" + verbs: + - "get" + - "patch" + # Needed to determine Pod owners + - apiGroups: + - "apps" + resources: + - "statefulsets" + - "daemonsets" + - "replicasets" + verbs: + - "get" + - "list" diff --git a/charts/system-upgrade-contoller/templates/clusterrolebinding.yaml b/charts/system-upgrade-contoller/templates/clusterrolebinding.yaml new file mode 100644 index 00000000..8a74335e --- /dev/null +++ b/charts/system-upgrade-contoller/templates/clusterrolebinding.yaml @@ -0,0 +1,36 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: system-upgrade-drainer +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system-upgrade-controller-drainer +subjects: +- kind: ServiceAccount + name: system-upgrade +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: system-upgrade +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system-upgrade-controller +subjects: +- kind: ServiceAccount + name: system-upgrade +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: system-upgrade +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: system-upgrade-controller +subjects: +- kind: ServiceAccount + name: system-upgrade diff --git a/charts/system-upgrade-contoller/templates/crb.yaml b/charts/system-upgrade-contoller/templates/crb.yaml deleted file mode 100644 index 9a5be20e..00000000 --- a/charts/system-upgrade-contoller/templates/crb.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: system-upgrade -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-admin -subjects: -- kind: ServiceAccount - name: system-upgrade - namespace: {{.Values.targetns }} \ No newline at end of file diff --git a/charts/system-upgrade-contoller/values.yaml b/charts/system-upgrade-contoller/values.yaml index 9c5c7ab9..30d2d68b 100644 --- a/charts/system-upgrade-contoller/values.yaml +++ b/charts/system-upgrade-contoller/values.yaml @@ -7,10 +7,10 @@ targetns: system-upgrade controller: image: rancher/system-upgrade-controller - version: v0.13.0 + version: v0.13.4 # if install eq true 2 sample plans will installed plan: install: false image: rancher/k3s-upgrade - version: v1.24.6+k3s1 \ No newline at end of file + version: v1.25.4 \ No newline at end of file From b971afd164c6a8174296b976396df6de3b990f74 Mon Sep 17 00:00:00 2001 From: Ludger Pottmeier Date: Wed, 3 Apr 2024 14:58:51 +0200 Subject: [PATCH 16/16] fix issue --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 85e8ecc1..25990754 100644 --- a/.drone.yml +++ b/.drone.yml @@ -245,13 +245,13 @@ steps: - drone-publish.rancher.io --- kind: pipeline -name: default +name: helm steps: - name: publish image: otwld/drone-chart-releaser-github-pages settings: cr_token: - from_secret: github_access_token + from_secret: github_token skip_existing: true charts_dir: 'charts' # Specify the charts directory \ No newline at end of file