Skip to content

Commit

Permalink
Merge pull request att-comdev#92 from larryrensing/maas-region-cleanup
Browse files Browse the repository at this point in the history
maas region cleanup
  • Loading branch information
v1k0d3n authored Jan 19, 2017
2 parents 2ff5513 + 922967e commit 069e3f4
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 56 deletions.
3 changes: 0 additions & 3 deletions maas/templates/_helpers.tpl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions maas/templates/configmap-bin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions maas/templates/configmap-etc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
10 changes: 0 additions & 10 deletions maas/templates/configmap-var.yaml

This file was deleted.

14 changes: 6 additions & 8 deletions maas/templates/deploy-region.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -102,4 +100,4 @@ spec:
name: maas-region-bin
- name: maasregionpostinst
configMap:
name: maas-region-var
name: maas-region-bin
File renamed without changes.
1 change: 0 additions & 1 deletion maas/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion maas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 069e3f4

Please sign in to comment.