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
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: maas-region-bin
|
name: maas-bin
|
||||||
data:
|
data:
|
||||||
start.sh: |
|
start.sh: |
|
||||||
{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }}
|
{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }}
|
||||||
maas-region-controller.postinst: |
|
maas-region-controller.postinst: |
|
||||||
{{ tuple "bin/_maas-region-controller.postinst.tpl" . | include "template" | indent 4 }}
|
{{ 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
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: maas-region-etc
|
name: maas-etc
|
||||||
data:
|
data:
|
||||||
named.conf.options: |+
|
named.conf.options: |+
|
||||||
{{ tuple "etc/_region-dns-config.tpl" . | include "template" | indent 4 }}
|
{{ tuple "etc/_region-dns-config.tpl" . | include "template" | indent 4 }}
|
||||||
|
@ -11,6 +11,7 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
||||||
hostNetwork: true
|
hostNetwork: true
|
||||||
|
dnsPolicy: ClusterFirst
|
||||||
containers:
|
containers:
|
||||||
- name: maas-rack
|
- name: maas-rack
|
||||||
image: {{ .Values.images.maas_rack }}
|
image: {{ .Values.images.maas_rack }}
|
||||||
@ -26,3 +27,12 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
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: {}
|
emptyDir: {}
|
||||||
- name: maas-region-secret
|
- name: maas-region-secret
|
||||||
configMap:
|
configMap:
|
||||||
name: maas-region-etc
|
name: maas-etc
|
||||||
- name: maas-config
|
- name: maas-config
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: maas-dns-config
|
- name: maas-dns-config
|
||||||
configMap:
|
configMap:
|
||||||
name: maas-region-etc
|
name: maas-etc
|
||||||
- name: startsh
|
- name: startsh
|
||||||
configMap:
|
configMap:
|
||||||
name: maas-region-bin
|
name: maas-bin
|
||||||
- name: maasregionpostinst
|
- name: maasregionpostinst
|
||||||
configMap:
|
configMap:
|
||||||
name: maas-region-bin
|
name: maas-bin
|
||||||
|
@ -1 +1 @@
|
|||||||
3858f62230ac3c915f300c664312c63f
|
{{ .Values.secret }}
|
||||||
|
@ -19,7 +19,9 @@ network:
|
|||||||
service_proxy: 8000
|
service_proxy: 8000
|
||||||
service_proxy_target: 8000
|
service_proxy_target: 8000
|
||||||
|
|
||||||
service_name: maas-region-ui
|
secret: 3858f62230ac3c915f300c664312c63f
|
||||||
|
|
||||||
|
service_name: maas-region-ui
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user