Browse Source

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
Kaspars Skels 6 months ago
parent
commit
e53cb2d237

+ 1
- 0
charts/maas/templates/bin/_import-boot-resources.sh.tpl View File

@@ -118,6 +118,7 @@ function configure_proxy {
118 118
   check_then_set enable_http_proxy ${MAAS_PROXY_ENABLED}
119 119
   check_then_set use_peer_proxy ${MAAS_PEER_PROXY_ENABLED}
120 120
   check_then_set http_proxy ${MAAS_PROXY_SERVER}
121
+  check_then_set maas_proxy_port ${MAAS_INTERNAL_PROXY_PORT}
121 122
 }
122 123
 
123 124
 function configure_ntp {

+ 2
- 0
charts/maas/templates/job-import.yaml View File

@@ -63,6 +63,8 @@ spec:
63 63
               value: {{ .Values.conf.maas.proxy.peer_proxy_enabled | quote }}
64 64
             - name: MAAS_PROXY_SERVER
65 65
               value: {{ .Values.conf.maas.proxy.proxy_server }}
66
+            - name: MAAS_INTERNAL_PROXY_PORT
67
+              value: {{ .Values.network.port.service_proxy }}
66 68
             - name: MAAS_HTTP_BOOT
67 69
               value: {{ .Values.conf.maas.http_boot | quote }}
68 70
             - name: MAAS_NTP_SERVERS

+ 2
- 2
charts/maas/templates/service-region.yaml View File

@@ -30,9 +30,9 @@ spec:
30 30
     nodePort: {{ .Values.network.gui.node_port.port }}
31 31
     {{ end }}
32 32
   - port: {{ .Values.network.port.service_proxy }}
33
-    targetPort: {{ .Values.network.port.service_proxy_target }}
33
+    targetPort: {{ .Values.network.port.service_proxy }}
34 34
     {{ if .Values.network.proxy.node_port.enabled }}
35
-    nodePort:  {{ .Values.network.proxy.node_port.port }}
35
+    nodePort:  {{ .Values.network.port.service_proxy }}
36 36
     {{ end }}
37 37
     name: proxy
38 38
   selector:

+ 1
- 4
charts/maas/values.yaml View File

@@ -105,8 +105,6 @@ network:
105 105
   proxy:
106 106
     node_port:
107 107
       enabled: true
108
-      # Do not change the port, hardcoded in MAAS source
109
-      port: 31800
110 108
   gui:
111 109
     node_port:
112 110
       enabled: true
@@ -115,8 +113,7 @@ network:
115 113
     region_container: 80
116 114
     service_gui: 80
117 115
     service_gui_target: 80
118
-    service_proxy: 8000
119
-    service_proxy_target: 8000
116
+    service_proxy: 31800
120 117
     db_service: 5432
121 118
     db_service_target: 5432
122 119
 

+ 0
- 36
images/maas-region-controller/2.3_proxy_port.patch View File

@@ -1,36 +0,0 @@
1
-diff --git a/src/maasserver/compose_preseed.py b/src/maasserver/compose_preseed.py
2
-index 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

+ 0
- 2
images/maas-region-controller/Dockerfile View File

@@ -54,12 +54,10 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
54 54
     pg_dropcluster --stop 9.5 main
55 55
 
56 56
 # 2.3 workarounds
57
-COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
58 57
 COPY 2.3_route.patch /tmp/2.3_route.patch
59 58
 COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch
60 59
 COPY 2.3_bios_grub_partition.patch /tmp/2.3_bios_grub_partition.patch
61 60
 COPY 2.3_bios_grub_preseed.patch /tmp/2.3_bios_grub_preseed.patch
62
-RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
63 61
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
64 62
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch
65 63
 RUN cd /usr/lib/python3/dist-packages/maasserver/models && patch partition.py < /tmp/2.3_bios_grub_partition.patch

Loading…
Cancel
Save