Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions deploy/releases/1.4.3/kustomize-argo-cd/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
= Installing the Runtime Component Operator using kustomize with Argo CD

This directory contains configuration files that helps installing the Runtime Component operator
using `kustomize` with link:++https://argoproj.github.io/argo-cd/++[Argo CD]. These configurations
are useful when using link:++https://github.com/redhat-developer/gitops-operator++[Red Hat® OpenShift® GitOps Operator] to manage link:++https://argo-cd.readthedocs.io/en/stable/user-guide/++[Argo CD Applications] within a Red Hat® OpenShift® Container Platform cluster.

Red Hat® OpenShift® GitOps is based on the open source project link:++https://argoproj.github.io/argo-cd/++[Argo CD] and provides a similar set of features to what the upstream offers, with additional automation and integration into Red Hat® OpenShift® Container Platform. Hence, these configurations are also transferable when using link:++https://argocd-operator.readthedocs.io/en/latest/++[Argo CD Operator] standalone within a Kubernetes cluster.

== Installation

1. Install link:++https://github.com/redhat-developer/gitops-operator++[Red Hat® OpenShift® GitOps Operator] from OpenShift® UI into the `openshift-gitops-operator` namespace.
2. Grant cluster-admin permissions for the GitOps operator to be able to create Custom Resource Definitions for Runtime Component operator.


oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller -n openshift-gitops

3. Follow the steps below for one of the three install modes:

- link:++#installing-and-watching-own-namespace++[Installing and watching own namespace],
- link:++#installing-and-watching-another-namespace++[Installing and watching another namespace], or
- link:++#installing-and-watching-all-namespaces++[Installing and watching all namespaces]

3. You can choose to modify the default namespace(s) by updating `.spec.source.kustomize.namespace` **and** `.spec.destination.namespace` in the `Application` custom resource(s).
4. (Optional) Ignore runtime artifacts generated by Runtime Component operator such as the `runtime-component-operator` ConfigMap by editing the Application custom resource.

== Installing and watching own namespace

=== kustomize-rco-own-namespace.yaml
This Argo CD Application installs the operator into the 'runtime-component' namespace,
and the operator watches for Runtime Component custom resource instances only in its own namespace. To install, run: `kubectl apply -f kustomize-rco-own-namespace.yaml` and to uninstall, run: `kubectl delete -f kustomize-rco-own-namespace.yaml`


== Installing and watching another namespace

=== kustomize-rco-another-namespace.yaml
These Argo CD Applications install the operator into the namespace 'rco-ns', but configures it to
watch for Runtime Component custom resource instances in a different namespace called 'rco-watched-ns'. To install, run: `kubectl apply -f kustomize-rco-another-namespace.yaml`

== Installing and watching all namespaces

=== kustomize-rco-all-namespaces.yaml
This Argo CD Application installs the operator into the 'runtime-component' namespace,
but configures it to watch for Runtime Component custom resource instances in any namespaces.
Compared to the OwnNamespace configuration, this Application requires additional ClusterRoles and ClusterRoleBindings.
To install, run: `kubectl apply -f kustomize-rco-all-namespaces.yaml`
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: runtime-component-operator
namespace: openshift-gitops
spec:
sourceRepos:
- 'https://github.com/application-stacks/runtime-component-operator'
destinations:
- namespace: '!kube-*'
server: '*'
- namespace: '!openshift-[!o][!p][!e][!r][!a][!t][!o][!r][!s]*'
server: '*'
- namespace: '!openshift-apiserver'
server: '*'
- namespace: '!openshift-kni-infra'
server: '*'
- namespace: '!openshift-[a-z][a-z][a-z][a-z][a-z][a-z][a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z][a-z][a-z][a-z][a-z][a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z][a-z][a-z][a-z][a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z][a-z][a-z][a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z][a-z][a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z][a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z][a-z]'
server: '*'
- namespace: '!openshift-[a-z]'
server: '*'
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
- group: rbac.authorization.k8s.io
kind: ClusterRole
- group: rbac.authorization.k8s.io
kind: ClusterRoleBinding
- group: ''
kind: Namespace
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: runtime-component-operator
namespace: openshift-gitops
spec:
project: runtime-component-operator
source:
path: deploy/releases/1.4.3/kustomize/overlays/watch-all-namespaces
repoURL: 'https://github.com/application-stacks/runtime-component-operator'
targetRevision: HEAD
kustomize:
namespace: runtime-component
destination:
namespace: runtime-component
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: runtime-component-operator
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: runtime-component-operator
namespace: openshift-gitops
spec:
sourceRepos:
- 'https://github.com/application-stacks/runtime-component-operator'
destinations:
- namespace: '!kube-*'
server: '*'
- namespace: '!openshift-*'
server: '*'
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
- group: ''
kind: Namespace
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: runtime-component-operator
namespace: openshift-gitops
spec:
project: runtime-component-operator
source:
path: deploy/releases/1.4.3/kustomize/overlays/watch-another-namespace/rco-ns
repoURL: 'https://github.com/application-stacks/runtime-component-operator'
targetRevision: HEAD
kustomize:
namespace: rco-ns
destination:
namespace: rco-ns
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: runtime-component-operator
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: runtime-component-operator-watched-namespace
namespace: openshift-gitops
spec:
project: runtime-component-operator
source:
path: deploy/releases/1.4.3/kustomize/overlays/watch-another-namespace/rco-watched-ns
repoURL: 'https://github.com/application-stacks/runtime-component-operator'
targetRevision: HEAD
kustomize:
namespace: rco-watched-ns
destination:
namespace: rco-watched-ns
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: runtime-component-operator
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: runtime-component-operator
namespace: openshift-gitops
spec:
sourceRepos:
- 'https://github.com/application-stacks/runtime-component-operator'
destinations:
- namespace: '!kube-*'
server: '*'
- namespace: '!openshift-*'
server: '*'
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
- group: ''
kind: Namespace
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: runtime-component-operator
namespace: openshift-gitops
spec:
project: runtime-component-operator
source:
path: deploy/releases/1.4.3/kustomize/base
repoURL: 'https://github.com/application-stacks/runtime-component-operator'
targetRevision: HEAD
kustomize:
namespace: runtime-component
destination:
namespace: runtime-component
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: runtime-component-operator
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
12 changes: 8 additions & 4 deletions deploy/releases/1.4.3/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ spec:
sourceNamespace: openshift-marketplace
```

=== Option 2: Install using kubectl
=== Option 2: Install using kustomize

See the instructions link:++kubectl/++[here].
See the instructions link:++kustomize/++[here].

=== Option 3: Install using kustomize
=== Option 3: Install using kustomize with Argo CD

See the instructions link:++kustomize/++[here].
See the instructions link:++kustomize-argo-cd/++[here].

=== Option 4: Install using kubectl

See the instructions link:++kubectl/++[here].


== Limitations
Expand Down