Distinguish between port number of internal endpoint and binding

port number in placement

Now binding ports of service and pod spec are configured using
internal endpoint values.
To support reverse proxy for internalUrl, need to distinguish
between binding ports and internal endpoint ports.

I added `service` section in endpoint items apart from admin,public
,internal and default.

Change-Id: I0bfd05bd419dd55b986ab6c1f706a5fcfbe19bbe
This commit is contained in:
josebb 2021-12-02 17:33:03 +02:00
parent ced30abead
commit 7f19de2ab7
5 changed files with 10 additions and 7 deletions

View File

@ -16,7 +16,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Placement description: OpenStack-Helm Placement
name: placement name: placement
version: 0.2.10 version: 0.2.11
home: https://docs.openstack.org/placement/latest/ home: https://docs.openstack.org/placement/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Placement/OpenStack_Project_Placement_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/Placement/OpenStack_Project_Placement_vertical.png
sources: sources:

View File

@ -75,16 +75,16 @@ spec:
- stop - stop
ports: ports:
- name: p-api - name: p-api
containerPort: {{ tuple "placement" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} containerPort: {{ tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe: readinessProbe:
# NOTE(portdirect): use tcpSocket check as HTTP will return 401 # NOTE(portdirect): use tcpSocket check as HTTP will return 401
tcpSocket: tcpSocket:
port: {{ tuple "placement" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} port: {{ tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 15 initialDelaySeconds: 15
periodSeconds: 10 periodSeconds: 10
livenessProbe: livenessProbe:
tcpSocket: tcpSocket:
port: {{ tuple "placement" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} port: {{ tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 50 initialDelaySeconds: 50
periodSeconds: 10 periodSeconds: 10
volumeMounts: volumeMounts:

View File

@ -24,7 +24,7 @@ metadata:
spec: spec:
ports: ports:
- name: p-api - name: p-api
port: {{ tuple "placement" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} port: {{ tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ if .Values.network.api.node_port.enabled }} {{ if .Values.network.api.node_port.enabled }}
nodePort: {{ .Values.network.api.node_port.port }} nodePort: {{ .Values.network.api.node_port.port }}
{{ end }} {{ end }}

View File

@ -184,13 +184,13 @@ conf:
format: "%(message)s" format: "%(message)s"
datefmt: "%Y-%m-%d %H:%M:%S" datefmt: "%Y-%m-%d %H:%M:%S"
wsgi_placement: | wsgi_placement: |
Listen 0.0.0.0:{{ tuple "placement" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} Listen 0.0.0.0:{{ tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded CustomLog /dev/stdout combined env=!forwarded
CustomLog /dev/stdout proxy env=forwarded CustomLog /dev/stdout proxy env=forwarded
<VirtualHost *:{{ tuple "placement" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}> <VirtualHost *:{{ tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}>
WSGIDaemonProcess placement-api processes=4 threads=1 user=placement group=placement display-name=%{GROUP} WSGIDaemonProcess placement-api processes=4 threads=1 user=placement group=placement display-name=%{GROUP}
WSGIProcessGroup placement-api WSGIProcessGroup placement-api
WSGIScriptAlias / /var/www/cgi-bin/placement/placement-api WSGIScriptAlias / /var/www/cgi-bin/placement/placement-api
@ -325,10 +325,12 @@ endpoints:
default: / default: /
scheme: scheme:
default: 'http' default: 'http'
service: 'http'
port: port:
api: api:
default: 8778 default: 8778
public: 80 public: 80
service: 8778
pod: pod:
security_context: security_context:

View File

@ -19,4 +19,5 @@ placement:
- 0.2.8 Migrated PodDisruptionBudget resource to policy/v1 API version - 0.2.8 Migrated PodDisruptionBudget resource to policy/v1 API version
- 0.2.9 Add Xena and Yoga values overrides - 0.2.9 Add Xena and Yoga values overrides
- 0.2.10 Added OCI registry authentication - 0.2.10 Added OCI registry authentication
- 0.2.11 Distinguish between port number of internal endpoint and binding port number
... ...