blob: 4c65c88dcb6fb3fad416a3fa7e54793b11a64cb8 [file] [log] [blame]
Mohammed Naserb7b97d62022-03-12 16:30:00 -05001# Copyright (c) 2022 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
okozachenko120338139652023-01-28 01:46:46 +110015- name: Uninstall the legacy HelmRelease
16 run_once: true
17 block:
18 - name: Suspend the existing HelmRelease
Mohammed Naserf0314a82023-04-11 18:53:30 +000019 failed_when: false
okozachenko120338139652023-01-28 01:46:46 +110020 kubernetes.core.k8s:
21 state: patched
22 api_version: helm.toolkit.fluxcd.io/v2beta1
Mohammed Naserc8e1a452022-08-11 16:16:13 -040023 kind: HelmRelease
okozachenko12037af0d412023-01-28 02:04:54 +110024 name: "{{ prometheus_pushgateway_helm_release_name }}"
25 namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
okozachenko120338139652023-01-28 01:46:46 +110026 definition:
27 spec:
28 suspend: true
29
30 - name: Remove the existing HelmRelease
Mohammed Naserf0314a82023-04-11 18:53:30 +000031 failed_when: false
okozachenko120338139652023-01-28 01:46:46 +110032 kubernetes.core.k8s:
33 state: absent
34 api_version: helm.toolkit.fluxcd.io/v2beta1
35 kind: HelmRelease
okozachenko12037af0d412023-01-28 02:04:54 +110036 name: "{{ prometheus_pushgateway_helm_release_name }}"
37 namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
okozachenko120338139652023-01-28 01:46:46 +110038
39- name: Deploy Helm chart
40 run_once: true
41 kubernetes.core.helm:
okozachenko12037af0d412023-01-28 02:04:54 +110042 name: "{{ prometheus_pushgateway_helm_release_name }}"
43 chart_ref: "{{ prometheus_pushgateway_helm_chart_ref }}"
44 release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
okozachenko120338139652023-01-28 01:46:46 +110045 create_namespace: true
46 kubeconfig: /etc/kubernetes/admin.conf
okozachenko12037af0d412023-01-28 02:04:54 +110047 values: "{{ _prometheus_pushgateway_helm_values | combine(prometheus_pushgateway_helm_values, recursive=True) }}"