Fix pulsar-manager persistence (#485)
- only setup environment in pulsar manager if broker is deployed - fix indent - enable persistence for manager and move configs around
This commit is contained in:
parent
d9e65836e8
commit
347326e0c3
@ -357,8 +357,7 @@ function ci::test_pulsar_manager() {
|
|||||||
until ${KUBECTL} get jobs -n ${NAMESPACE} ${CLUSTER}-pulsar-manager-init -o json | jq -r '.status.conditions[] | select (.type | test("Complete")).status' | grep True; do sleep 3; done
|
until ${KUBECTL} get jobs -n ${NAMESPACE} ${CLUSTER}-pulsar-manager-init -o json | jq -r '.status.conditions[] | select (.type | test("Complete")).status' | grep True; do sleep 3; done
|
||||||
${KUBECTL} describe job -n ${NAMESPACE} ${CLUSTER}-pulsar-manager-init
|
${KUBECTL} describe job -n ${NAMESPACE} ${CLUSTER}-pulsar-manager-init
|
||||||
${KUBECTL} logs -n ${NAMESPACE} job.batch/${CLUSTER}-pulsar-manager-init
|
${KUBECTL} logs -n ${NAMESPACE} job.batch/${CLUSTER}-pulsar-manager-init
|
||||||
# this line errors in some tests? - i do not know why, but is really useful for debugging, try: cat ./pulsar-manager.log otherwise
|
${KUBECTL} exec -n ${NAMESPACE} ${CLUSTER}-pulsar-manager-0 -- cat /pulsar-manager/pulsar-manager.log
|
||||||
# ${KUBECTL} exec -n ${NAMESPACE} ${CLUSTER}-pulsar-manager-0 -- cat /pulsar-manager/pulsar-manager/pulsar-manager.log
|
|
||||||
echo "Checking Podname"
|
echo "Checking Podname"
|
||||||
podname=$(${KUBECTL} get pods -n ${NAMESPACE} -l component=pulsar-manager --no-headers -o custom-columns=":metadata.name")
|
podname=$(${KUBECTL} get pods -n ${NAMESPACE} -l component=pulsar-manager --no-headers -o custom-columns=":metadata.name")
|
||||||
echo "Getting pulsar manager UI password"
|
echo "Getting pulsar manager UI password"
|
||||||
|
|||||||
@ -56,6 +56,7 @@ spec:
|
|||||||
done;
|
done;
|
||||||
# This init container will wait for at least one broker to be ready before
|
# This init container will wait for at least one broker to be ready before
|
||||||
# initializing the pulsar-manager
|
# initializing the pulsar-manager
|
||||||
|
{{- if .Values.components.broker }}
|
||||||
- name: wait-broker-ready
|
- name: wait-broker-ready
|
||||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
|
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
|
||||||
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
|
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
|
||||||
@ -70,6 +71,7 @@ spec:
|
|||||||
sleep 10;
|
sleep 10;
|
||||||
brokerServiceNumber="$(nslookup -timeout=10 {{ template "pulsar.fullname" . }}-{{ .Values.broker.component }} | grep Name | wc -l)";
|
brokerServiceNumber="$(nslookup -timeout=10 {{ template "pulsar.fullname" . }}-{{ .Values.broker.component }} | grep Name | wc -l)";
|
||||||
done;
|
done;
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-init"
|
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-init"
|
||||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
|
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
|
||||||
@ -118,6 +120,7 @@ spec:
|
|||||||
echo "$LOGIN_REPLY"
|
echo "$LOGIN_REPLY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
{{- if .Values.components.broker }}
|
||||||
LOGIN_TOKEN=$(grep "token:" headers.txt | sed 's/^.*: //')
|
LOGIN_TOKEN=$(grep "token:" headers.txt | sed 's/^.*: //')
|
||||||
LOGIN_JSESSSIONID=$(grep -o "JSESSIONID=[a-zA-Z0-9_]*" headers.txt | sed 's/^.*=//')
|
LOGIN_JSESSSIONID=$(grep -o "JSESSIONID=[a-zA-Z0-9_]*" headers.txt | sed 's/^.*=//')
|
||||||
|
|
||||||
@ -147,6 +150,15 @@ spec:
|
|||||||
echo "Error creating environment"
|
echo "Error creating environment"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
{{- else }}
|
||||||
|
if [ -n "$(echo "$LOGIN_REPLY" | grep 'success')" ]; then
|
||||||
|
echo "Successfully created / found existing account"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Error creating account"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
- name: USERNAME
|
- name: USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|||||||
@ -27,5 +27,18 @@ metadata:
|
|||||||
{{- include "pulsar.standardLabels" . | nindent 4 }}
|
{{- include "pulsar.standardLabels" . | nindent 4 }}
|
||||||
component: {{ .Values.pulsar_manager.component }}
|
component: {{ .Values.pulsar_manager.component }}
|
||||||
data:
|
data:
|
||||||
|
PULSAR_CLUSTER: {{ template "pulsar.fullname" . }}
|
||||||
|
PULSAR_MANAGER_OPTS: "-Dlog4j2.formatMsgNoLookups=true"
|
||||||
|
{{- if .Values.auth.authentication.enabled }}
|
||||||
|
# auth
|
||||||
|
{{- if eq .Values.auth.authentication.provider "jwt" }}
|
||||||
|
{{- if .Values.auth.authentication.jwt.usingSecretKey }}
|
||||||
|
SECRET_KEY: "file:///pulsar-manager/keys/token/secret.key"
|
||||||
|
{{- else }}
|
||||||
|
PRIVATE_KEY: "file:///pulsar-manager/keys/token/private.key"
|
||||||
|
PUBLIC_KEY: "file:///pulsar-manager/keys/token/public.key"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{ toYaml .Values.pulsar_manager.configData | indent 2}}
|
{{ toYaml .Values.pulsar_manager.configData | indent 2}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@ -79,8 +79,6 @@ spec:
|
|||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}"
|
||||||
env:
|
env:
|
||||||
- name: PULSAR_CLUSTER
|
|
||||||
value: {{ template "pulsar.fullname" . }}
|
|
||||||
- name: USERNAME
|
- name: USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
@ -99,8 +97,6 @@ spec:
|
|||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-secret"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-secret"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
key: DB_PASSWORD
|
key: DB_PASSWORD
|
||||||
- name: PULSAR_MANAGER_OPTS
|
|
||||||
value: "$(PULSAR_MANAGER_OPTS) -Dlog4j2.formatMsgNoLookups=true"
|
|
||||||
{{- if .Values.auth.authentication.enabled }}
|
{{- if .Values.auth.authentication.enabled }}
|
||||||
{{- if eq .Values.auth.authentication.provider "jwt" }}
|
{{- if eq .Values.auth.authentication.provider "jwt" }}
|
||||||
{{- if .Values.auth.superUsers.manager }}
|
{{- if .Values.auth.superUsers.manager }}
|
||||||
@ -110,15 +106,6 @@ spec:
|
|||||||
key: TOKEN
|
key: TOKEN
|
||||||
name: "{{ .Release.Name }}-token-{{ .Values.auth.superUsers.manager }}"
|
name: "{{ .Release.Name }}-token-{{ .Values.auth.superUsers.manager }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.auth.authentication.jwt.usingSecretKey }}
|
|
||||||
- name: SECRET_KEY
|
|
||||||
value: file:///pulsar-manager/keys/token/secret.key
|
|
||||||
{{- else }}
|
|
||||||
- name: PRIVATE_KEY
|
|
||||||
value: file:///pulsar-manager/keys/token/private.key
|
|
||||||
- name: PUBLIC_KEY
|
|
||||||
value: file:///pulsar-manager/keys/token/public.key
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
|
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
|
||||||
|
|||||||
@ -1279,11 +1279,10 @@ pulsar_manager:
|
|||||||
configData:
|
configData:
|
||||||
REDIRECT_HOST: "http://127.0.0.1"
|
REDIRECT_HOST: "http://127.0.0.1"
|
||||||
REDIRECT_PORT: "9527"
|
REDIRECT_PORT: "9527"
|
||||||
DRIVER_CLASS_NAME: org.postgresql.Driver
|
LOG_LEVEL: "INFO"
|
||||||
URL: jdbc:postgresql://127.0.0.1:5432/pulsar_manager
|
# DB
|
||||||
LOG_LEVEL: DEBUG
|
URL: "jdbc:postgresql://127.0.0.1:5432/pulsar_manager"
|
||||||
SPRING_CONFIGURATION_FILE: "/pulsar-manager/pulsar-manager/application.properties"
|
DRIVER_CLASS_NAME: "org.postgresql.Driver"
|
||||||
PULSAR_MANAGER_OPTS: " -Dlog4j2.formatMsgNoLookups=true"
|
|
||||||
volumes:
|
volumes:
|
||||||
# use a persistent volume or emptyDir
|
# use a persistent volume or emptyDir
|
||||||
persistence: true
|
persistence: true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user