From 711338fe33833aa3b943855bb3d57377c41c3225 Mon Sep 17 00:00:00 2001 From: Eric Sauer Date: Tue, 9 Jun 2020 14:02:33 -0400 Subject: [PATCH] Change labels to new format based on issue #2 --- README.md | 8 +++---- argocd-bootstrap/0-namespaces/argocd.yaml | 8 +++---- .../1-operators/argocd-operator.yaml | 16 ++++++------- argocd-bootstrap/3-argocd/argocd-basic.yaml | 8 +++---- argocd-bootstrap/README.md | 14 +++++------ .../0-namespaces/cluster-ops.yaml | 8 +++---- simple-bootstrap/0-namespaces/deleteable.yaml | 8 +++---- .../namespace-config-operator.yaml | 8 +++---- .../namespace-config-operator.yaml | 16 ++++++------- .../2-rbac/cluster-admins-rolebinding.yaml | 8 +++---- .../3-operator-configs/gitops-job.yaml | 24 +++++++++---------- .../sandbox-userconfig.yaml | 8 +++---- 12 files changed, 67 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 5f20c5e..932743b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The purpose of these examples is twofold: The simple cluster bootstrapping example shows how cluster administrators might begin managing OpenShift clusters using just `oc apply`. Each resource in this example carries a common label (`example.com/project: simple-bootstrap`) that associates it with this `project`. In doing this, we can manage the full lifecycle of our resources with a single command. ``` -until oc apply -Rf simple-bootstrap/ --prune -l example.com/project=simple-bootstrap; do sleep 2; done +until oc apply -Rf simple-bootstrap/ --prune -l config.example.com/name=simple-bootstrap; do sleep 2; done ``` Explanation of the command is below. @@ -52,7 +52,7 @@ Now, let's remove a namespace and re-run the same command: ``` $ rm simple-bootstrap/0-namespaces/deleteable.yaml -$ oc apply -Rf simple-bootstrap/ --prune -l example.com/project=simple-bootstrap +$ oc apply -Rf simple-bootstrap/ --prune -l config.example.com/name=simple-bootstrap namespace/namespace-operator configured operatorgroup.operators.coreos.com/namespace-operator unchanged subscription.operators.coreos.com/namespace-configuration-operator unchanged @@ -66,7 +66,7 @@ We can see that by deleting the file, the resource gets deleted. In order to be able to handle pruning of custom resources, we have to customize the set of resource types that we are searching for with our label. To do this, we pass the `--prune-whitelist` flag. In order to simplify this, we've written the set of flags that we're handling to a file that we add to the command. ``` -$ oc apply -Rf simple-bootstrap/ --prune -l example.com/project=simple-bootstrap $(cat prune-whitelist.txt) +$ oc apply -Rf simple-bootstrap/ --prune -l config.example.com/name=simple-bootstrap $(cat prune-whitelist.txt) namespace/deleteable configured namespace/namespace-operator configured operatorgroup.operators.coreos.com/namespace-operator unchanged @@ -88,7 +88,7 @@ Error from server (NotFound): error when creating "simple-bootstrap/3-operator-c The simplest way to handle this is with a simple retry loop. ``` -$ until oc apply -Rf simple-bootstrap/ --prune -l example.com/project=simple-bootstrap $(cat prune-whitelist.txt); do sleep 2; done +$ until oc apply -Rf simple-bootstrap/ --prune -l config.example.com/name=simple-bootstrap $(cat prune-whitelist.txt); do sleep 2; done namespace/deleteable configured namespace/namespace-operator configured operatorgroup.operators.coreos.com/namespace-operator unchanged diff --git a/argocd-bootstrap/0-namespaces/argocd.yaml b/argocd-bootstrap/0-namespaces/argocd.yaml index afeefae..ea29113 100644 --- a/argocd-bootstrap/0-namespaces/argocd.yaml +++ b/argocd-bootstrap/0-namespaces/argocd.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: argocd-bootstrap - example.com/component: namespaces + config.example.com/name: argocd-bootstrap + config.example.com/component: namespaces name: argocd spec: diff --git a/argocd-bootstrap/1-operators/argocd-operator.yaml b/argocd-bootstrap/1-operators/argocd-operator.yaml index 1e160b3..e43fe94 100644 --- a/argocd-bootstrap/1-operators/argocd-operator.yaml +++ b/argocd-bootstrap/1-operators/argocd-operator.yaml @@ -3,11 +3,11 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: argocd-bootstrap - example.com/component: operators + config.example.com/name: argocd-bootstrap + config.example.com/component: operators name: argocd-operator namespace: argocd spec: @@ -18,11 +18,11 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: argocd-bootstrap - example.com/component: operators + config.example.com/name: argocd-bootstrap + config.example.com/component: operators name: argocd-operator namespace: argocd spec: diff --git a/argocd-bootstrap/3-argocd/argocd-basic.yaml b/argocd-bootstrap/3-argocd/argocd-basic.yaml index 59911d6..c1a6c7f 100644 --- a/argocd-bootstrap/3-argocd/argocd-basic.yaml +++ b/argocd-bootstrap/3-argocd/argocd-basic.yaml @@ -2,12 +2,12 @@ apiVersion: argoproj.io/v1alpha1 kind: ArgoCD metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: example: basic - example.com/component: operators - example.com/project: argocd-bootstrap + config.example.com/component: operators + config.example.com/name: argocd-bootstrap name: example-argocd namespace: argocd spec: {} diff --git a/argocd-bootstrap/README.md b/argocd-bootstrap/README.md index 674f6d0..39b9e26 100644 --- a/argocd-bootstrap/README.md +++ b/argocd-bootstrap/README.md @@ -7,7 +7,7 @@ This directory contains the manifests required to install the [Argo CD operator] The argo-cd cluster bootstrapping example shows how cluster administrators might begin deploying the argo-cd operator `oc apply`. Each resource in this example carries a common label (`example.com/project: argocd-bootstrap`) that associates it with this `project`. In doing this, we can manage the full lifecycle of our resources with a single command. ``` -oc apply -Rf ../argocd-bootstrap/ --prune -l example.com/project=argocd-bootstrap +oc apply -Rf ../argocd-bootstrap/ --prune -l config.example.com/name=argocd-bootstrap ``` The `apply` command idempotently ensures that the live configuration is in sync with our configuration files, while the `--prune` flag allows us to also manage the deletion of live objects by simply deleting the associated file in this repository. @@ -15,7 +15,7 @@ The `apply` command idempotently ensures that the live configuration is in sync As an example, let's bootstrap our cluster for the first time: ``` -$ oc apply -Rf ../argocd-bootstrap/ --prune -l example.com/project=argocd-bootstrap +$ oc apply -Rf ../argocd-bootstrap/ --prune -l config.example.com/name=argocd-bootstrap namespace/argocd configured operatorgroup.operators.coreos.com/argocd-operator created subscription.operators.coreos.com/argocd-operator created @@ -69,19 +69,19 @@ apiVersion: argoproj.io/v1alpha1 kind: ArgoCD metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: example: basic - example.com/component: operators - example.com/project: argocd-bootstrap + config.example.com/component: operators + config.example.com/name: argocd-bootstrap name: example-argocd spec: server: route: true -$ oc apply -Rf simple-bootstrap/ --prune -l example.com/project=simple-bootstrap +$ oc apply -Rf simple-bootstrap/ --prune -l config.example.com/name=simple-bootstrap namespace/argocd configured operatorgroup.operators.coreos.com/argocd-operator unchanged subscription.operators.coreos.com/argocd-operator unchanged diff --git a/simple-bootstrap/0-namespaces/cluster-ops.yaml b/simple-bootstrap/0-namespaces/cluster-ops.yaml index 7accd13..47f91c3 100644 --- a/simple-bootstrap/0-namespaces/cluster-ops.yaml +++ b/simple-bootstrap/0-namespaces/cluster-ops.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: namespaces + config.example.com/name: simple-bootstrap + config.example.com/component: namespaces name: cluster-ops spec: diff --git a/simple-bootstrap/0-namespaces/deleteable.yaml b/simple-bootstrap/0-namespaces/deleteable.yaml index 0e6c7f9..edaf7f6 100644 --- a/simple-bootstrap/0-namespaces/deleteable.yaml +++ b/simple-bootstrap/0-namespaces/deleteable.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: namespaces + config.example.com/name: simple-bootstrap + config.example.com/component: namespaces name: deleteable spec: diff --git a/simple-bootstrap/0-namespaces/namespace-config-operator.yaml b/simple-bootstrap/0-namespaces/namespace-config-operator.yaml index a22a91d..8fd2b70 100644 --- a/simple-bootstrap/0-namespaces/namespace-config-operator.yaml +++ b/simple-bootstrap/0-namespaces/namespace-config-operator.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: namespaces + config.example.com/name: simple-bootstrap + config.example.com/component: namespaces name: namespace-operator spec: diff --git a/simple-bootstrap/1-operators/namespace-config-operator.yaml b/simple-bootstrap/1-operators/namespace-config-operator.yaml index 1982301..47a893c 100644 --- a/simple-bootstrap/1-operators/namespace-config-operator.yaml +++ b/simple-bootstrap/1-operators/namespace-config-operator.yaml @@ -3,11 +3,11 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: operators + config.example.com/name: simple-bootstrap + config.example.com/component: operators name: namespace-operator namespace: namespace-operator spec: @@ -18,11 +18,11 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: operators + config.example.com/name: simple-bootstrap + config.example.com/component: operators name: namespace-configuration-operator namespace: namespace-operator spec: diff --git a/simple-bootstrap/2-rbac/cluster-admins-rolebinding.yaml b/simple-bootstrap/2-rbac/cluster-admins-rolebinding.yaml index 9589ef2..b483c2f 100644 --- a/simple-bootstrap/2-rbac/cluster-admins-rolebinding.yaml +++ b/simple-bootstrap/2-rbac/cluster-admins-rolebinding.yaml @@ -3,11 +3,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: rbac + config.example.com/name: simple-bootstrap + config.example.com/component: rbac name: cluster-administrators roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/simple-bootstrap/3-operator-configs/gitops-job.yaml b/simple-bootstrap/3-operator-configs/gitops-job.yaml index 4174847..d386ade 100644 --- a/simple-bootstrap/3-operator-configs/gitops-job.yaml +++ b/simple-bootstrap/3-operator-configs/gitops-job.yaml @@ -3,11 +3,11 @@ apiVersion: batch/v1beta1 kind: CronJob metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: configs + config.example.com/name: simple-bootstrap + config.example.com/component: configs name: cronjob-gitops namespace: cluster-ops spec: @@ -66,11 +66,11 @@ apiVersion: authorization.openshift.io/v1 kind: ClusterRoleBinding metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: configs + config.example.com/name: simple-bootstrap + config.example.com/component: configs name: system:project-pruners roleRef: name: cluster-admin @@ -85,10 +85,10 @@ apiVersion: v1 kind: ServiceAccount metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: configs + config.example.com/name: simple-bootstrap + config.example.com/component: configs name: gitops namespace: cluster-ops diff --git a/simple-bootstrap/3-operator-configs/sandbox-userconfig.yaml b/simple-bootstrap/3-operator-configs/sandbox-userconfig.yaml index 50ff9b9..8f239f2 100644 --- a/simple-bootstrap/3-operator-configs/sandbox-userconfig.yaml +++ b/simple-bootstrap/3-operator-configs/sandbox-userconfig.yaml @@ -3,11 +3,11 @@ apiVersion: redhatcop.redhat.io/v1alpha1 kind: UserConfig metadata: annotations: - example.com/managed-by: gitops - example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git labels: - example.com/project: simple-bootstrap - example.com/component: operator-configs + config.example.com/name: simple-bootstrap + config.example.com/component: operator-configs name: sandboxes spec: provider: corp-ldap