Improve tooling for chart patching, fix for storage efs driver

This commit is contained in:
Stefan Reimer 2023-08-23 11:37:57 +00:00
parent 0337591810
commit 2130f830ec
6 changed files with 60 additions and 14 deletions

View File

@ -1,7 +1,7 @@
diff -tuNr charts/aws-efs-csi-driver.orig/templates/controller-deployment.yaml charts/aws-efs-csi-driver/templates/controller-deployment.yaml diff -rtuN charts/aws-efs-csi-driver.orig/templates/controller-deployment.yaml charts/aws-efs-csi-driver/templates/controller-deployment.yaml
--- charts/aws-efs-csi-driver.orig/templates/controller-deployment.yaml 2022-10-11 20:57:20.000000000 +0200 --- charts/aws-efs-csi-driver.orig/templates/controller-deployment.yaml 2023-08-23 11:32:48.964952023 +0000
+++ charts/aws-efs-csi-driver/templates/controller-deployment.yaml 2022-10-12 22:40:48.100658738 +0200 +++ charts/aws-efs-csi-driver/templates/controller-deployment.yaml 2023-08-23 11:32:48.968285371 +0000
@@ -69,9 +73,14 @@ @@ -76,9 +76,14 @@
- name: AWS_USE_FIPS_ENDPOINT - name: AWS_USE_FIPS_ENDPOINT
value: "true" value: "true"
{{- end }} {{- end }}
@ -16,7 +16,7 @@ diff -tuNr charts/aws-efs-csi-driver.orig/templates/controller-deployment.yaml c
ports: ports:
- name: healthz - name: healthz
containerPort: {{ .Values.controller.healthPort }} containerPort: {{ .Values.controller.healthPort }}
@@ -122,6 +131,13 @@ @@ -137,6 +142,13 @@
volumes: volumes:
- name: socket-dir - name: socket-dir
emptyDir: {} emptyDir: {}
@ -30,3 +30,14 @@ diff -tuNr charts/aws-efs-csi-driver.orig/templates/controller-deployment.yaml c
{{- with .Values.controller.affinity }} {{- with .Values.controller.affinity }}
affinity: {{- toYaml . | nindent 8 }} affinity: {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
diff -rtuN charts/aws-efs-csi-driver.orig/templates/node-daemonset.yaml charts/aws-efs-csi-driver/templates/node-daemonset.yaml
--- charts/aws-efs-csi-driver.orig/templates/node-daemonset.yaml 2023-08-23 11:32:48.964952023 +0000
+++ charts/aws-efs-csi-driver/templates/node-daemonset.yaml 2023-08-23 11:35:11.605635352 +0000
@@ -51,6 +51,7 @@
{{- with .Values.node.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
+ hostNetwork: true
serviceAccountName: {{ .Values.node.serviceAccount.name }}
priorityClassName: system-node-critical
{{- with .Values.node.tolerations }}

View File

@ -51,6 +51,7 @@ spec:
{{- with .Values.node.dnsConfig }} {{- with .Values.node.dnsConfig }}
dnsConfig: {{- toYaml . | nindent 8 }} dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
hostNetwork: true
serviceAccountName: {{ .Values.node.serviceAccount.name }} serviceAccountName: {{ .Values.node.serviceAccount.name }}
priorityClassName: system-node-critical priorityClassName: system-node-critical
{{- with .Values.node.tolerations }} {{- with .Values.node.tolerations }}

View File

@ -58,7 +58,7 @@
"subdir": "lib/promgrafonnet" "subdir": "lib/promgrafonnet"
} }
}, },
"version": "46fc905d5b2981642043088ac7902ea50db2903e", "version": "a10227e04218679b5e0e1d50784a4251bf3bdaf3",
"sum": "zv7hXGui6BfHzE9wPatHI/AGZa4A2WKo6pq7ZdqBsps=" "sum": "zv7hXGui6BfHzE9wPatHI/AGZa4A2WKo6pq7ZdqBsps="
}, },
{ {

View File

@ -1,6 +1,6 @@
diff -tuNr charts/lvm-localpv.orig/templates/lvm-controller.yaml charts/lvm-localpv/templates/lvm-controller.yaml diff -rtuN charts/lvm-localpv.orig/templates/lvm-controller.yaml charts/lvm-localpv/templates/lvm-controller.yaml
--- charts/lvm-localpv.orig/templates/lvm-controller.yaml 2022-01-11 13:47:28.717133358 +0100 --- charts/lvm-localpv.orig/templates/lvm-controller.yaml 2023-08-23 11:28:23.687014522 +0000
+++ charts/lvm-localpv/templates/lvm-controller.yaml 2022-01-11 13:49:49.160473040 +0100 +++ charts/lvm-localpv/templates/lvm-controller.yaml 2023-08-23 11:28:23.690347871 +0000
@@ -72,16 +72,6 @@ @@ -72,16 +72,6 @@
mountPath: /var/lib/csi/sockets/pluginproxy/ mountPath: /var/lib/csi/sockets/pluginproxy/
resources: resources:

View File

@ -80,7 +80,7 @@ istio-private-ingress:
metrics: metrics:
enabled: false enabled: false
namespace: monitoring namespace: monitoring
targetRevision: 0.9.2 targetRevision: 0.9.4
istio: istio:
grafana: {} grafana: {}
prometheus: {} prometheus: {}

View File

@ -29,18 +29,52 @@ login_ecr_public() {
--password-stdin public.ecr.aws --password-stdin public.ecr.aws
} }
patch_chart() { _get_extract_chart() {
CHART=$1 local CHART=$1
local VERSION=$2
VERSION=$(yq eval '.dependencies[] | select(.name=="'$CHART'") | .version' Chart.yaml) local REPO=$(yq eval '.dependencies[] | select(.name=="'$CHART'") | .repository' Chart.yaml)
local URL=$(curl -s $REPO/index.yaml | yq '.entries."'$CHART'".[] | select (.version=="'$VERSION'") | .urls[0]')
wget -qO - $URL | tar xfvz - -C charts
}
patch_chart() {
local CHART=$1
local VERSION=$(yq eval '.dependencies[] | select(.name=="'$CHART'") | .version' Chart.yaml)
rm -rf charts/$CHART rm -rf charts/$CHART
tar xfvz charts/$CHART-$VERSION.tgz -C charts && rm charts/$CHART-$VERSION.tgz
# If helm already pulled the chart archive use it
if [ -f charts/$CHART-$VERSION.tgz ]; then
tar xfvz charts/$CHART-$VERSION.tgz -C charts && rm charts/$CHART-$VERSION.tgz
# otherwise parse Chart.yaml and get it
else
_get_extract_chart $CHART $VERSION
fi
# diff -tuNr charts/aws-node-termination-handler.orig charts/aws-node-termination-handler > nth.patch # diff -tuNr charts/aws-node-termination-handler.orig charts/aws-node-termination-handler > nth.patch
[ -r $CHART.patch ] && patch -p0 -i $CHART.patch --no-backup-if-mismatch || true [ -r $CHART.patch ] && patch -p0 -i $CHART.patch --no-backup-if-mismatch || true
} }
patch_rebase() {
local CHART=$1
local VERSION=$(yq eval '.dependencies[] | select(.name=="'$CHART'") | .version' Chart.yaml)
rm -rf charts/$CHART
_get_extract_chart $CHART $VERSION
cp -r charts/$CHART charts/$CHART.orig
patch -p0 -i $CHART.patch --no-backup-if-mismatch
}
patch_create() {
local CHART=$1
diff -rtuN charts/$CHART.orig charts/$CHART > $CHART.patch
rm -rf charts/$CHART.orig
}
update_docs() { update_docs() {
helm-docs helm-docs
} }