From 162da181269ad6a0779ca6c340f28a1892067c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Mon, 10 Oct 2022 17:14:32 +0200 Subject: [PATCH] WiP --- infrastructure-values.yaml | 2 ++ infrastructure.yaml | 21 ++++++++++++++++++++ infrastructure/Chart.yaml | 5 +++++ infrastructure/{ => templates}/3scale.yaml | 0 infrastructure/{ => templates}/microcks.yaml | 19 +++--------------- infrastructure/templates/project.yaml | 12 +++++++++++ infrastructure/{ => templates}/sso.yaml | 19 +++--------------- infrastructure/{ => templates}/tekton.yaml | 0 infrastructure/values.yaml | 3 +++ openshift-gitops.yaml | 21 ++++++++++++++++++++ 10 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 infrastructure-values.yaml create mode 100644 infrastructure.yaml create mode 100644 infrastructure/Chart.yaml rename infrastructure/{ => templates}/3scale.yaml (100%) rename infrastructure/{ => templates}/microcks.yaml (56%) create mode 100644 infrastructure/templates/project.yaml rename infrastructure/{ => templates}/sso.yaml (58%) rename infrastructure/{ => templates}/tekton.yaml (100%) create mode 100644 infrastructure/values.yaml create mode 100644 openshift-gitops.yaml diff --git a/infrastructure-values.yaml b/infrastructure-values.yaml new file mode 100644 index 0000000..af62029 --- /dev/null +++ b/infrastructure-values.yaml @@ -0,0 +1,2 @@ +sso: + hostname: "sso-demo-apimgmt.apps.appdev.itix.xyz" diff --git a/infrastructure.yaml b/infrastructure.yaml new file mode 100644 index 0000000..abeffe4 --- /dev/null +++ b/infrastructure.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: demo-apimgmt-infra + namespace: openshift-gitops +spec: + destination: + name: '' + server: 'https://kubernetes.default.svc' + source: + path: infrastructure + repoURL: 'https://github.com/nmasse-itix/demo-apimgmt.git' + targetRevision: gitops + helm: + valueFiles: + - infrastructure-values.yaml + project: default + syncPolicy: + automated: + prune: true + selfHeal: false diff --git a/infrastructure/Chart.yaml b/infrastructure/Chart.yaml new file mode 100644 index 0000000..04b7984 --- /dev/null +++ b/infrastructure/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: infrastructure +type: application +version: 0.0.1 +appVersion: "0.0.1" \ No newline at end of file diff --git a/infrastructure/3scale.yaml b/infrastructure/templates/3scale.yaml similarity index 100% rename from infrastructure/3scale.yaml rename to infrastructure/templates/3scale.yaml diff --git a/infrastructure/microcks.yaml b/infrastructure/templates/microcks.yaml similarity index 56% rename from infrastructure/microcks.yaml rename to infrastructure/templates/microcks.yaml index e39a858..35592db 100644 --- a/infrastructure/microcks.yaml +++ b/infrastructure/templates/microcks.yaml @@ -1,26 +1,13 @@ -apiVersion: project.openshift.io/v1 -kind: Project -metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" - openshift.io/display-name: "Microcks" - labels: - kubernetes.io/metadata.name: microcks - name: microcks -spec: - finalizers: - - kubernetes ---- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: annotations: argocd.argoproj.io/sync-wave: "10" name: microcks - namespace: microcks + namespace: {{ projectName | quote }} spec: targetNamespaces: - - microcks + - {{ projectName | quote }} --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription @@ -28,7 +15,7 @@ metadata: annotations: argocd.argoproj.io/sync-wave: "10" name: microcks - namespace: microcks + namespace: {{ projectName | quote }} spec: channel: stable name: microcks diff --git a/infrastructure/templates/project.yaml b/infrastructure/templates/project.yaml new file mode 100644 index 0000000..9fa5bc2 --- /dev/null +++ b/infrastructure/templates/project.yaml @@ -0,0 +1,12 @@ +apiVersion: project.openshift.io/v1 +kind: Project +metadata: + annotations: + argocd.argoproj.io/sync-wave: "0" + openshift.io/display-name: "Demo API Management" + labels: + kubernetes.io/metadata.name: {{ projectName | quote }} + name: {{ projectName | quote }} +spec: + finalizers: + - kubernetes diff --git a/infrastructure/sso.yaml b/infrastructure/templates/sso.yaml similarity index 58% rename from infrastructure/sso.yaml rename to infrastructure/templates/sso.yaml index 6809205..2da301b 100644 --- a/infrastructure/sso.yaml +++ b/infrastructure/templates/sso.yaml @@ -1,26 +1,13 @@ -apiVersion: project.openshift.io/v1 -kind: Project -metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" - openshift.io/display-name: "Single Sign On" - labels: - kubernetes.io/metadata.name: sso - name: sso -spec: - finalizers: - - kubernetes ---- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: annotations: argocd.argoproj.io/sync-wave: "10" name: sso - namespace: sso + namespace: {{ projectName | quote }} spec: targetNamespaces: - - sso + - {{ projectName | quote }} --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription @@ -28,7 +15,7 @@ metadata: annotations: argocd.argoproj.io/sync-wave: "10" name: rhsso-operator - namespace: sso + namespace: {{ projectName | quote }} spec: channel: stable name: rhsso-operator diff --git a/infrastructure/tekton.yaml b/infrastructure/templates/tekton.yaml similarity index 100% rename from infrastructure/tekton.yaml rename to infrastructure/templates/tekton.yaml diff --git a/infrastructure/values.yaml b/infrastructure/values.yaml new file mode 100644 index 0000000..173a3e6 --- /dev/null +++ b/infrastructure/values.yaml @@ -0,0 +1,3 @@ +sso: + hostname: "" +projectName: demo-apimgmt diff --git a/openshift-gitops.yaml b/openshift-gitops.yaml new file mode 100644 index 0000000..7832770 --- /dev/null +++ b/openshift-gitops.yaml @@ -0,0 +1,21 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: demo-apimgmt-gitops +rules: +- apiGroups: ["project.openshift.io"] + resources: ["projects"] + verbs: ["*"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: demo-apimgmt-gitops +subjects: + - kind: ServiceAccount + name: openshift-gitops-argocd-application-controller + namespace: openshift-gitops +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: demo-apimgmt-gitops