Install script for operators on Kubernetes + Activate tests with operators on Kubernetes cluster (#5861)

This commit is contained in:
Philippe Martin
2022-06-23 11:29:10 +02:00
committed by GitHub
parent 63e7a04830
commit a7fc6b7718
5 changed files with 43 additions and 12 deletions

View File

@@ -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
```
@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)
})