summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaspars Skels <kaspars.skels@gmail.com>2018-10-19 01:01:23 -0500
committerScott Hussey <sh8121@att.com>2018-10-19 09:06:28 -0500
commite53cb2d23700467ae939aba8b7a62f74b1f5f718 (patch)
tree8b034a85566e93f1a88f73bc19e4f94c4899892e
parentcdfb1737da21bbb097113a6aaeaae37117038781 (diff)
Set MAAS internal proxy to 31800
Looks like new version of MAAS has fixed long standing bug https://bugs.launchpad.net/maas/+bug/1779712 This will match internal MAAS ports to NodePort. Change-Id: I639a4c492eb80545c69fd132d3b2dc4cca524933
Notes
Notes (review): Code-Review+2: Alan Meadows <alan.meadows@gmail.com> Code-Review+1: Kaspars Skels <kaspars.skels@gmail.com> Code-Review+2: Craig Anderson <craig.anderson@att.com> Workflow+1: Craig Anderson <craig.anderson@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 19 Oct 2018 16:06:50 +0000 Reviewed-on: https://review.openstack.org/611781 Project: openstack/airship-maas Branch: refs/heads/master
-rw-r--r--charts/maas/templates/bin/_import-boot-resources.sh.tpl1
-rw-r--r--charts/maas/templates/job-import.yaml2
-rw-r--r--charts/maas/templates/service-region.yaml4
-rw-r--r--charts/maas/values.yaml5
-rw-r--r--images/maas-region-controller/2.3_proxy_port.patch36
-rw-r--r--images/maas-region-controller/Dockerfile2
6 files changed, 6 insertions, 44 deletions
diff --git a/charts/maas/templates/bin/_import-boot-resources.sh.tpl b/charts/maas/templates/bin/_import-boot-resources.sh.tpl
index 939ded7..cb0d704 100644
--- a/charts/maas/templates/bin/_import-boot-resources.sh.tpl
+++ b/charts/maas/templates/bin/_import-boot-resources.sh.tpl
@@ -118,6 +118,7 @@ function configure_proxy {
118 check_then_set enable_http_proxy ${MAAS_PROXY_ENABLED} 118 check_then_set enable_http_proxy ${MAAS_PROXY_ENABLED}
119 check_then_set use_peer_proxy ${MAAS_PEER_PROXY_ENABLED} 119 check_then_set use_peer_proxy ${MAAS_PEER_PROXY_ENABLED}
120 check_then_set http_proxy ${MAAS_PROXY_SERVER} 120 check_then_set http_proxy ${MAAS_PROXY_SERVER}
121 check_then_set maas_proxy_port ${MAAS_INTERNAL_PROXY_PORT}
121} 122}
122 123
123function configure_ntp { 124function configure_ntp {
diff --git a/charts/maas/templates/job-import.yaml b/charts/maas/templates/job-import.yaml
index bf032d4..b0cbf41 100644
--- a/charts/maas/templates/job-import.yaml
+++ b/charts/maas/templates/job-import.yaml
@@ -63,6 +63,8 @@ spec:
63 value: {{ .Values.conf.maas.proxy.peer_proxy_enabled | quote }} 63 value: {{ .Values.conf.maas.proxy.peer_proxy_enabled | quote }}
64 - name: MAAS_PROXY_SERVER 64 - name: MAAS_PROXY_SERVER
65 value: {{ .Values.conf.maas.proxy.proxy_server }} 65 value: {{ .Values.conf.maas.proxy.proxy_server }}
66 - name: MAAS_INTERNAL_PROXY_PORT
67 value: {{ .Values.network.port.service_proxy }}
66 - name: MAAS_HTTP_BOOT 68 - name: MAAS_HTTP_BOOT
67 value: {{ .Values.conf.maas.http_boot | quote }} 69 value: {{ .Values.conf.maas.http_boot | quote }}
68 - name: MAAS_NTP_SERVERS 70 - name: MAAS_NTP_SERVERS
diff --git a/charts/maas/templates/service-region.yaml b/charts/maas/templates/service-region.yaml
index 25d6336..646a0c6 100644
--- a/charts/maas/templates/service-region.yaml
+++ b/charts/maas/templates/service-region.yaml
@@ -30,9 +30,9 @@ spec:
30 nodePort: {{ .Values.network.gui.node_port.port }} 30 nodePort: {{ .Values.network.gui.node_port.port }}
31 {{ end }} 31 {{ end }}
32 - port: {{ .Values.network.port.service_proxy }} 32 - port: {{ .Values.network.port.service_proxy }}
33 targetPort: {{ .Values.network.port.service_proxy_target }} 33 targetPort: {{ .Values.network.port.service_proxy }}
34 {{ if .Values.network.proxy.node_port.enabled }} 34 {{ if .Values.network.proxy.node_port.enabled }}
35 nodePort: {{ .Values.network.proxy.node_port.port }} 35 nodePort: {{ .Values.network.port.service_proxy }}
36 {{ end }} 36 {{ end }}
37 name: proxy 37 name: proxy
38 selector: 38 selector:
diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml
index 63708b3..f2cd3b0 100644
--- a/charts/maas/values.yaml
+++ b/charts/maas/values.yaml
@@ -105,8 +105,6 @@ network:
105 proxy: 105 proxy:
106 node_port: 106 node_port:
107 enabled: true 107 enabled: true
108 # Do not change the port, hardcoded in MAAS source
109 port: 31800
110 gui: 108 gui:
111 node_port: 109 node_port:
112 enabled: true 110 enabled: true
@@ -115,8 +113,7 @@ network:
115 region_container: 80 113 region_container: 80
116 service_gui: 80 114 service_gui: 80
117 service_gui_target: 80 115 service_gui_target: 80
118 service_proxy: 8000 116 service_proxy: 31800
119 service_proxy_target: 8000
120 db_service: 5432 117 db_service: 5432
121 db_service_target: 5432 118 db_service_target: 5432
122 119
diff --git a/images/maas-region-controller/2.3_proxy_port.patch b/images/maas-region-controller/2.3_proxy_port.patch
deleted file mode 100644
index 89f98b7..0000000
--- a/images/maas-region-controller/2.3_proxy_port.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1diff --git a/src/maasserver/compose_preseed.py b/src/maasserver/compose_preseed.py
2index f24b10f..f030469 100644
3--- a/src/maasserver/compose_preseed.py
4+++ b/src/maasserver/compose_preseed.py
5@@ -8,7 +8,7 @@ __all__ = [
6 ]
7
8 from datetime import timedelta
9-from urllib.parse import urlencode
10+from urllib.parse import urlencode, urlparse
11
12 from maasserver.clusterrpc.osystems import get_preseed_data
13 from maasserver.enum import (
14@@ -17,6 +17,7 @@ from maasserver.enum import (
15 PRESEED_TYPE,
16 )
17 from maasserver.models import PackageRepository
18+from maasserver.config import RegionConfiguration
19 from maasserver.models.config import Config
20 from maasserver.server_address import get_maas_facing_server_host
21 from maasserver.utils import absolute_reverse
22@@ -43,11 +44,11 @@ def get_apt_proxy(rack_controller=None, default_region_ip=None):
23 else:
24 maas_proxy_port = Config.objects.get_config("maas_proxy_port")
25 if not maas_proxy_port:
26- maas_proxy_port = 8000
27+ maas_proxy_port = 31800
28 url = "http://:%d/" % maas_proxy_port
29- return compose_URL(
30- url, get_maas_facing_server_host(
31- rack_controller, default_region_ip=default_region_ip))
32+ with RegionConfiguration.open() as config:
33+ maas_url = config.maas_url
34+ return compose_URL(url, urlparse(maas_url).hostname)
35 else:
36 return None
diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile
index e57b76f..2da446c 100644
--- a/images/maas-region-controller/Dockerfile
+++ b/images/maas-region-controller/Dockerfile
@@ -54,12 +54,10 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
54 pg_dropcluster --stop 9.5 main 54 pg_dropcluster --stop 9.5 main
55 55
56# 2.3 workarounds 56# 2.3 workarounds
57COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
58COPY 2.3_route.patch /tmp/2.3_route.patch 57COPY 2.3_route.patch /tmp/2.3_route.patch
59COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch 58COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch
60COPY 2.3_bios_grub_partition.patch /tmp/2.3_bios_grub_partition.patch 59COPY 2.3_bios_grub_partition.patch /tmp/2.3_bios_grub_partition.patch
61COPY 2.3_bios_grub_preseed.patch /tmp/2.3_bios_grub_preseed.patch 60COPY 2.3_bios_grub_preseed.patch /tmp/2.3_bios_grub_preseed.patch
62RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
63RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch 61RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
64RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch 62RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch
65RUN cd /usr/lib/python3/dist-packages/maasserver/models && patch partition.py < /tmp/2.3_bios_grub_partition.patch 63RUN cd /usr/lib/python3/dist-packages/maasserver/models && patch partition.py < /tmp/2.3_bios_grub_partition.patch