diff --git a/examples/ansible/appsub/00-namespace.yaml b/examples/ansible/appsub/00-namespace.yaml deleted file mode 100644 index 92f1d0e5..00000000 --- a/examples/ansible/appsub/00-namespace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: ansible-pre-post - labels: - app: ansible diff --git a/examples/ansible/appsub/01-placement-rule.yaml b/examples/ansible/appsub/01-placement-rule.yaml index 0e10f300..0a14f118 100644 --- a/examples/ansible/appsub/01-placement-rule.yaml +++ b/examples/ansible/appsub/01-placement-rule.yaml @@ -2,7 +2,7 @@ apiVersion: apps.open-cluster-management.io/v1 kind: PlacementRule metadata: name: non-local-cluster - namespace: ansible-pre-post + namespace: default spec: # apply to 1 cluster whoevers name not local-cluster clusterReplicas: 1 diff --git a/examples/ansible/appsub/02-channel.yaml b/examples/ansible/appsub/02-channel.yaml new file mode 100644 index 00000000..16054f35 --- /dev/null +++ b/examples/ansible/appsub/02-channel.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: apps.open-cluster-management.io/v1 +kind: Channel +metadata: + name: git + namespace: default +spec: + type: git + pathname: https://github.com/open-cluster-management-io/multicloud-operators-subscription.git diff --git a/examples/ansible/appsub/03-subscription.yaml b/examples/ansible/appsub/03-subscription.yaml index 33aa5740..ad6183ec 100644 --- a/examples/ansible/appsub/03-subscription.yaml +++ b/examples/ansible/appsub/03-subscription.yaml @@ -2,14 +2,15 @@ apiVersion: apps.open-cluster-management.io/v1 kind: Subscription metadata: name: ansible-hook - namespace: ansible-pre-post - labels: - app: ansible + namespace: default annotations: apps.open-cluster-management.io/github-path: examples/ansible/resources - apps.open-cluster-management.io/github-branch: master + apps.open-cluster-management.io/github-branch: main spec: - channel: ansible-pre-post/git + hooksecretref: + namespace: default + name: toweraccess + channel: default/git placement: placementRef: kind: PlacementRule diff --git a/examples/ansible/appsub/04-application.yaml b/examples/ansible/appsub/04-application.yaml deleted file mode 100644 index c0313041..00000000 --- a/examples/ansible/appsub/04-application.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: app.k8s.io/v1beta1 -kind: Application -metadata: - name: ansible - namespace: ansible-pre-post -spec: - descriptor: {} - selector: - matchExpressions: - - key: app - operator: In - values: - - ansible - componentKinds: - - group: apps.open-cluster-management.io - kind: Subscription diff --git a/examples/ansible/appsub/EDITE02-channel.yaml b/examples/ansible/appsub/EDITE02-channel.yaml deleted file mode 100644 index 5a355e92..00000000 --- a/examples/ansible/appsub/EDITE02-channel.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -apiVersion: apps.open-cluster-management.io/v1 -kind: Channel -metadata: - name: git - namespace: ansible-pre-post -spec: - type: git - pathname: https://github.com/<_replace_me_>/multicloud-operators-subscription.git diff --git a/examples/ansible/appsub/EDITME-secret.yaml b/examples/ansible/appsub/EDITME-secret.yaml index b61b3bca..8a6c8e9a 100644 --- a/examples/ansible/appsub/EDITME-secret.yaml +++ b/examples/ansible/appsub/EDITME-secret.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: toweraccess - namespace: ansible-pre-post + namespace: default type: Opaque stringData: token: _token_here diff --git a/examples/ansible/appsub/README.md b/examples/ansible/appsub/README.md index df515eb8..b44eb732 100644 --- a/examples/ansible/appsub/README.md +++ b/examples/ansible/appsub/README.md @@ -1,11 +1,10 @@ Prepare: -1. A open-cluster-management hub cluster with subscription operator running and at least one managed cluster. See https://open-cluster-management.io "Getting Started" +1. An Open Cluster Management hub cluster with subscription operator running and at least one managed cluster with subscription add-on enable. See https://open-cluster-management.io "Get Started" for more details. 2. An Ansible AWX/Tower environment. See https://github.com/ansible/awx for more details. Perform: -1. Fork the https://github.com/open-cluster-management/multicloud-operators-subscription into your personal repo. -2. Edit the `examples/ansible/appsub/EDITME02-channel.yaml` and `examples/ansible/appsub/EDITME-secret.yaml` files. -3. `git clone https://github.com/_your_github_id_/multicloud-operators-subscription.git` -4. `cd multicloud-operators-subscription` -5. `kubectl apply -f examples/ansible/appsub` -6. This will create a subscription that watches resources in https://github.com/_your_github_id_/multicloud-operators-subscription/examples/ansible/resources +1. Edit the `examples/ansible/appsub/EDITME-secret.yaml` file. +2. `git clone https://github.com/open-cluster-management-io/multicloud-operators-subscription.git` +3. `cd multicloud-operators-subscription` +4. `kubectl apply -f examples/ansible/appsub` +5. This will create a subscription that watches resources in https://github.com/open-cluster-management-io/multicloud-operators-subscription/tree/main/examples/ansible/resources diff --git a/examples/ansible/resources/cfg_and_ansible.yaml b/examples/ansible/resources/cfg_and_ansible.yaml index 2c8912a5..1287da21 100644 --- a/examples/ansible/resources/cfg_and_ansible.yaml +++ b/examples/ansible/resources/cfg_and_ansible.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: + namespace: default name: guestbook-cfgmap data: database: mongodb diff --git a/examples/ansible/resources/posthook/sub_posthook.yaml b/examples/ansible/resources/posthook/sub_posthook.yaml index ded530b8..059ae8e8 100644 --- a/examples/ansible/resources/posthook/sub_posthook.yaml +++ b/examples/ansible/resources/posthook/sub_posthook.yaml @@ -3,7 +3,7 @@ apiVersion: tower.ansible.com/v1alpha1 kind: AnsibleJob metadata: name: posthook-test - namespace: ansible-pre-post + namespace: default spec: job_template_name: Demo Job Template tower_auth_secret: toweraccess diff --git a/examples/ansible/resources/prehook/sub_prehook.yaml b/examples/ansible/resources/prehook/sub_prehook.yaml index 3687e1ba..a7f42c51 100644 --- a/examples/ansible/resources/prehook/sub_prehook.yaml +++ b/examples/ansible/resources/prehook/sub_prehook.yaml @@ -3,7 +3,7 @@ apiVersion: tower.ansible.com/v1alpha1 kind: AnsibleJob metadata: name: prehook-test - namespace: ansible-pre-post + namespace: default spec: job_template_name: Demo Job Template tower_auth_secret: toweraccess