Skip to content

Commit

Permalink
Move channel into the subscription
Browse files Browse the repository at this point in the history
Use the same structure as ocm samplesp[1], keeping the channel in the
subscription kustomization under the application namespace.

This is better for users, removing one step from the deployment steps.
Now it is not possible to forget to deploy the channel.

This is better for developers, since now we can test multiple
applications concurrently, without dealing with setup and cleanup of
shared resources, since application do not share the channel.

[1] https://github.com/open-cluster-management-io/multicloud-operators-subscription/tree/main/examples/github-channel

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Nov 27, 2023
1 parent 847de94 commit 48c0bee
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 29 deletions.
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,6 @@ OCM Stateful application samples, including Ramen resources.
kubectl get drcluster,drpolicy
```

1. Setup the common OCM channel resources on the hub:

```
kubectl apply -k channel
```

This creates a Channel resource in the `ramen-samples` namespace and
can be viewed using:

```
kubectl get channel ramen-gitops -n ramen-samples
```

## The sample applications

This repository provides sample applications that can be deployed on
Expand Down Expand Up @@ -150,12 +137,13 @@ Applications:
kubectl apply -k k8s/busybox-regional-rbd-deploy/sub
```

This creates the required Subscription, Placement, and
This creates the required Channel, Subscription, Placement, and
ManagedClusterSetBinding resources for the busybox application in the
`busybox-regional-rbd-deploy` namespace and can be viewed using:

```
kubectl get subscription,placement -n busybox-regional-rbd-deploy
kubectl get channel,subscription,placement,managedclusterbinding \
-n busybox-regional-rbd-deploy
```

1. Inspect subscribed resources from the channel created in the same
Expand Down
6 changes: 0 additions & 6 deletions channel/kustomization.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions channel/namespace.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions k8s/busybox-regional-rbd-deploy/sub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ patches:
- op: replace
path: /metadata/annotations/apps.open-cluster-management.io~1github-path
value: k8s/busybox-regional-rbd-deploy/app
- op: replace
path: /spec/channel
value: busybox-regional-rbd-deploy/ocm-ramen-samples
3 changes: 3 additions & 0 deletions k8s/busybox-regional-rbd-ds/sub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ patches:
- op: replace
path: /metadata/annotations/apps.open-cluster-management.io~1github-path
value: k8s/busybox-regional-rbd-ds/app
- op: replace
path: /spec/channel
value: busybox-regional-rbd-ds/ocm-ramen-samples
3 changes: 3 additions & 0 deletions k8s/busybox-regional-rbd-sts/sub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ patches:
- op: replace
path: /metadata/annotations/apps.open-cluster-management.io~1github-path
value: k8s/busybox-regional-rbd-sts/app
- op: replace
path: /spec/channel
value: busybox-regional-rbd-sts/ocm-ramen-samples
3 changes: 3 additions & 0 deletions odr/busybox-metro-rbd-deploy/sub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ patches:
- op: replace
path: /metadata/annotations/apps.open-cluster-management.io~1github-path
value: odr/busybox-metro-rbd-deploy/app
- op: replace
path: /spec/channel
value: busybox-metro-rbd-deploy/ocm-ramen-samples
3 changes: 3 additions & 0 deletions odr/busybox-regional-cephfs-deploy/sub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ patches:
- op: replace
path: /metadata/annotations/apps.open-cluster-management.io~1github-path
value: odr/busybox-regional-cephfs-deploy/app
- op: replace
path: /spec/channel
value: busybox-regional-cephfs-deploy/ocm-ramen-samples
3 changes: 3 additions & 0 deletions odr/busybox-regional-rbd-deploy/sub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ patches:
- op: replace
path: /metadata/annotations/apps.open-cluster-management.io~1github-path
value: odr/busybox-regional-rbd-deploy/app
- op: replace
path: /spec/channel
value: busybox-regional-rbd-deploy/ocm-ramen-samples
3 changes: 1 addition & 2 deletions channel/channel.yaml → subscription/channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
apiVersion: apps.open-cluster-management.io/v1
kind: Channel
metadata:
name: ramen-gitops
namespace: ramen-samples
name: ocm-ramen-samples
spec:
type: GitHub
pathname: https://github.com/RamenDR/ocm-ramen-samples.git
1 change: 1 addition & 0 deletions subscription/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- channel.yaml
- binding.yaml
- placement.yaml
- subscription.yaml
2 changes: 1 addition & 1 deletion subscription/subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
apps.open-cluster-management.io/github-path: busybox/deployment
name: busybox-sub
spec:
channel: ramen-samples/ramen-gitops
channel: busybox-sample/ocm-ramen-samples
placement:
placementRef:
kind: Placement
Expand Down

0 comments on commit 48c0bee

Please sign in to comment.