Skip to content

Commit

Permalink
Install script for operators on Kubernetes + Activate tests with oper…
Browse files Browse the repository at this point in the history
…ators on Kubernetes cluster (redhat-developer#5861)
  • Loading branch information
feloy authored and cdrage committed Aug 31, 2022
1 parent cbb477b commit 33413d7
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
14 changes: 8 additions & 6 deletions scripts/ansible/kubernetes-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ ansible-playbook destroy.yml -e name_prefix=...
This ansible playbook deploys operators on a Kubernetes cluster. The cluster should be running the Operator Lifecycle Manager ([OLM](https://olm.operatorframework.io/)), either natively for an OpenShift cluster, or by installing it on a Kubernetes cluster.
To install OLM on a Kubernetes cluster go to the ([OLM releases page](https://github.com/operator-framework/operator-lifecycle-manager/releases/)), the latest version is displayed at the top, execute the commands as described under the "Scripted" section. At the time this document was written the latest version was v0.19.1:
To install OLM on a Kubernetes cluster go to the ([OLM releases page](https://github.com/operator-framework/operator-lifecycle-manager/releases/)), the latest version is displayed at the top, execute the commands as described under the "Scripted" section. At the time this document was written the latest version was v0.21.2:
```
curl -L https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.19.1/install.sh -o install.sh
chmod +x install.sh
./install.sh v0.19.1
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.21.2/install.sh | bash -s v0.21.2
```
Expand All @@ -133,9 +131,13 @@ ansible-galaxy collection install -r requirements.yml
3. Connect to the cluster and make sure your `kubeconfig` points to the cluster.
4. Install the operators:
4. Install the operators for OpenShift / Kubernetes:
```
ansible-playbook operators.yml
ansible-playbook operators-openshift.yml
```
or
```
ansible-playbook operators-kubernetes.yml
```
## NFS provisioner
Expand Down
35 changes: 35 additions & 0 deletions scripts/ansible/kubernetes-cluster/operators-kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: Install Operators on Kubernetes Cluster
hosts: localhost
collections:
- community.kubernetes
tasks:

- name: Create a Subscription for Service Binding Operator
k8s:
state: present
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: my-service-binding-operator
namespace: operators
spec:
channel: stable
name: service-binding-operator
source: operatorhubio-catalog
sourceNamespace: olm
- name: Create a Subscription for EDB Postgresql Operator
k8s:
state: present
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: my-cloud-native-postgresql
namespace: operators
spec:
channel: stable
name: cloud-native-postgresql
source: operatorhubio-catalog
sourceNamespace: olm
3 changes: 0 additions & 3 deletions tests/integration/devfile/cmd_add_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ var _ = Describe("odo add binding command tests", func() {
var err error

var _ = BeforeEach(func() {
if helper.IsKubernetesCluster() {
Skip("Operators have not been setup on Kubernetes cluster yet. Remove this once the issue has been fixed.")
}
commonVar = helper.CommonBeforeEach()
helper.Chdir(commonVar.Context)
// Ensure that the operators are installed
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/devfile/cmd_describe_list_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ var _ = Describe("odo describe/list binding command tests", func() {

// This is run before every Spec (It)
var _ = BeforeEach(func() {
if helper.IsKubernetesCluster() {
Skip("Operators have not been setup on Kubernetes cluster yet. Remove this once the issue has been fixed.")
}
commonVar = helper.CommonBeforeEach()
helper.Chdir(commonVar.Context)
})
Expand Down

0 comments on commit 33413d7

Please sign in to comment.