Added helm.sh/hook annotations for nova chart
Chart upgrading was failing due to some immutable fields are needed to be upgraded before the jobs can be upgraded. For solving this issue, helm.sh/hook annotations with post-install and post-upgrade has been added. As for hook-weight annotations, we have added these to control the flow of the jobs with hook creation as the jobs are dependent. Like, db-init jobs need to run before db-sync and so on. Also, helm3_hook value is added in values.yaml file in case hooks needs to be disabled if needed. Change-Id: I4d489f5ded94f19dd3fcf58dafde00b18ff5bcae
This commit is contained in:
parent
2f80bd3ff2
commit
bd825495a4
@ -14,7 +14,7 @@ apiVersion: v1
|
|||||||
appVersion: v1.0.0
|
appVersion: v1.0.0
|
||||||
description: OpenStack-Helm Nova
|
description: OpenStack-Helm Nova
|
||||||
name: nova
|
name: nova
|
||||||
version: 0.2.13
|
version: 0.2.14
|
||||||
home: https://docs.openstack.org/nova/latest/
|
home: https://docs.openstack.org/nova/latest/
|
||||||
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png
|
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png
|
||||||
sources:
|
sources:
|
||||||
|
@ -28,6 +28,8 @@ apiVersion: batch/v1
|
|||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ $serviceAccountName | quote }}
|
name: {{ $serviceAccountName | quote }}
|
||||||
|
labels:
|
||||||
|
application: {{ $serviceAccountName | quote }}
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -12,6 +12,11 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.db_init" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-5"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_init }}
|
{{- if .Values.manifests.job_db_init }}
|
||||||
{{- $serviceName := "nova" -}}
|
{{- $serviceName := "nova" -}}
|
||||||
{{- $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" -}}
|
{{- $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" -}}
|
||||||
@ -22,5 +27,8 @@ limitations under the License.
|
|||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $dbInitJob "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
|
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -12,6 +12,11 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.db_sync" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-4"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- define "nova.templates._job_db_sync.env_vars" -}}
|
{{- define "nova.templates._job_db_sync.env_vars" -}}
|
||||||
{{- $envAll := index . 0 }}
|
{{- $envAll := index . 0 }}
|
||||||
env:
|
env:
|
||||||
@ -38,5 +43,8 @@ env:
|
|||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $dbSyncJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
{{- $_ := set $dbSyncJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $dbSyncJob "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }}
|
{{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -12,7 +12,14 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.repo_sync" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }}
|
{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }}
|
||||||
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "nova" -}}
|
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "nova" -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $imageRepoSyncJob "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }}
|
{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -12,10 +12,18 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.ks_endpoints" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-2"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_ks_endpoints }}
|
{{- if .Values.manifests.job_ks_endpoints }}
|
||||||
{{- $ksServiceJob := dict "envAll" . "serviceName" "nova" "serviceTypes" ( tuple "compute" ) -}}
|
{{- $ksServiceJob := dict "envAll" . "serviceName" "nova" "serviceTypes" ( tuple "compute" ) -}}
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.compute.osapi.internal -}}
|
{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.compute.osapi.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $ksServiceJob "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }}
|
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -12,10 +12,18 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.ks_service" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-3"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_ks_service }}
|
{{- if .Values.manifests.job_ks_service }}
|
||||||
{{- $ksServiceJob := dict "envAll" . "serviceName" "nova" "serviceTypes" ( tuple "compute" ) -}}
|
{{- $ksServiceJob := dict "envAll" . "serviceName" "nova" "serviceTypes" ( tuple "compute" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}}
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.compute.osapi.internal -}}
|
{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.compute.osapi.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $ksServiceJob "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }}
|
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -12,10 +12,18 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.ks_user" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-1"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_ks_user }}
|
{{- if .Values.manifests.job_ks_user }}
|
||||||
{{- $ksUserJob := dict "envAll" . "serviceName" "nova" -}}
|
{{- $ksUserJob := dict "envAll" . "serviceName" "nova" -}}
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.compute.osapi.internal -}}
|
{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.compute.osapi.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $ksUserJob "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
|
||||||
|
{{- end }}
|
||||||
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
|
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -11,10 +11,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- define "metadata.annotations.job.rabbit_init" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-4"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_rabbit_init }}
|
{{- if .Values.manifests.job_rabbit_init }}
|
||||||
{{- $rmqUserJob := dict "envAll" . "serviceName" "nova" -}}
|
{{- $rmqUserJob := dict "envAll" . "serviceName" "nova" -}}
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $rmqUserJob "tlsSecret" .Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal -}}
|
{{- $_ := set $rmqUserJob "tlsSecret" .Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $rmqUserJob "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }}
|
{{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -2799,6 +2799,10 @@ network_policy:
|
|||||||
egress:
|
egress:
|
||||||
- {}
|
- {}
|
||||||
|
|
||||||
|
# NOTE(helm_hook): helm_hook might break for helm2 binary.
|
||||||
|
# set helm3_hook: false when using the helm2 binary.
|
||||||
|
helm3_hook: true
|
||||||
|
|
||||||
manifests:
|
manifests:
|
||||||
certificates: false
|
certificates: false
|
||||||
configmap_bin: true
|
configmap_bin: true
|
||||||
|
@ -34,4 +34,5 @@ nova:
|
|||||||
- 0.2.11 Add Victoria and Wallaby releases support
|
- 0.2.11 Add Victoria and Wallaby releases support
|
||||||
- 0.2.12 Bootstrap flavor creation efficiencies
|
- 0.2.12 Bootstrap flavor creation efficiencies
|
||||||
- 0.2.13 Add missing 'runlock' hostMount when enable_scsi
|
- 0.2.13 Add missing 'runlock' hostMount when enable_scsi
|
||||||
|
- 0.2.14 Use helm.sh/hook annotations for jobs
|
||||||
...
|
...
|
||||||
|
Loading…
Reference in New Issue
Block a user