Skip to content

Commit c362b70

Browse files
committed
Add Octavia Amphere v2 support
1 parent 2a81901 commit c362b70

File tree

10 files changed

+134
-2
lines changed

10 files changed

+134
-2
lines changed

.charts.yml

+4
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ charts:
151151
version: 0.2.14
152152
repository: *openstack_helm_repository
153153
dependencies: *openstack_helm_dependencies
154+
patches:
155+
gerrit:
156+
review.opendev.org:
157+
- 918447
154158
- name: openvswitch
155159
version: 0.1.19
156160
repository: *openstack_helm_infra_repository

charts/octavia/templates/bin/_db-sync.sh.tpl

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ limitations under the License.
1919
set -ex
2020

2121
octavia-db-manage upgrade head
22+
23+
octavia-db-manage upgrade_persistence

charts/octavia/templates/configmap-etc.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ limitations under the License.
8484
{{- $_ := tuple "oslo_db" "internal" "octavia" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.octavia.database "connection" -}}
8585
{{- end -}}
8686

87+
{{- if empty .Values.conf.octavia.task_flow.persistence_connection -}}
88+
{{- $_ := tuple "oslo_db_presistence" "internal" "octavia" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.octavia.task_flow "persistence_connection" -}}
89+
{{- end -}}
90+
91+
{{- if empty .Values.conf.octavia.task_flow.jobboard_backend_port -}}
92+
{{- $_ := tuple "redis" "service" "server" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.octavia.task_flow "jobboard_backend_port" -}}
93+
{{- end -}}
94+
95+
{{- if empty .Values.conf.octavia.task_flow.jobboard_backend_hosts -}}
96+
{{- $_ := tuple "redis" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" | set .Values.conf.octavia.task_flow "jobboard_backend_hosts" -}}
97+
{{- end -}}
98+
8799
{{- if empty .Values.conf.octavia.DEFAULT.transport_url -}}
88100
{{- $_ := tuple "oslo_messaging" "internal" "octavia" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.octavia.DEFAULT "transport_url" -}}
89101
{{- end -}}

charts/octavia/templates/job-db-drop.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ limitations under the License.
1515
*/}}
1616

1717
{{- if .Values.manifests.job_db_drop }}
18-
{{- $dbDropJob := dict "envAll" . "serviceName" "octavia" -}}
18+
{{- $serviceName := "octavia" -}}
19+
{{- $dbSvc := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "database" "configDbKey" "connection" -}}
20+
{{- $dbPersist := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "task_flow" "configDbKey" "persistence_connection" -}}
21+
{{- $dbsToDrop := list $dbSvc $dbPersist }}
22+
{{- $dbDropJob := dict "envAll" . "serviceName" $serviceName "dbsToDrop" $dbsToDrop -}}
1923
{{ $dbDropJob | include "helm-toolkit.manifests.job_db_drop_mysql" }}
2024
{{- end }}

charts/octavia/templates/job-db-init.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ helm.sh/hook-weight: "-5"
2020
{{- end }}
2121

2222
{{- if .Values.manifests.job_db_init }}
23-
{{- $dbInitJob := dict "envAll" . "serviceName" "octavia" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
23+
{{- $serviceName := "octavia" -}}
24+
{{- $dbSvc := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "database" "configDbKey" "connection" -}}
25+
{{- $dbPersist := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "task_flow" "configDbKey" "persistence_connection" -}}
26+
{{- $dbsToInit := list $dbSvc $dbPersist }}
27+
{{- $dbInitJob := dict "envAll" . "serviceName" $serviceName "dbsToInit" $dbsToInit -}}
28+
{{- if .Values.helm3_hook }}
29+
{{- $_ := set $dbInitJob "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) }}
30+
{{- end }}
2431
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
2532
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{/*
2+
Copyright 2024 Vexxhost Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/}}
16+
17+
{{- if .Values.manifests.secret_db_presistence }}
18+
{{- $envAll := . }}
19+
{{- range $key1, $userClass := tuple "admin" "octavia" }}
20+
{{- $secretName := index $envAll.Values.secrets.oslo_db_presistence $userClass }}
21+
---
22+
apiVersion: v1
23+
kind: Secret
24+
metadata:
25+
name: {{ $secretName }}
26+
type: Opaque
27+
data:
28+
DB_CONNECTION: {{ tuple "oslo_db_presistence" "internal" $userClass "mysql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}}
29+
{{- end }}
30+
{{- end }}

charts/octavia/values.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ dependencies:
106106
services:
107107
- endpoint: internal
108108
service: oslo_db
109+
- endpoint: internal
110+
service: oslo_db_presistence
109111
- endpoint: internal
110112
service: identity
111113
- endpoint: internal
@@ -123,6 +125,8 @@ dependencies:
123125
services:
124126
- endpoint: internal
125127
service: oslo_db
128+
- endpoint: internal
129+
service: oslo_db_presistence
126130
- endpoint: internal
127131
service: identity
128132
- endpoint: internal
@@ -142,6 +146,8 @@ dependencies:
142146
services:
143147
- endpoint: internal
144148
service: oslo_db
149+
- endpoint: internal
150+
service: oslo_db_presistence
145151
- endpoint: internal
146152
service: identity
147153
- endpoint: internal
@@ -161,6 +167,8 @@ dependencies:
161167
services:
162168
- endpoint: internal
163169
service: oslo_db
170+
- endpoint: internal
171+
service: oslo_db_presistence
164172
- endpoint: internal
165173
service: identity
166174
- endpoint: internal
@@ -175,12 +183,16 @@ dependencies:
175183
services:
176184
- endpoint: internal
177185
service: oslo_db
186+
- endpoint: internal
187+
service: oslo_db_presistence
178188
db_sync:
179189
jobs:
180190
- octavia-db-init
181191
services:
182192
- endpoint: internal
183193
service: oslo_db
194+
- endpoint: internal
195+
service: oslo_db_presistence
184196
ks_endpoints:
185197
jobs:
186198
- octavia-ks-service
@@ -211,6 +223,8 @@ conf:
211223
api_settings:
212224
api_handler: queue_producer
213225
bind_host: 0.0.0.0
226+
default_provider_driver: amphorav2
227+
enabled_provider_drivers: amphorav2:'The v2 amphora driver.',amphora:'The Octavia Amphora driver.',octavia:'Deprecated name of Amphora driver.'
214228
database:
215229
max_retries: -1
216230
health_manager:
@@ -259,6 +273,11 @@ conf:
259273
cafile: ""
260274
auth_version: v3
261275
memcache_security_strategy: ENCRYPT
276+
task_flow:
277+
jobboard_enabled: true
278+
jobboard_backend_driver: 'redis_taskflow_driver'
279+
jobboard_backend_namespace: 'octavia_jobboard'
280+
jobboard_expiration_time: 100
262281
logging:
263282
loggers:
264283
keys:
@@ -362,6 +381,9 @@ secrets:
362381
oslo_db:
363382
admin: octavia-db-admin
364383
octavia: octavia-db-user
384+
oslo_db_presistence:
385+
admin: octavia-presistence-db-admin
386+
octavia: octavia-presistence-db-user
365387
oslo_messaging:
366388
admin: octavia-rabbitmq-admin
367389
octavia: octavia-rabbitmq-user
@@ -472,6 +494,23 @@ endpoints:
472494
port:
473495
mysql:
474496
default: 3306
497+
oslo_db_presistence:
498+
auth:
499+
admin:
500+
username: root
501+
password: password
502+
octavia:
503+
username: octavia
504+
password: password
505+
hosts:
506+
default: mariadb
507+
host_fqdn_override:
508+
default: null
509+
path: /octavia_persistence
510+
scheme: mysql+pymysql
511+
port:
512+
mysql:
513+
default: 3306
475514
oslo_cache:
476515
auth:
477516
# NOTE(portdirect): this is used to define the value for keystone
@@ -524,6 +563,19 @@ endpoints:
524563
api:
525564
default: 9696
526565
public: 80
566+
redis:
567+
name: redis
568+
hosts:
569+
default: redis
570+
host_fqdn_override:
571+
default: null
572+
path:
573+
default: null
574+
scheme:
575+
default: 'http'
576+
port:
577+
server:
578+
default: 6379
527579

528580
pod:
529581
user:
@@ -692,6 +744,10 @@ network_policy:
692744
ingress:
693745
- {}
694746

747+
# NOTE(helm_hook): helm_hook might break for helm2 binary.
748+
# set helm3_hook: false when using the helm2 binary.
749+
helm3_hook: true
750+
695751
manifests:
696752
configmap_bin: true
697753
configmap_etc: true
@@ -714,6 +770,7 @@ manifests:
714770
network_policy: false
715771
secret_credential_keys: true
716772
secret_db: true
773+
secret_db_presistence: true
717774
secret_ingress_tls: true
718775
secret_keystone: true
719776
secret_rabbitmq: true

images/octavia/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pip3 install \
2525
--constraint /upper-constraints.txt \
2626
/src/octavia \
2727
/src/ovn-octavia-provider
28+
redis[hiredis]
2829
EOF
2930

3031
FROM registry.atmosphere.dev/library/openstack-python-runtime:${RELEASE}

roles/octavia/meta/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ galaxy_info:
2828
- jammy
2929

3030
dependencies:
31+
- role: redis
3132
- role: defaults
3233
- role: openstacksdk
3334
- role: openstack_cli

roles/openstack_helm_endpoints/vars/main.yml

+14
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,25 @@ _openstack_helm_endpoints_load_balancer:
370370
auth:
371371
octavia:
372372
password: "{{ openstack_helm_endpoints_octavia_mariadb_password }}"
373+
oslo_db_presistence:
374+
auth:
375+
octavia:
376+
password: "{{ openstack_helm_endpoints_octavia_mariadb_password }}"
373377
oslo_messaging:
374378
auth:
375379
octavia:
376380
password: "{{ openstack_helm_endpoints_octavia_rabbitmq_password }}"
377381

382+
_openstack_helm_endpoints_oslo_db_presistence:
383+
oslo_db_presistence:
384+
auth:
385+
admin:
386+
password: "{{ openstack_helm_endpoints_mariadb_admin_password }}"
387+
octavia:
388+
password: "{{ openstack_helm_endpoints_octavia_mariadb_password }}"
389+
hosts:
390+
default: percona-xtradb-haproxy
391+
378392
_openstack_helm_endpoints_cloudformation:
379393
cloudformation:
380394
scheme:

0 commit comments

Comments
 (0)