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"
|
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() {
|
||||||
# Extract DEFAULT_MAAS_URL IP/host setting from config file $1.
|
# Extract DEFAULT_MAAS_URL IP/host setting from config file $1.
|
||||||
grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f3
|
grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f3
|
||||||
@ -86,17 +62,8 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
|
|||||||
db_get maas/default-maas-url
|
db_get maas/default-maas-url
|
||||||
ipaddr="$RET"
|
ipaddr="$RET"
|
||||||
if [ -z "$ipaddr" ]; then
|
if [ -z "$ipaddr" ]; then
|
||||||
#ipaddr=$(get_default_route_ip4)
|
|
||||||
ipaddr="maas-region-ui.{{ .Release.Namespace }}"
|
ipaddr="maas-region-ui.{{ .Release.Namespace }}"
|
||||||
fi
|
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
|
# Set the IP address of the interface with default route
|
||||||
configure_maas_default_url "$ipaddr"
|
configure_maas_default_url "$ipaddr"
|
||||||
db_subst maas/installation-note MAAS_URL "$ipaddr"
|
db_subst maas/installation-note MAAS_URL "$ipaddr"
|
@ -5,3 +5,5 @@ metadata:
|
|||||||
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: |
|
||||||
|
{{ tuple "bin/_maas-region-controller.postinst.tpl" . | include "template" | indent 4 }}
|
||||||
|
@ -5,3 +5,5 @@ metadata:
|
|||||||
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 }}
|
||||||
|
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",
|
"name": "init",
|
||||||
"image": "{{ .Values.images.maas_region }}",
|
"image": "{{ .Values.images.maas_region }}",
|
||||||
"imagePullPolicy": "Always",
|
"imagePullPolicy": "Always",
|
||||||
"command": [
|
"command": ["bash", "/tmp/start.sh"],
|
||||||
"/bin/bash", "-c"
|
|
||||||
],
|
|
||||||
"args": [
|
|
||||||
"chmod +x /tmp/start.sh; /tmp/start.sh"
|
|
||||||
],
|
|
||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"name": "maas-config",
|
"name": "maas-config",
|
||||||
@ -59,6 +54,9 @@ spec:
|
|||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: {{ .Values.network.port.region_container }}
|
- containerPort: {{ .Values.network.port.region_container }}
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: {{ .Values.network.port.region_container }}
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
@ -91,7 +89,7 @@ spec:
|
|||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: maas-region-secret
|
- name: maas-region-secret
|
||||||
configMap:
|
configMap:
|
||||||
name: maas-region-var
|
name: maas-region-etc
|
||||||
- name: maas-config
|
- name: maas-config
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: maas-dns-config
|
- name: maas-dns-config
|
||||||
@ -102,4 +100,4 @@ spec:
|
|||||||
name: maas-region-bin
|
name: maas-region-bin
|
||||||
- name: maasregionpostinst
|
- name: maasregionpostinst
|
||||||
configMap:
|
configMap:
|
||||||
name: maas-region-var
|
name: maas-region-bin
|
||||||
|
@ -5,7 +5,6 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app: maas-region-ui
|
app: maas-region-ui
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.network.port.service_gui }}
|
- port: {{ .Values.network.port.service_gui }}
|
||||||
targetPort: {{ .Values.network.port.service_gui_target }}
|
targetPort: {{ .Values.network.port.service_gui_target }}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
images:
|
images:
|
||||||
maas_region: quay.io/attcomdev/maas-region:2.1.2-1
|
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:
|
labels:
|
||||||
node_selector_key: openstack-control-plane
|
node_selector_key: openstack-control-plane
|
||||||
|
Loading…
x
Reference in New Issue
Block a user