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
46 changes: 46 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,46 @@
= Installing the Open Liberty Operator using kustomize with Argo CD

This directory contains configuration files that helps installing the Open Liberty 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 Open Liberty 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 Open Liberty operator such as the `open-liberty-operator` ConfigMap by editing the Application custom resource.

== Installing and watching own namespace

=== kustomize-olo-own-namespace.yaml
This Argo CD Application installs the operator into the 'open-liberty' namespace,
and the operator watches for Open Liberty custom resource instances only in its own namespace.
To install, run: `kubectl apply -f kustomize-olo-own-namespace.yaml` and to uninstall, run: `kubectl delete -f kustomize-olo-own-namespace.yaml`


== Installing and watching another namespace

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

== Installing and watching all namespaces

=== kustomize-olo-all-namespaces.yaml
This Argo CD Application installs the operator into the 'open-liberty' namespace,
but configures it to watch for Open Liberty 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-olo-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: open-liberty-operator
namespace: openshift-gitops
spec:
sourceRepos:
- 'https://github.com/OpenLiberty/open-liberty-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: open-liberty-operator
namespace: openshift-gitops
spec:
project: open-liberty-operator
source:
path: deploy/releases/1.4.3/kustomize/overlays/watch-all-namespaces
repoURL: 'https://github.com/OpenLiberty/open-liberty-operator'
targetRevision: HEAD
kustomize:
namespace: open-liberty
destination:
namespace: open-liberty
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: open-liberty-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: open-liberty-operator
namespace: openshift-gitops
spec:
sourceRepos:
- 'https://github.com/OpenLiberty/open-liberty-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: open-liberty-operator
namespace: openshift-gitops
spec:
project: open-liberty-operator
source:
path: deploy/releases/1.4.3/kustomize/overlays/watch-another-namespace/olo-ns
repoURL: 'https://github.com/OpenLiberty/open-liberty-operator'
targetRevision: HEAD
kustomize:
namespace: olo-ns
destination:
namespace: olo-ns
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: open-liberty-operator
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: open-liberty-operator-watched-namespace
namespace: openshift-gitops
spec:
project: open-liberty-operator
source:
path: deploy/releases/1.4.3/kustomize/overlays/watch-another-namespace/olo-watched-ns
repoURL: 'https://github.com/OpenLiberty/open-liberty-operator'
targetRevision: HEAD
kustomize:
namespace: olo-watched-ns
destination:
namespace: olo-watched-ns
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: open-liberty-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: open-liberty-operator
namespace: openshift-gitops
spec:
sourceRepos:
- 'https://github.com/OpenLiberty/open-liberty-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: open-liberty-operator
namespace: openshift-gitops
spec:
project: open-liberty-operator
source:
path: deploy/releases/1.4.3/kustomize/base
repoURL: 'https://github.com/OpenLiberty/open-liberty-operator'
targetRevision: HEAD
kustomize:
namespace: open-liberty
destination:
namespace: open-liberty
server: 'https://kubernetes.default.svc'
ignoreDifferences:
- group: ''
kind: ConfigMap
name: open-liberty-operator
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
6 changes: 5 additions & 1 deletion deploy/releases/1.4.3/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ spec:

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

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

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

=== Option 4: Install using kubectl

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

Expand Down