Adding configurable maas secret (#176)
This commit is contained in:
parent
3d51217262
commit
347fdc86b0
24
maas/templates/bin/_register-rack-controller.sh.tpl
Normal file
24
maas/templates/bin/_register-rack-controller.sh.tpl
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# show env
|
||||
env > /tmp/env
|
||||
|
||||
echo "register-rack-controller URL: "{{ .Values.service_name }}.{{ .Release.Namespace }}
|
||||
|
||||
# note the secret must be a valid hex value
|
||||
|
||||
# register forever
|
||||
while [ 1 ];
|
||||
do
|
||||
if maas-rack register --url=http://{{ .Values.service_name }}.{{ .Release.Namespace }}/MAAS --secret={{ .Values.secret | quote }};
|
||||
then
|
||||
echo "Successfully registered with MaaS Region Controller"
|
||||
break
|
||||
else
|
||||
echo "Unable to register with http://{{ .Values.service_name }}.{{ .Release.Namespace }}/MAAS... will try again"
|
||||
sleep 10
|
||||
fi;
|
||||
|
||||
done;
|
@ -1,9 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: maas-region-bin
|
||||
name: maas-bin
|
||||
data:
|
||||
start.sh: |
|
||||
{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }}
|
||||
maas-region-controller.postinst: |
|
||||
{{ tuple "bin/_maas-region-controller.postinst.tpl" . | include "template" | indent 4 }}
|
||||
register-rack-controller.sh: |
|
||||
{{ tuple "bin/_register-rack-controller.sh.tpl" . | include "template" | indent 4 }}
|
||||
|
@ -1,7 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: maas-region-etc
|
||||
name: maas-etc
|
||||
data:
|
||||
named.conf.options: |+
|
||||
{{ tuple "etc/_region-dns-config.tpl" . | include "template" | indent 4 }}
|
||||
|
@ -11,6 +11,7 @@ spec:
|
||||
nodeSelector:
|
||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
||||
hostNetwork: true
|
||||
dnsPolicy: ClusterFirst
|
||||
containers:
|
||||
- name: maas-rack
|
||||
image: {{ .Values.images.maas_rack }}
|
||||
@ -26,3 +27,12 @@ spec:
|
||||
{{- end }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: registerrackcontrollersh
|
||||
mountPath: "/usr/local/bin/register-rack-controller.sh"
|
||||
subPath: "register-rack-controller.sh"
|
||||
volumes:
|
||||
- name: registerrackcontrollersh
|
||||
configMap:
|
||||
name: maas-bin
|
||||
defaultMode: 0511
|
||||
|
@ -98,15 +98,15 @@ spec:
|
||||
emptyDir: {}
|
||||
- name: maas-region-secret
|
||||
configMap:
|
||||
name: maas-region-etc
|
||||
name: maas-etc
|
||||
- name: maas-config
|
||||
emptyDir: {}
|
||||
- name: maas-dns-config
|
||||
configMap:
|
||||
name: maas-region-etc
|
||||
name: maas-etc
|
||||
- name: startsh
|
||||
configMap:
|
||||
name: maas-region-bin
|
||||
name: maas-bin
|
||||
- name: maasregionpostinst
|
||||
configMap:
|
||||
name: maas-region-bin
|
||||
name: maas-bin
|
||||
|
@ -1 +1 @@
|
||||
3858f62230ac3c915f300c664312c63f
|
||||
{{ .Values.secret }}
|
||||
|
@ -19,7 +19,9 @@ network:
|
||||
service_proxy: 8000
|
||||
service_proxy_target: 8000
|
||||
|
||||
service_name: maas-region-ui
|
||||
secret: 3858f62230ac3c915f300c664312c63f
|
||||
|
||||
service_name: maas-region-ui
|
||||
|
||||
resources:
|
||||
enabled: false
|
||||
|
Loading…
Reference in New Issue
Block a user