Skip to content

Commit

Permalink
Apply to slim
Browse files Browse the repository at this point in the history
  • Loading branch information
ciiiii committed Nov 1, 2023
1 parent a040e97 commit 2018913
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
26 changes: 24 additions & 2 deletions charts/sn-platform-slim/templates/toolset/jwt-secret-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,53 @@ spec:
- name: {{ template "pulsar.fullname" . }}-jwt-secret-init-config
configMap:
name: {{ template "pulsar.fullname" . }}-jwt-secret-init-config
- name: tmp
emptyDir: {}
initContainers:
- name: "kubectl"
image: "{{ .Values.images.toolset.kubectl.repository }}:{{ .Values.images.toolset.kubectl.tag }}"
imagePullPolicy: {{ .Values.images.toolset.kubectl.pullPolicy }}
command: ["cp", "/opt/bitnami/kubectl/bin/kubectl", "/tmp/binaries"]
{{- if .Values.toolset.resources }}
resources:
{{ toYaml .Values.toolset.resources | indent 10 }}
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp/binaries
{{- if .Values.toolset.securityContext }}
securityContext: {{- toYaml .Values.toolset.securityContext | nindent 8 }}
{{- end }}
containers:
- name: "{{ template "pulsar.fullname" . }}-jwt-secret-init"
image: "{{ .Values.images.toolset.repository }}:{{ .Values.images.toolset.tag }}"
imagePullPolicy: {{ .Values.images.toolset.pullPolicy }}
command: ["bash", "-c"]
args:
- >
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl";
- |
set -ex;
cp /tmp/binaries/kubectl /pulsar/kubectl;
chmod +x /pulsar/kubectl;
mkdir -p scripts/pulsar;
cp scripts/jwt-secret-config/* scripts/pulsar;
chmod +x scripts/pulsar/*;
usingSecretKey={{ .Values.auth.authentication.jwt.usingSecretKey }};
ls -lh scripts/pulsar/;
if [ "${usingSecretKey}" = "true" ]; then
./scripts/pulsar/prepare_helm_release.sh -n {{ template "pulsar.namespace" . }} -k {{ .Release.Name }} --symmetric;
else
./scripts/pulsar/prepare_helm_release.sh -n {{ template "pulsar.namespace" . }} -k {{ .Release.Name }};
fi;
curl -s -X POST http://localhost:15020/quitquitquit;
{{- if .Values.toolset.resources }}
resources:
{{ toYaml .Values.toolset.resources | indent 10 }}
{{- end }}
volumeMounts:
- mountPath: /pulsar/scripts/jwt-secret-config
name: {{ template "pulsar.fullname" . }}-jwt-secret-init-config
- name: tmp
mountPath: /tmp/binaries
restartPolicy: Never
{{- if .Values.toolset.securityContext }}
securityContext: {{- toYaml .Values.toolset.securityContext | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/sn-platform-slim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ images:
repository: busybox
tag: "1.36.1-uclibc"
pullPolicy: IfNotPresent
kubectl:
repository: bitnami/kubectl
tag: "1.28.3"
pullPolicy: IfNotPresent
prometheus:
repository: quay.io/prometheus/prometheus
tag: "v2.43.0"
Expand Down

0 comments on commit 2018913

Please sign in to comment.