Support Octavia Amphore V2 with redis

* Include redis in zuul jobs
* Support Octavia Amphore V2 with redis
* Use Amphore V2 as default driver

Change-Id: I6e652c1ed3a6ae45c72bb47809a1f8d846352314
This commit is contained in:
ricolin 2024-05-07 21:07:42 +08:00
parent 0516fb92c1
commit 35f4d50884
8 changed files with 159 additions and 2 deletions

View File

@ -19,3 +19,5 @@ limitations under the License.
set -ex
octavia-db-manage upgrade head
octavia-db-manage upgrade_persistence

View File

@ -84,6 +84,18 @@ limitations under the License.
{{- $_ := tuple "oslo_db" "internal" "octavia" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.octavia.database "connection" -}}
{{- end -}}
{{- if empty .Values.conf.octavia.task_flow.persistence_connection -}}
{{- $_ := tuple "oslo_db_presistence" "internal" "octavia" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.octavia.task_flow "persistence_connection" -}}
{{- end -}}
{{- if empty .Values.conf.octavia.task_flow.jobboard_backend_port -}}
{{- $_ := tuple "redis" "service" "server" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.octavia.task_flow "jobboard_backend_port" -}}
{{- end -}}
{{- if empty .Values.conf.octavia.task_flow.jobboard_backend_hosts -}}
{{- $_ := tuple "redis" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" | set .Values.conf.octavia.task_flow "jobboard_backend_hosts" -}}
{{- end -}}
{{- if empty .Values.conf.octavia.DEFAULT.transport_url -}}
{{- $_ := tuple "oslo_messaging" "internal" "octavia" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.octavia.DEFAULT "transport_url" -}}
{{- end -}}

View File

@ -15,6 +15,10 @@ limitations under the License.
*/}}
{{- if .Values.manifests.job_db_drop }}
{{- $dbDropJob := dict "envAll" . "serviceName" "octavia" -}}
{{- $serviceName := "octavia" -}}
{{- $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" -}}
{{- $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" -}}
{{- $dbsToDrop := list $dbSvc $dbPersist }}
{{- $dbDropJob := dict "envAll" . "serviceName" $serviceName "dbsToDrop" $dbsToDrop -}}
{{ $dbDropJob | include "helm-toolkit.manifests.job_db_drop_mysql" }}
{{- end }}

View File

@ -20,6 +20,13 @@ helm.sh/hook-weight: "-5"
{{- end }}
{{- if .Values.manifests.job_db_init }}
{{- $dbInitJob := dict "envAll" . "serviceName" "octavia" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
{{- $serviceName := "octavia" -}}
{{- $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" -}}
{{- $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" -}}
{{- $dbsToInit := list $dbSvc $dbPersist }}
{{- $dbInitJob := dict "envAll" . "serviceName" $serviceName "dbsToInit" $dbsToInit -}}
{{- if .Values.helm3_hook }}
{{- $_ := set $dbInitJob "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) }}
{{- end }}
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
{{- end }}

View File

@ -0,0 +1,30 @@
{{/*
Copyright 2024 Vexxhost Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.secret_db_presistence }}
{{- $envAll := . }}
{{- range $key1, $userClass := tuple "admin" "octavia" }}
{{- $secretName := index $envAll.Values.secrets.oslo_db_presistence $userClass }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
type: Opaque
data:
DB_CONNECTION: {{ tuple "oslo_db_presistence" "internal" $userClass "mysql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}}
{{- end }}
{{- end }}

View File

@ -106,6 +106,8 @@ dependencies:
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_db_presistence
- endpoint: internal
service: identity
- endpoint: internal
@ -123,6 +125,8 @@ dependencies:
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_db_presistence
- endpoint: internal
service: identity
- endpoint: internal
@ -142,6 +146,8 @@ dependencies:
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_db_presistence
- endpoint: internal
service: identity
- endpoint: internal
@ -161,6 +167,8 @@ dependencies:
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_db_presistence
- endpoint: internal
service: identity
- endpoint: internal
@ -175,12 +183,16 @@ dependencies:
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_db_presistence
db_sync:
jobs:
- octavia-db-init
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_db_presistence
ks_endpoints:
jobs:
- octavia-ks-service
@ -211,6 +223,8 @@ conf:
api_settings:
api_handler: queue_producer
bind_host: 0.0.0.0
default_provider_driver: amphorav2
enabled_provider_drivers: amphorav2:'The v2 amphora driver.',amphora:'The Octavia Amphora driver.',octavia:'Deprecated name of Amphora driver.'
database:
max_retries: -1
health_manager:
@ -259,6 +273,11 @@ conf:
cafile: ""
auth_version: v3
memcache_security_strategy: ENCRYPT
task_flow:
jobboard_enabled: true
jobboard_backend_driver: 'redis_taskflow_driver'
jobboard_backend_namespace: 'octavia_jobboard'
jobboard_expiration_time: 100
logging:
loggers:
keys:
@ -357,6 +376,9 @@ secrets:
oslo_db:
admin: octavia-db-admin
octavia: octavia-db-user
oslo_db_presistence:
admin: octavia-presistence-db-admin
octavia: octavia-presistence-db-user
oslo_messaging:
admin: octavia-rabbitmq-admin
octavia: octavia-rabbitmq-user
@ -467,6 +489,23 @@ endpoints:
port:
mysql:
default: 3306
oslo_db_presistence:
auth:
admin:
username: root
password: password
octavia:
username: octavia
password: password
hosts:
default: mariadb
host_fqdn_override:
default: null
path: /octavia_persistence
scheme: mysql+pymysql
port:
mysql:
default: 3306
oslo_cache:
auth:
# NOTE(portdirect): this is used to define the value for keystone
@ -519,6 +558,19 @@ endpoints:
api:
default: 9696
public: 80
redis:
name: redis
hosts:
default: redis
host_fqdn_override:
default: null
path:
default: null
scheme:
default: 'http'
port:
server:
default: 6379
pod:
user:
@ -687,6 +739,10 @@ network_policy:
ingress:
- {}
# NOTE(helm_hook): helm_hook might break for helm2 binary.
# set helm3_hook: false when using the helm2 binary.
helm3_hook: true
manifests:
configmap_bin: true
configmap_etc: true
@ -709,6 +765,7 @@ manifests:
network_policy: false
secret_credential_keys: true
secret_db: true
secret_db_presistence: true
secret_ingress_tls: true
secret_keystone: true
secret_rabbitmq: true

View File

@ -0,0 +1,32 @@
#!/bin/bash
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -xe
#NOTE: Define variables
: ${OSH_INFRA_HELM_REPO:="../openstack-helm-infra"}
: ${OSH_INFRA_PATH:="../openstack-helm-infra"}
: ${OSH_EXTRA_HELM_ARGS_MARIADB:="$(helm osh get-values-overrides ${DOWNLOAD_OVERRIDES:-} -p ${OSH_INFRA_PATH} -c redis ${FEATURES})"}
#NOTE: Deploy command
helm upgrade --install redis ${OSH_INFRA_HELM_REPO}/redis \
--namespace=openstack \
--set volume.use_local_path_for_single_pod_cluster.enabled=true \
--set volume.enabled=false \
--set pod.replicas.server=1 \
${OSH_EXTRA_HELM_ARGS:=} \
${OSH_EXTRA_HELM_ARGS_MARIADB}
#NOTE: Wait for deploy
helm osh wait-for-pods openstack

View File

@ -82,6 +82,7 @@
- - ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- - ./tools/deployment/component/heat/heat.sh
- export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh
@ -111,6 +112,7 @@
- - ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- - ./tools/deployment/component/heat/heat.sh
- export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh
@ -141,6 +143,7 @@
- - ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- - ./tools/deployment/component/heat/heat.sh
- export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh
@ -167,6 +170,7 @@
- - ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- - ./tools/deployment/component/heat/heat.sh
- export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh
@ -198,6 +202,7 @@
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/common/ldap.sh
- ./tools/deployment/component/keystone/keystone.sh
@ -220,6 +225,7 @@
- - ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- ./tools/deployment/component/cinder/cinder.sh
- ./tools/deployment/common/force-cronjob-run.sh
@ -243,6 +249,7 @@
- - ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- ./tools/deployment/component/cinder/cinder.sh
- ./tools/deployment/common/force-cronjob-run.sh
@ -297,6 +304,7 @@
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- ./tools/deployment/component/horizon/horizon.sh
@ -316,6 +324,7 @@
- - ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- - ./tools/deployment/component/cinder/cinder.sh
- ./tools/deployment/component/heat/heat.sh
@ -345,6 +354,7 @@
- - ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- - ./tools/deployment/component/compute-kit/tungsten-fabric.sh checkdns
- ./tools/deployment/component/compute-kit/tungsten-fabric.sh setupdns
- ./tools/deployment/component/keystone/keystone.sh
@ -375,6 +385,7 @@
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- ./tools/deployment/component/heat/heat.sh
- export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh
@ -408,6 +419,7 @@
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- ./tools/deployment/component/cinder/cinder.sh
- ./tools/deployment/component/horizon/horizon.sh
@ -428,6 +440,7 @@
- - ./tools/deployment/component/common/rabbitmq.sh
- ./tools/deployment/component/common/mariadb.sh
- ./tools/deployment/component/common/memcached.sh
- ./tools/deployment/component/common/redis.sh
- ./tools/deployment/component/keystone/keystone.sh
- - ./tools/deployment/component/heat/heat.sh
- export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh