From 64eee820929d15d3a8d54a35c7c7136328e87880 Mon Sep 17 00:00:00 2001 From: Sirajudeen Date: Mon, 7 Jun 2021 18:19:47 +0000 Subject: [PATCH] Added replacements for composite/infra * Added replacements for cert-manager. * Removed the unneeded cert-manager replacement from clusterctl function * Added the 3 images used for cert-manager in Base Versions Catalogue Closes: #549 Change-Id: I72b458b77c399f128b490cc5723e51af7c3d6f16 --- .../infra/replacements/kustomization.yaml | 5 +++ .../versions-airshipctl.yaml | 9 +++-- .../replacements/kustomization.yaml | 4 ++ .../cert-manager/replacements/versions.yaml | 39 +++++++++++++++++++ .../clusterctl/replacements/versions.yaml | 12 ------ .../target/catalogues/kustomization.yaml | 5 +++ .../initinfra-networking/kustomization.yaml | 4 ++ .../target/catalogues/kustomization.yaml | 5 +++ .../initinfra-networking/kustomization.yaml | 4 ++ .../target/catalogues/kustomization.yaml | 5 +++ .../target/initinfra/kustomization.yaml | 5 +++ .../initinfra-networking/kustomization.yaml | 4 ++ .../initinfra-networking/kustomization.yaml | 5 +++ 13 files changed, 91 insertions(+), 15 deletions(-) create mode 100644 manifests/composite/infra/replacements/kustomization.yaml create mode 100644 manifests/function/cert-manager/replacements/kustomization.yaml create mode 100644 manifests/function/cert-manager/replacements/versions.yaml create mode 100644 manifests/site/docker-test-site/target/catalogues/kustomization.yaml create mode 100644 manifests/site/gcp-test-site/target/catalogues/kustomization.yaml create mode 100644 manifests/site/openstack-test-site/target/catalogues/kustomization.yaml diff --git a/manifests/composite/infra/replacements/kustomization.yaml b/manifests/composite/infra/replacements/kustomization.yaml new file mode 100644 index 000000000..66cce757a --- /dev/null +++ b/manifests/composite/infra/replacements/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../function/cni/tigera-operator/replacements + - ../../../function/cert-manager/replacements diff --git a/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml b/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml index 3824d2cca..ebec15d6d 100644 --- a/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml +++ b/manifests/function/airshipctl-base-catalogues/versions-airshipctl.yaml @@ -152,8 +152,11 @@ spec: manager: image: ghcr.io/fluxcd/source-controller:v0.5.3 cert-manager: - cert-manager: - repository: - image: "quay.io/jetstack" + cainjector: + image: quay.io/jetstack/cert-manager-cainjector:v1.1.0 + controller: + image: quay.io/jetstack/cert-manager-controller:v1.1.0 + webhook: + image: quay.io/jetstack/cert-manager-webhook:v1.1.0 kubernetes: v1.18.6 diff --git a/manifests/function/cert-manager/replacements/kustomization.yaml b/manifests/function/cert-manager/replacements/kustomization.yaml new file mode 100644 index 000000000..1d43ee154 --- /dev/null +++ b/manifests/function/cert-manager/replacements/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - versions.yaml diff --git a/manifests/function/cert-manager/replacements/versions.yaml b/manifests/function/cert-manager/replacements/versions.yaml new file mode 100644 index 000000000..c77be7e17 --- /dev/null +++ b/manifests/function/cert-manager/replacements/versions.yaml @@ -0,0 +1,39 @@ +apiVersion: airshipit.org/v1alpha1 +kind: ReplacementTransformer +metadata: + name: cert-manager-versions-replacements + annotations: + config.kubernetes.io/function: |- + container: + image: localhost/replacement-transformer +replacements: +- source: + objref: + kind: VersionsCatalogue + name: versions-airshipctl + fieldref: spec.images.cert-manager.cainjector.image + target: + objref: + kind: Deployment + name: cert-manager-cainjector + fieldrefs: ["spec.template.spec.containers[name=cert-manager].image"] +- source: + objref: + kind: VersionsCatalogue + name: versions-airshipctl + fieldref: spec.images.cert-manager.controller.image + target: + objref: + kind: Deployment + name: cert-manager + fieldrefs: ["spec.template.spec.containers[name=cert-manager].image"] +- source: + objref: + kind: VersionsCatalogue + name: versions-airshipctl + fieldref: spec.images.cert-manager.webhook.image + target: + objref: + kind: Deployment + name: cert-manager-webhook + fieldrefs: ["spec.template.spec.containers[name=cert-manager].image"] diff --git a/manifests/function/clusterctl/replacements/versions.yaml b/manifests/function/clusterctl/replacements/versions.yaml index afd3bbff5..2c967f661 100644 --- a/manifests/function/clusterctl/replacements/versions.yaml +++ b/manifests/function/clusterctl/replacements/versions.yaml @@ -187,15 +187,3 @@ replacements: kind: Clusterctl name: clusterctl_init fieldrefs: ["{.images.infrastructure-azure/kube-rbac-proxy}"] - -# Replace the cert-manager image repository in the Clusterctl -- source: - objref: - kind: VersionsCatalogue - name: versions-airshipctl - fieldref: "{.spec.images.cert-manager.cert-manager.repository.image}" - target: - objref: - kind: Clusterctl - name: clusterctl_init - fieldrefs: ["{.images.cert-manager.repository}"] diff --git a/manifests/site/docker-test-site/target/catalogues/kustomization.yaml b/manifests/site/docker-test-site/target/catalogues/kustomization.yaml new file mode 100644 index 000000000..5c4965841 --- /dev/null +++ b/manifests/site/docker-test-site/target/catalogues/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../../../function/airshipctl-base-catalogues diff --git a/manifests/site/docker-test-site/target/initinfra-networking/kustomization.yaml b/manifests/site/docker-test-site/target/initinfra-networking/kustomization.yaml index 068decced..34e94f96e 100644 --- a/manifests/site/docker-test-site/target/initinfra-networking/kustomization.yaml +++ b/manifests/site/docker-test-site/target/initinfra-networking/kustomization.yaml @@ -1,6 +1,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - ../catalogues - ../../../../composite/infra commonLabels: airshipit.org/stage: initinfra + +transformers: + - ../../../../composite/infra/replacements diff --git a/manifests/site/gcp-test-site/target/catalogues/kustomization.yaml b/manifests/site/gcp-test-site/target/catalogues/kustomization.yaml new file mode 100644 index 000000000..5c4965841 --- /dev/null +++ b/manifests/site/gcp-test-site/target/catalogues/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../../../function/airshipctl-base-catalogues diff --git a/manifests/site/gcp-test-site/target/initinfra-networking/kustomization.yaml b/manifests/site/gcp-test-site/target/initinfra-networking/kustomization.yaml index 37c98fc0f..067f41eba 100644 --- a/manifests/site/gcp-test-site/target/initinfra-networking/kustomization.yaml +++ b/manifests/site/gcp-test-site/target/initinfra-networking/kustomization.yaml @@ -1,7 +1,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - ../catalogues - ../../../../composite/infra commonLabels: airshipit.org/stage: initinfra + +transformers: + - ../../../../composite/infra/replacements diff --git a/manifests/site/openstack-test-site/target/catalogues/kustomization.yaml b/manifests/site/openstack-test-site/target/catalogues/kustomization.yaml new file mode 100644 index 000000000..5c4965841 --- /dev/null +++ b/manifests/site/openstack-test-site/target/catalogues/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../../../function/airshipctl-base-catalogues diff --git a/manifests/site/openstack-test-site/target/initinfra/kustomization.yaml b/manifests/site/openstack-test-site/target/initinfra/kustomization.yaml index 37c98fc0f..184c7f0df 100644 --- a/manifests/site/openstack-test-site/target/initinfra/kustomization.yaml +++ b/manifests/site/openstack-test-site/target/initinfra/kustomization.yaml @@ -1,7 +1,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - ../catalogues - ../../../../composite/infra commonLabels: airshipit.org/stage: initinfra + +transformers: + - ../../../../composite/infra/replacements + diff --git a/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml b/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml index 25e1bfab6..5f471cde1 100644 --- a/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml +++ b/manifests/site/test-site/ephemeral/initinfra-networking/kustomization.yaml @@ -1,5 +1,9 @@ resources: + - ../catalogues - ../../../../composite/infra/ commonLabels: airshipit.org/stage: initinfra + +transformers: + - ../../../../composite/infra/replacements diff --git a/manifests/site/test-site/target/initinfra-networking/kustomization.yaml b/manifests/site/test-site/target/initinfra-networking/kustomization.yaml index 25e1bfab6..7f2231a87 100644 --- a/manifests/site/test-site/target/initinfra-networking/kustomization.yaml +++ b/manifests/site/test-site/target/initinfra-networking/kustomization.yaml @@ -1,5 +1,10 @@ resources: + - ../catalogues - ../../../../composite/infra/ commonLabels: airshipit.org/stage: initinfra + +transformers: + - ../../../../composite/infra/replacements +