Added post-install and post-upgrade hook on jobs in designate chart
Chart upgrading was failing due to some immutable fields are needed to upgrade before the jobs can be upgraded. For solving this issue, we have added the helm.sh/hook annotations with post-install and post-upgrade values. 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. Change-Id: Idca6ee2422769ccb5c8a87812b4fb564b283d44b
This commit is contained in:
parent
ad97431545
commit
ff254f1aad
@ -14,7 +14,7 @@ apiVersion: v1
|
|||||||
appVersion: v1.0.0
|
appVersion: v1.0.0
|
||||||
description: OpenStack-Helm Designate
|
description: OpenStack-Helm Designate
|
||||||
name: designate
|
name: designate
|
||||||
version: 0.1.1
|
version: 0.1.2
|
||||||
home: https://docs.openstack.org/designate/latest/
|
home: https://docs.openstack.org/designate/latest/
|
||||||
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Designate/OpenStack_Project_Designate_vertical.jpg
|
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Designate/OpenStack_Project_Designate_vertical.jpg
|
||||||
sources:
|
sources:
|
||||||
|
@ -9,9 +9,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# 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.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 }}
|
||||||
|
|
||||||
{{- $dbInitJob := dict "envAll" . "serviceName" "designate" -}}
|
{{- $dbInitJob := dict "envAll" . "serviceName" "designate" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
|
||||||
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
|
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -9,9 +9,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# 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.db_sync" }}
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-weight: "-4"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_sync }}
|
{{- if .Values.manifests.job_db_sync }}
|
||||||
|
|
||||||
{{- $dbSyncJob := dict "envAll" . "serviceName" "designate" "podVolMounts" .Values.pod.mounts.designate_db_sync.designate_db_sync.volumeMounts "podVols" .Values.pod.mounts.designate_db_sync.designate_db_sync.volumes -}}
|
{{- $dbSyncJob := dict "envAll" . "serviceName" "designate" "podVolMounts" .Values.pod.mounts.designate_db_sync.designate_db_sync.volumeMounts "podVols" .Values.pod.mounts.designate_db_sync.designate_db_sync.volumes "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) -}}
|
||||||
{{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }}
|
{{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -9,9 +9,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# 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.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" "designate" "serviceTypes" ( tuple "dns" ) -}}
|
{{- $ksServiceJob := dict "envAll" . "serviceName" "designate" "serviceTypes" ( tuple "dns" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}}
|
||||||
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }}
|
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -9,9 +9,15 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# 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.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" "designate" "serviceTypes" ( tuple "dns" ) -}}
|
{{- $ksServiceJob := dict "envAll" . "serviceName" "designate" "serviceTypes" ( tuple "dns" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}}
|
||||||
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }}
|
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -11,9 +11,15 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# $% What does following represent?
|
# $% What does following represent?
|
||||||
|
|
||||||
|
{{- 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" "designate" -}}
|
{{- $ksUserJob := dict "envAll" . "serviceName" "designate" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
|
||||||
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
|
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -11,7 +11,13 @@ 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" "designate" -}}
|
{{- $rmqUserJob := dict "envAll" . "serviceName" "designate" "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) -}}
|
||||||
{{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }}
|
{{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -21,6 +21,6 @@ spec:
|
|||||||
minAvailable: {{ .Values.pod.lifecycle.disruption_budget.api.min_available }}
|
minAvailable: {{ .Values.pod.lifecycle.disruption_budget.api.min_available }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app:
|
app: designate-api
|
||||||
{{ tuple $envAll "designate" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
{{ tuple $envAll "designate" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
designate:
|
designate:
|
||||||
- 0.1.0 Initial Chart
|
- 0.1.0 Initial Chart
|
||||||
- 0.1.1 Change helm-toolkit dependency version to ">= 0.1.0"
|
- 0.1.1 Change helm-toolkit dependency version to ">= 0.1.0"
|
||||||
|
- 0.1.2 Added post-install and post-upgrade helm hooks on Jobs
|
||||||
|
Loading…
Reference in New Issue
Block a user