maas-region cleanup
This commit is contained in:
parent
584e820eca
commit
922967ee7f
@ -1,3 +0,0 @@
|
||||
{{- define "joinListWithColon" -}}
|
||||
{{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }}
|
||||
{{- end -}}
|
@ -35,30 +35,6 @@ configure_maas_default_url() {
|
||||
maas-region local_config_set --maas-url "http://${ipaddr}/MAAS"
|
||||
}
|
||||
|
||||
get_default_route_ip6() {
|
||||
while read Src SrcPref Dest DestPref Gateway Metric RefCnt Use Flags Iface
|
||||
do
|
||||
[ "$SrcPref" = 00 ] && [ "$Iface" != lo ] && break
|
||||
done < /proc/net/ipv6_route
|
||||
if [ -n "$Iface" ]; then
|
||||
LC_ALL=C /sbin/ip -6 addr list dev "$Iface" scope global permanent |
|
||||
sed -n '/ inet6 /s/.*inet6 \([0-9a-fA-F:]*\).*/[\1]/p' | head -1
|
||||
fi
|
||||
}
|
||||
|
||||
get_default_route_ip4() {
|
||||
while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
|
||||
do
|
||||
[ "$Mask" = "00000000" ] && break
|
||||
done < /proc/net/route
|
||||
if [ -n "$Iface" ]; then
|
||||
ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$Iface" scope global)
|
||||
ipaddr=${ipaddr#* inet }
|
||||
ipaddr=${ipaddr%%/*}
|
||||
echo $ipaddr
|
||||
fi
|
||||
}
|
||||
|
||||
extract_default_maas_url() {
|
||||
# Extract DEFAULT_MAAS_URL IP/host setting from config file $1.
|
||||
grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f3
|
||||
@ -86,17 +62,8 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
|
||||
db_get maas/default-maas-url
|
||||
ipaddr="$RET"
|
||||
if [ -z "$ipaddr" ]; then
|
||||
#ipaddr=$(get_default_route_ip4)
|
||||
ipaddr="maas-region-ui.{{ .Release.Namespace }}"
|
||||
fi
|
||||
if [ -z "$ipaddr" ]; then
|
||||
#ipaddr=$(get_default_route_ip6)
|
||||
ipaddr="maas-region-ui.{{ .Release.Namespace }}"
|
||||
fi
|
||||
# Fallback default is "localhost"
|
||||
if [ -z "$ipaddr" ]; then
|
||||
ipaddr=localhost
|
||||
fi
|
||||
# Set the IP address of the interface with default route
|
||||
configure_maas_default_url "$ipaddr"
|
||||
db_subst maas/installation-note MAAS_URL "$ipaddr"
|
@ -5,3 +5,5 @@ metadata:
|
||||
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 }}
|
||||
|
@ -5,3 +5,5 @@ metadata:
|
||||
data:
|
||||
named.conf.options: |+
|
||||
{{ tuple "etc/_region-dns-config.tpl" . | include "template" | indent 4 }}
|
||||
secret: |
|
||||
{{ tuple "etc/_secret.tpl" . | include "template" | indent 4 }}
|
||||
|
@ -1,10 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: maas-region-var
|
||||
data:
|
||||
maas-region-controller.postinst: |
|
||||
{{ tuple "var/_maas-region-controller.postinst.tpl" . | include "template" | indent 4 }}
|
||||
secret: |
|
||||
{{ tuple "var/_secret.tpl" . | include "template" | indent 4 }}
|
||||
|
@ -14,12 +14,7 @@ spec:
|
||||
"name": "init",
|
||||
"image": "{{ .Values.images.maas_region }}",
|
||||
"imagePullPolicy": "Always",
|
||||
"command": [
|
||||
"/bin/bash", "-c"
|
||||
],
|
||||
"args": [
|
||||
"chmod +x /tmp/start.sh; /tmp/start.sh"
|
||||
],
|
||||
"command": ["bash", "/tmp/start.sh"],
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "maas-config",
|
||||
@ -59,6 +54,9 @@ spec:
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: {{ .Values.network.port.region_container }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ .Values.network.port.region_container }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
@ -91,7 +89,7 @@ spec:
|
||||
emptyDir: {}
|
||||
- name: maas-region-secret
|
||||
configMap:
|
||||
name: maas-region-var
|
||||
name: maas-region-etc
|
||||
- name: maas-config
|
||||
emptyDir: {}
|
||||
- name: maas-dns-config
|
||||
@ -102,4 +100,4 @@ spec:
|
||||
name: maas-region-bin
|
||||
- name: maasregionpostinst
|
||||
configMap:
|
||||
name: maas-region-var
|
||||
name: maas-region-bin
|
||||
|
@ -5,7 +5,6 @@ metadata:
|
||||
labels:
|
||||
app: maas-region-ui
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: {{ .Values.network.port.service_gui }}
|
||||
targetPort: {{ .Values.network.port.service_gui_target }}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
images:
|
||||
maas_region: quay.io/attcomdev/maas-region:2.1.2-1
|
||||
maas_rack: quay.io/attcomdev/maas-rack:2.1.2
|
||||
maas_rack: quay.io/attcomdev/maas-rack:2.1.2-1
|
||||
|
||||
labels:
|
||||
node_selector_key: openstack-control-plane
|
||||
|
Loading…
Reference in New Issue
Block a user