Giter VIP home page Giter VIP logo

ibm / operator-sample-go Goto Github PK

View Code? Open in Web Editor NEW
49.0 9.0 17.0 43.92 MB

Kubernetes Operator Samples using Go, the Operator SDK and OLM

Home Page: https://ibm.github.io/operator-sample-go-documentation/

License: Apache License 2.0

Dockerfile 2.03% Makefile 4.36% Go 32.23% Java 5.18% Shell 56.20%
kubernetes openshift go devops golang automation operator operations day2 kubernetes-operator

operator-sample-go's Introduction

Kubernetes Operator Patterns and Best Practises

This project contains Kubernetes operator samples that demonstrate best practices how to develop operators with Golang, Operator SDK including Kubebuilder and the Operator Lifecycle Manager Framework.

Brief Overview

The repo contains two operators:

  • Application operator: Deploys and manages a front-end micro-service application which provides a simple web UI.
  • Database operator: Deploys and manages a simple database. Used by the front-end application.

Additionally the repo contains four more application components:

  • simple-microservice - A front end web application, written in Java using Quarkus
  • database-service - A simple database application deployed by the database operator, written in Java using Quarkus
  • operator-database-backup - A Go application to query the database and upload the data to cloud object storage. This container is launched on a schedule by the database operator
  • operator-application-scaler - A Go application used to make autoscaling decisions for the front-end. It queries Prometheus metrics exposed by the simple-microservice, and if necessary, modifies the custom resource which defines the size of the front-end deployment. This container is launched on a schedule by the application operator

Scripts are provided to automate build and deployment:

  • scripts - Automation to verify workstation prerequisites, build all container images and deploy to a Kubernetes or OpenShift cluster. Alternatively, the scripts can deploy pre-built 'golden' container images.

Check out this 1-minute demo video of the operators
Operator Sample Go Demo 1 min

Documentation

Extended documentation can be found in this repo: https://ibm.github.io/operator-sample-go-documentation/

IBM Build Labs

This project has been created by IBM Build Labs. We provide a service to selected IBM Business Partners (ISVs) looking to automate the operations of their solutions to meet the demands of clients, and open new routes to market using Red Hat OpenShift on any cloud/platform.

Introduction to IBM Build Labs
Unleash the Power of your Applications

Our 40-minute masterclass video provides a useful inroduction to operators and why to use them
Operators Masterclass

Additional Resources

Credits

operator-sample-go's People

Contributors

aairom avatar deleeuwblue avatar dptiwari avatar dptiwari-ibm avatar ibm-open-source-bot avatar imgbotapp avatar nheidloff avatar sundeepbinaylal avatar thomassuedbroecker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

operator-sample-go's Issues

Podman push in Database Operator - Operator deployed without OLM

Issue:
In "Build and push new image" section;
podman push "$REGISTRY/$ORG/$IMAGE_DATABASE_OPERATOR"
occurs;
Error: error pushing image "docker.io/nheidloff/database-operator:v1.0.106": writing blob: initiating layer upload to /v2/nheidloff/database-operator/blobs/uploads/ in registry-1.docker.io: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
Link to the documentation:
https://github.com/IBM/operator-sample-go/blob/main/documentation/DbSetupWithoutOLM.md

Test Case 10 : Application Scaler fails due to missing secrets

Issue:
After setting up the demo environment with the scripts, the Application Scaler cron job is tested with command:

kubectl create job --from=cronjob/application-scaler manuallytriggered -n application-beta

However it fails with this error:

MountVolume.SetUp failed for volume "tokendata" : secret "prometheus-token-secret" not found.

It seems the script did not setup the secret described in the documentation linked below.

FYI, the associated secret prometheus-cert-secret was created successfully.

Link to the documentation:
https://github.com/IBM/operator-sample-go/blob/main/documentation/AppSetupWithOLM.md

Protect credentials in secrets from inadvertent commit

When a user needs to place service credentials (e.g. COS) into a secret like operator-database-backup/kubernetes/secret.yaml a good pattern is to use a template file, like cos-secret.template.yaml and then have the user rename to cos-secret.yaml after adding credentials. By adding cos-secret.yaml to .gitignore, there's less risk of having a commit/push expose the credential.

TestCase 1 related to step 3 - .yaml extension is missing

Issue:

ERROR:
————
While running the below steps:

$ kubectl create namespace database
$ kubectl apply -f config/samples/database.sample_v1alpha1_database.yaml

——>. $ kubectl apply -f config/samples/database.sample_v1alpha1_databasecluster
Got the below error:
Observation: .yaml extension is missing form the file name.
Resolution: Added .yaml extension to my local machine and the file is executed successfully.
Needs to append .yaml in the documentation of GitHub repository.
Warning:
—————
ERROR:
————-
While deploying Operator-application without OLM…
While executing the below command
$ make deploy IMG="$REGISTRY/$ORG/$IMAGE_APPLICATION_OPERATOR"
Observation: Cert-manager is missing.
Even though we are running operator withOut OLM, We need to run the script(Automation) scripts/install-required-kubernetes-components.sh, Which includes the installation of Cert-Manager, OLM,Prometheus.
It could be better to provide mannual commands to install only cert-manager.
Resolution: Ran scripts/install-required-kubernetes-components.sh For now.
After running the script…
It Went to the Infinite loop….

Link to the documentation:

https://github.com/IBM/operator-sample-go/blob/main/documentation/DbSetupWithoutOLM.md

Test Case 10 : Delete everything OpenShift script loops forever

Issue:
While testing test case 10 I used the script delete-everything-openshift.sh. After 2 hours of running, it seems to be stuck in a loop, see logs:

*** Status: openshift-controller-manager-operator
*** Namespace: openshift-controller-manager-operator
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:26 Status: openshift-controller-manager-operator(operator-application.v0.0.1) is deleted

*** Status: openshift-controller-manager
*** Namespace: openshift-controller-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:30 Status: openshift-controller-manager(operator-application.v0.0.1) is deleted

*** Status: openshift-dns-operator
*** Namespace: openshift-dns-operator
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:35 Status: openshift-dns-operator(operator-application.v0.0.1) is deleted

*** Status: openshift-dns
*** Namespace: openshift-dns
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:39 Status: openshift-dns(operator-application.v0.0.1) is deleted

*** Status: openshift-etcd-operator
*** Namespace: openshift-etcd-operator
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:43 Status: openshift-etcd-operator(operator-application.v0.0.1) is deleted

*** Status: cert-manager
*** Namespace: cert-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:47 Status: cert-manager(operator-application.v0.0.1) is deleted

*** Status: calico-system
*** Namespace: calico-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:51 Status: calico-system(operator-application.v0.0.1) is deleted

*** Status: calico-system
*** Namespace: calico-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:35:55 Status: calico-system(operator-application.v0.0.1) is deleted

*** Status: cert-manager
*** Namespace: cert-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:00 Status: cert-manager(operator-application.v0.0.1) is deleted

*** Status: default
*** Namespace: default
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:04 Status: default(operator-application.v0.0.1) is deleted

*** Status: ibm-cert-store
*** Namespace: ibm-cert-store
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:08 Status: ibm-cert-store(operator-application.v0.0.1) is deleted

*** Status: ibm-observe
*** Namespace: ibm-observe
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:12 Status: ibm-observe(operator-application.v0.0.1) is deleted

*** Status: ibm-odf-validation-webhook
*** Namespace: ibm-odf-validation-webhook
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:16 Status: ibm-odf-validation-webhook(operator-application.v0.0.1) is deleted

*** Status: ibm-system
*** Namespace: ibm-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:21 Status: ibm-system(operator-application.v0.0.1) is deleted

*** Status: calico-system
*** Namespace: calico-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:25 Status: calico-system(operator-application.v0.0.1) is deleted

*** Status: cert-manager
*** Namespace: cert-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:29 Status: cert-manager(operator-application.v0.0.1) is deleted

*** Status: default
*** Namespace: default
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:33 Status: default(operator-application.v0.0.1) is deleted

*** Status: ibm-cert-store
*** Namespace: ibm-cert-store
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:37 Status: ibm-cert-store(operator-application.v0.0.1) is deleted

*** Status: ibm-observe
*** Namespace: ibm-observe
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:42 Status: ibm-observe(operator-application.v0.0.1) is deleted

*** Status: ibm-odf-validation-webhook
*** Namespace: ibm-odf-validation-webhook
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:46 Status: ibm-odf-validation-webhook(operator-application.v0.0.1) is deleted

*** Status: ibm-system
*** Namespace: ibm-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:50 Status: ibm-system(operator-application.v0.0.1) is deleted

*** Status: kube-node-lease
*** Namespace: kube-node-lease
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:54 Status: kube-node-lease(operator-application.v0.0.1) is deleted

*** Status: kube-public
*** Namespace: kube-public
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:36:58 Status: kube-public(operator-application.v0.0.1) is deleted

*** Status: kube-system
*** Namespace: kube-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:03 Status: kube-system(operator-application.v0.0.1) is deleted

*** Status: calico-system
*** Namespace: calico-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:07 Status: calico-system(operator-application.v0.0.1) is deleted

*** Status: cert-manager
*** Namespace: cert-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:11 Status: cert-manager(operator-application.v0.0.1) is deleted

*** Status: default
*** Namespace: default
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:16 Status: default(operator-application.v0.0.1) is deleted

*** Status: ibm-cert-store
*** Namespace: ibm-cert-store
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:20 Status: ibm-cert-store(operator-application.v0.0.1) is deleted

*** Status: ibm-observe
*** Namespace: ibm-observe
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:24 Status: ibm-observe(operator-application.v0.0.1) is deleted

*** Status: calico-system
*** Namespace: calico-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:28 Status: calico-system(operator-application.v0.0.1) is deleted

*** Status: cert-manager
*** Namespace: cert-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:32 Status: cert-manager(operator-application.v0.0.1) is deleted

*** Status: default
*** Namespace: default
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:37 Status: default(operator-application.v0.0.1) is deleted

*** Status: ibm-cert-store
*** Namespace: ibm-cert-store
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:41 Status: ibm-cert-store(operator-application.v0.0.1) is deleted

*** Status: ibm-odf-validation-webhook
*** Namespace: ibm-odf-validation-webhook
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:45 Status: ibm-odf-validation-webhook(operator-application.v0.0.1) is deleted

*** Status: ibm-system
*** Namespace: ibm-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:49 Status: ibm-system(operator-application.v0.0.1) is deleted

*** Status: kube-node-lease
*** Namespace: kube-node-lease
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:53 Status: kube-node-lease(operator-application.v0.0.1) is deleted

*** Status: calico-system
*** Namespace: calico-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:37:58 Status: calico-system(operator-application.v0.0.1) is deleted

*** Status: cert-manager
*** Namespace: cert-manager
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:02 Status: cert-manager(operator-application.v0.0.1) is deleted

*** Status: default
*** Namespace: default
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:06 Status: default(operator-application.v0.0.1) is deleted

*** Status: ibm-cert-store
*** Namespace: ibm-cert-store
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:10 Status: ibm-cert-store(operator-application.v0.0.1) is deleted

*** Status: ibm-observe
*** Namespace: ibm-observe
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:14 Status: ibm-observe(operator-application.v0.0.1) is deleted

*** Status: ibm-odf-validation-webhook
*** Namespace: ibm-odf-validation-webhook
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:19 Status: ibm-odf-validation-webhook(operator-application.v0.0.1) is deleted

*** Status: ibm-system
*** Namespace: ibm-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:23 Status: ibm-system(operator-application.v0.0.1) is deleted

*** Status: kube-node-lease
*** Namespace: kube-node-lease
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:27 Status: kube-node-lease(operator-application.v0.0.1) is deleted

*** Status: kube-public
*** Namespace: kube-public
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:32 Status: kube-public(operator-application.v0.0.1) is deleted

*** Status: kube-system
*** Namespace: kube-system
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:36 Status: kube-system(operator-application.v0.0.1) is deleted

*** Status: openshift-apiserver-operator
*** Namespace: openshift-apiserver-operator
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:41 Status: openshift-apiserver-operator(operator-application.v0.0.1) is deleted

*** Status: openshift-apiserver
*** Namespace: openshift-apiserver
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:45 Status: openshift-apiserver(operator-application.v0.0.1) is deleted

*** Status: openshift-authentication-operator
*** Namespace: openshift-authentication-operator
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:50 Status: openshift-authentication-operator(operator-application.v0.0.1) is deleted

*** Status: openshift-authentication
*** Namespace: openshift-authentication
*** Find: operator-application.v0.0.1
*** Status check: operator-application.v0.0.1
clusterserviceversion.operators.coreos.com "operator-application.v0.0.1" deleted
2022-06-10 13:38:54 Status: openshift-authentication(operator-application.v0.0.1) is deleted

Link to the documentation:

Test Case 07 : Automated CI install on IKS fails

Issue:
I set up a fresh IKS cluster on VPC.

I ran command:
sh scripts/ci-create-operators-kubernetes.sh database local reset

After a long time, the script looped on this message:


Status: Running
Running
2022-06-29 09:53:10 Status: operator-database-catalog(Running
Running)

Status: Running
Running
2022-06-29 09:53:14 Status: operator-database-catalog(Running
Running)

Status: Running
Running
2022-06-29 09:53:18 Status: operator-database-catalog(Running
Running)

There are lots of unusual pods in the operators namespace:

deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % kubectl get pods -n operators
NAME READY STATUS RESTARTS AGE
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb022n7j 0/1 Error 8 (5m14s ago) 19m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb0259fs 0/1 CrashLoopBackOff 9 (15s ago) 21m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb027v52 0/1 CrashLoopBackOff 8 (4m57s ago) 20m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02bqcr 0/1 Pending 0 10m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02cclp 0/1 Pending 0 4m14s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02dr77 0/1 Pending 0 6m19s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02h4d6 0/1 CrashLoopBackOff 8 (5m7s ago) 21m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02klbn 0/1 Pending 0 15m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02ldvp 0/1 Pending 0 5m34s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02mdq5 0/1 Pending 0 7m46s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02q5lz 0/1 CrashLoopBackOff 8 (36s ago) 18m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02t988 0/1 Pending 0 42s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02wjnm 0/1 Pending 0 56s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02wlsf 0/1 CrashLoopBackOff 8 (45s ago) 19m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02xf97 0/1 CrashLoopBackOff 7 (3m7s ago) 16m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb02zbv7 0/1 CrashLoopBackOff 7 (5m2s ago) 19m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb042lhm 0/1 Pending 0 8m6s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb045jst 0/1 CrashLoopBackOff 9 (61s ago) 22m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb045np7 0/1 Pending 0 14m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04bdjw 0/1 Pending 0 14m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04c2tw 0/1 CrashLoopBackOff 7 (4m38s ago) 18m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04d5zd 0/1 CrashLoopBackOff 9 (2m14s ago) 23m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04flxq 0/1 CrashLoopBackOff 8 (2m15s ago) 20m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04gmpz 0/1 CrashLoopBackOff 9 (42s ago) 21m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04gqlj 0/1 CrashLoopBackOff 7 (3m11s ago) 17m
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04gxmp 0/1 Pending 0 7m51s
775262e743cf8e28ee6c636a5acc820383ab64ca1201f7d87078bc5fb04hltg 0/1 CrashLoopBackOff 9 (15s ago) 21m
...
...
...
I truncated the output of the command as it was too long for this issue. There are actually 500+ pods running in the operators namespace
...
...
...
operator-database-catalog-6vw8c 1/1 Running 0 24m
operator-database-catalog-vgksd 1/1 Running 0 24m

Deployment to ROKS on classic does not work

Issue:
The database operator does not work for classic because it has a hardcoded storage class of "ibmc-vpc-block-5iops-tier". Actually, if you don't specify a storage class in the StatefulSet, a default is used by IBM Cloud, meaning the operator will work correctly in both VPC and classic.

This also makes it easier to deploy to a tech zone environment, which has a suitable environments for classic but not VPC.

Installation hang during the automated setup kubernetes

Issue:

The script ci-create-operators-kubernetes.sh app ci reset podman_reset

10 mins later:
Status:
2022-06-01 08:41:29 Status: installplans()
------------------------------------------------------------------------
Status:
2022-06-01 08:41:33 Status: installplans()

Link to the documentation and scripts:

Test Case 02- Error while executing Build and Publish new catalog image steps-DbOperator with OLM

Issue:
Error while executing Build and Publish new catalog image steps-DbOperator with OLM

sundeepbinaylalgolla@Sundeeps-MacBook-Pro operator-database % source ../versions_local.env
sundeepbinaylalgolla@Sundeeps-MacBook-Pro operator-database % ./bin/opm index add --build-tool podman --mode semver --tag "$REGISTRY/$ORG/$IMAGE_DATABASE_OPERATOR_CATALOG" --bundles "$REGISTRY/$ORG/$IMAGE_DATABASE_OPERATOR_BUNDLE"
zsh: no such file or directory: ./bin/opm

Link to the documentation:
https://github.com/IBM/operator-sample-go/blob/main/documentation/DbSetupWithOLM.md

database operator is not installed

sh scripts/ci-create-operators-openshift.sh app ci reset podman_reset

No resources found in openshift-operators namespace.
Status:
2022-05-31 10:11:26 Status: installplans()

delete-everything-openshift.sh does not delete Application Operator

Issue:
The script runs to completion but the Application operator and CRD remain.

Log file:

pw%
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go % pwd
/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go % cd operator-database
oc apply -f config/samples/database.sample_v1alpha1_databasecluster.yaml
Warning: oc apply should be used on resource created by either oc create --save-config or oc apply
namespace/database configured
Warning: oc apply should be used on resource created by either oc create --save-config or oc apply
databasecluster.database.sample.third.party/databasecluster-sample configured
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % kubectl create job --from=cronjob/application-scaler manuallytriggered -n application-beta
job.batch/manuallytriggered created
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % pwd
/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/operator-database
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % cd ..
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go % sh scripts/delete-everything-openshift.sh


Init logfile delete-all-openshift.log



Delete prometheus configuration


clusterrole.rbac.authorization.k8s.io "prometheus-k8s-role" deleted
clusterrolebinding.rbac.authorization.k8s.io "prometheus-k8s-rolebinding-olm" deleted
clusterrole.rbac.authorization.k8s.io "application-scaler-role" deleted
clusterrolebinding.rbac.authorization.k8s.io "application-scaler-rolebinding" deleted
*** delete secrets
warning: --force is ignored because --grace-period is not 0.
secret "prometheus-token-secret" deleted
warning: --force is ignored because --grace-period is not 0.
secret "prometheus-cert-secret" deleted
Error from server (NotFound): secrets "prometheus-token-secret" not found
Error from server (NotFound): secrets "prometheus-cert-secret" not found


Delete for ci configuration



Delete microservice application (ci)


namespace "application-beta" deleted
application.application.sample.ibm.com "application" deleted
namespace "application-alpha" deleted
Error from server (NotFound): error when deleting "config/samples/application.sample_v1alpha1_application.yaml": applications.application.sample.ibm.com "application" not found
No resources found in application-beta namespace.
No resources found in application-alpha namespace.
No resources found in application-beta namespace.
No resources found in application-alpha namespace.


Delete database instance (ci)


*** delete database instances
database.database.sample.third.party "database" deleted
Error from server (NotFound): error when deleting "config/samples/database.sample_v1alpha1_databasebackup.yaml": databasebackups.database.sample.third.party "databasebackup-manual" not found
namespace "database" deleted
databasecluster.database.sample.third.party "databasecluster-sample" deleted
Error from server (NotFound): namespaces "database" not found


Delete database operator (ci)


*** delete subcription and catalogsource
error: the path "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml" does not exist
error: the path "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml" does not exist
*** delete customresourcedefinition
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
customresourcedefinition.apiextensions.k8s.io "databasebackups.database.sample.third.party" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
customresourcedefinition.apiextensions.k8s.io "databases.database.sample.third.party" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
customresourcedefinition.apiextensions.k8s.io "databaseclusters.database.sample.third.party" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
operator.operators.coreos.com "operator-database.openshift-operators" force deleted
*** delete deployment in namespace: openshift-operators
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
deployment.apps "operator-database-controller-manager" force deleted
*** delete deployment
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
clusterrole.rbac.authorization.k8s.io "operator-database-metrics-reader" force deleted


Delete OLM deployments (ci)


subscription.operators.coreos.com "operator-application-v0-0-1-sub" deleted
catalogsource.operators.coreos.com "operator-application-catalog" deleted
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h17m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h17m
openshift-marketplace operator-database-catalog IBM Build Labs Database Catalog grpc IBM Build Labs 4h33m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h17m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h17m
NAMESPACE NAME PACKAGE SOURCE CHANNEL
openshift-operators operator-database-v0-0-1-sub operator-database operator-database-catalog alpha
*** delete subscription and catalogsource application
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): subscriptions.operators.coreos.com "operator-application-v0-0-1-sub" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): catalogsources.operators.coreos.com "operator-application-catalog" not found
Error: unknown shorthand flag: 'a' in -all-namespaces

Usage:
oc get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]

Examples:

List all pods in ps output format.

oc get pods

List all pods in ps output format with more information (such as node name).

oc get pods -o wide

List a single replication controller with specified NAME in ps output format.

oc get replicationcontroller web

List deployments in JSON output format, in the "v1" version of the "apps" API group:

oc get deployments.v1.apps -o json

List a single pod in JSON output format.

oc get -o json pod web-pod-13je7

List a pod identified by type and name specified in "pod.yaml" in JSON output format.

oc get -f pod.yaml -o json

List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.

oc get -k dir/

Return only the phase value of the specified pod.

oc get -o template pod/web-pod-13je7 --template={{.status.phase}}

List resource information in custom columns.

oc get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image

List all replication controllers and services together in ps output format.

oc get rc,services

List one or more resources by their type and names.

oc get rc/web service/frontend pods/web-pod-13je7

Options:
-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.
--ignore-not-found=false: If the requested object does not exist the command will return exit code 0.
-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.
-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).
-o, --output='': Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
--raw='': Raw URI to request from the server. Uses the transport specified by the kubeconfig file.
-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
--server-print=true: If true, have the server return the appropriate table output. Supports extension APIs and CRDs.
--show-kind=false: If present, list the resource type for the requested object(s).
--show-labels=false: When printing, show all labels as the last column (default hide labels column)
--sort-by='': If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
--template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
-w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
--watch-only=false: Watch for changes to the requested object(s), without listing/getting first.

Use "oc options" for a list of global command-line options (applies to all commands).

grep: openshift-marketplace: No such file or directory
*** delete subscription and catalogsource database
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
subscription.operators.coreos.com "operator-database-v0-0-1-sub" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
catalogsource.operators.coreos.com "operator-database-catalog" force deleted
No resources found.
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h17m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h17m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h17m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h17m
*** delete clusterserviceversion database
warning: --force is ignored because --grace-period is not 0.
clusterserviceversion.operators.coreos.com "operator-database.v0.0.1" deleted
grep: openshift-operators: No such file or directory
*** delete cluster service versions


Check operator-database.v0.0.1
*** Status:
2022-06-13 15:17:26 Status: operator-database.v0.0.1 is deleted

*** delete subscription and catalogsource database
Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml": subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml": catalogsources.operators.coreos.com "operator-database-catalog" not found
No resources found in openshift-operators namespace.
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc Red Hat 6h18m
community-operators Community Operators grpc Red Hat 6h18m
redhat-marketplace Red Hat Marketplace grpc Red Hat 6h18m
redhat-operators Red Hat Operators grpc Red Hat 6h18m
*** delete clusterserviceversion database
error: the path "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/bundle/manifests/operator-database.clusterserviceversion.yaml" does not exist
Error from server (NotFound): namespaces "application-beta" not found


Delete namespaces related to application operator (ci)


*** delete project application
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-alpha" not found
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-beta" not found


Check application-alpha
Error from server (NotFound): namespaces "application-alpha" not found
Status:
2022-06-13 15:17:32 Status: application-alpha is deleted


Check application-beta
Error from server (NotFound): namespaces "application-beta" not found
Status:
2022-06-13 15:17:33 Status: application-beta is deleted


Delete database application (ci)


*** delete project database
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "database" not found


Check database
Error from server (NotFound): namespaces "database" not found
Status:
2022-06-13 15:17:35 Status: database is deleted


Delete for local configuration



Delete microservice application (local)


Error from server (NotFound): error when deleting "config/samples/application.sample_v1beta1_application.yaml": namespaces "application-beta" not found
Error from server (NotFound): error when deleting "config/samples/application.sample_v1beta1_application.yaml": applications.application.sample.ibm.com "application" not found
Error from server (NotFound): error when deleting "config/samples/application.sample_v1alpha1_application.yaml": namespaces "application-alpha" not found
Error from server (NotFound): error when deleting "config/samples/application.sample_v1alpha1_application.yaml": applications.application.sample.ibm.com "application" not found
No resources found in application-beta namespace.
No resources found in application-alpha namespace.
No resources found in application-beta namespace.
No resources found in application-alpha namespace.


Delete database instance (local)


*** delete database instances
error: unable to recognize "config/samples/database.sample_v1alpha1_database.yaml": no matches for kind "Database" in version "database.sample.third.party/v1alpha1"
error: unable to recognize "config/samples/database.sample_v1alpha1_databasebackup.yaml": no matches for kind "DatabaseBackup" in version "database.sample.third.party/v1alpha1"
Error from server (NotFound): error when deleting "config/samples/database.sample_v1alpha1_databasecluster.yaml": namespaces "database" not found
unable to recognize "config/samples/database.sample_v1alpha1_databasecluster.yaml": no matches for kind "DatabaseCluster" in version "database.sample.third.party/v1alpha1"
error: the server doesn't have a resource type "databasecluster"


Delete database operator (local)


*** delete subcription and catalogsource
Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml": subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
error: the path "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml" does not exist
*** delete customresourcedefinition
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "databasebackups.database.sample.third.party" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "databases.database.sample.third.party" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "databaseclusters.database.sample.third.party" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
operator.operators.coreos.com "operator-database.openshift-operators" force deleted
*** delete deployment in namespace: openshift-operators
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): deployments.apps "operator-database-controller-manager" not found
*** delete deployment
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): clusterroles.rbac.authorization.k8s.io "operator-database-metrics-reader" not found


Delete OLM deployments (local)


Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-application-subscription.yaml": subscriptions.operators.coreos.com "operator-application-v0-0-1-sub" not found
Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-application-catalogsource.yaml": catalogsources.operators.coreos.com "operator-application-catalog" not found
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h18m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h18m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h18m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h18m
No resources found.
*** delete subscription and catalogsource application
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): subscriptions.operators.coreos.com "operator-application-v0-0-1-sub" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): catalogsources.operators.coreos.com "operator-application-catalog" not found
Error: unknown shorthand flag: 'a' in -all-namespaces

Usage:
oc get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]

Examples:

List all pods in ps output format.

oc get pods

List all pods in ps output format with more information (such as node name).

oc get pods -o wide

List a single replication controller with specified NAME in ps output format.

oc get replicationcontroller web

List deployments in JSON output format, in the "v1" version of the "apps" API group:

oc get deployments.v1.apps -o json

List a single pod in JSON output format.

oc get -o json pod web-pod-13je7

List a pod identified by type and name specified in "pod.yaml" in JSON output format.

oc get -f pod.yaml -o json

List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.

oc get -k dir/

Return only the phase value of the specified pod.

oc get -o template pod/web-pod-13je7 --template={{.status.phase}}

List resource information in custom columns.

oc get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image

List all replication controllers and services together in ps output format.

oc get rc,services

List one or more resources by their type and names.

oc get rc/web service/frontend pods/web-pod-13je7

Options:
-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.
--ignore-not-found=false: If the requested object does not exist the command will return exit code 0.
-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.
-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).
-o, --output='': Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
--raw='': Raw URI to request from the server. Uses the transport specified by the kubeconfig file.
-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
--server-print=true: If true, have the server return the appropriate table output. Supports extension APIs and CRDs.
--show-kind=false: If present, list the resource type for the requested object(s).
--show-labels=false: When printing, show all labels as the last column (default hide labels column)
--sort-by='': If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
--template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
-w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
--watch-only=false: Watch for changes to the requested object(s), without listing/getting first.

Use "oc options" for a list of global command-line options (applies to all commands).

grep: openshift-marketplace: No such file or directory
*** delete subscription and catalogsource database
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): catalogsources.operators.coreos.com "operator-database-catalog" not found
No resources found.
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h19m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h19m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h19m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h19m
*** delete clusterserviceversion database
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): clusterserviceversions.operators.coreos.com "operator-database.v0.0.1" not found
grep: openshift-operators: No such file or directory
*** delete cluster service versions


Check operator-database.v0.0.1
*** Status:
2022-06-13 15:18:35 Status: operator-database.v0.0.1 is deleted

*** delete subscription and catalogsource database
Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml": subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
Error from server (NotFound): error when deleting "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml": catalogsources.operators.coreos.com "operator-database-catalog" not found
No resources found in openshift-operators namespace.
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc Red Hat 6h19m
community-operators Community Operators grpc Red Hat 6h19m
redhat-marketplace Red Hat Marketplace grpc Red Hat 6h19m
redhat-operators Red Hat Operators grpc Red Hat 6h19m
*** delete clusterserviceversion database
error: the path "/Users/[email protected]/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/bundle/manifests/operator-database.clusterserviceversion.yaml" does not exist
Error from server (NotFound): namespaces "application-beta" not found


Delete namespaces related to application operator (local)


*** delete project application
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-alpha" not found
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-beta" not found


Check application-alpha
Error from server (NotFound): namespaces "application-alpha" not found
Status:
2022-06-13 15:18:41 Status: application-alpha is deleted


Check application-beta
Error from server (NotFound): namespaces "application-beta" not found
Status:
2022-06-13 15:18:42 Status: application-beta is deleted


Delete database application (local)


*** delete project database
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "database" not found


Check database
Error from server (NotFound): namespaces "database" not found
Status:
2022-06-13 15:18:44 Status: database is deleted


Delete cert manager


customresourcedefinition.apiextensions.k8s.io "certificaterequests.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "certificates.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "challenges.acme.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "clusterissuers.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "issuers.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "orders.acme.cert-manager.io" deleted
namespace "cert-manager" deleted
serviceaccount "cert-manager-cainjector" deleted
serviceaccount "cert-manager" deleted
serviceaccount "cert-manager-webhook" deleted
configmap "cert-manager-webhook" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-cainjector" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-issuers" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-clusterissuers" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-certificates" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-orders" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-challenges" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-ingress-shim" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-view" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-edit" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-approve:cert-manager-io" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-certificatesigningrequests" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-webhook:subjectaccessreviews" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-cainjector" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-issuers" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-clusterissuers" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-certificates" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-orders" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-challenges" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-ingress-shim" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-approve:cert-manager-io" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-certificatesigningrequests" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-webhook:subjectaccessreviews" deleted
role.rbac.authorization.k8s.io "cert-manager-cainjector:leaderelection" deleted
role.rbac.authorization.k8s.io "cert-manager:leaderelection" deleted
role.rbac.authorization.k8s.io "cert-manager-webhook:dynamic-serving" deleted
rolebinding.rbac.authorization.k8s.io "cert-manager-cainjector:leaderelection" deleted
rolebinding.rbac.authorization.k8s.io "cert-manager:leaderelection" deleted
rolebinding.rbac.authorization.k8s.io "cert-manager-webhook:dynamic-serving" deleted
service "cert-manager" deleted
service "cert-manager-webhook" deleted
deployment.apps "cert-manager-cainjector" deleted
deployment.apps "cert-manager" deleted
deployment.apps "cert-manager-webhook" deleted
mutatingwebhookconfiguration.admissionregistration.k8s.io "cert-manager-webhook" deleted
validatingwebhookconfiguration.admissionregistration.k8s.io "cert-manager-webhook" deleted


Check cert-manager
Error from server (NotFound): namespaces "cert-manager" not found
Status:
2022-06-13 15:19:11 Status: cert-manager is deleted


All delete commands were executed


deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go %

Link to the documentation:

TestCase 10 : delete-everything-openshift does not delete Prometheus secrets

Issue:
The script code for deleting these secrets is not correct:

prometheus-token-secret
prometheus-cert-secret

The script does this:

oc delete --force secret prometheus-token-secret -n openshift-operators
oc delete --force secret prometheus-token-secret -n application-beta
oc get secret prometheus-token-secret -n openshift-operators
oc get secret prometheus-token-secret -n application-beta

but it should do something like this:

oc delete --force secret prometheus-cert-secret -n application-beta
oc delete --force secret prometheus-token-secret -n application-beta
oc get secret prometheus-cert-secret -n application-beta
oc get secret prometheus-token-secret -n application-beta

Link to the documentation:

Test Case 02 - Running Application Operator Locally

Getting issue while running Application Operator Locally:-

make install run ENABLE_WEBHOOKS=false

getting following after few seconds:-

INFO    Stopping and waiting for non leader election runnables
1.6539787910293398e+09  INFO    Stopping and waiting for leader election runnables
1.653978791029361e+09   INFO    Stopping and waiting for caches
1.653978791029579e+09   INFO    Stopping and waiting for webhooks
1.6539787910296168e+09  INFO    Wait completed, proceeding to shutdown the manager
1.653978791029632e+09   ERROR   setup   problem running manager {"error": "failed to wait for application caches to sync: timed out waiting for cache to be synced"}
main.main
        /Users/diwakartiwari/ibm/operator-sample-go/operator-application/main.go:95
runtime.main
        /usr/local/go/src/runtime/proc.go:255
exit status 1
make: *** [run] Error 1

Expected
it should continuously run and following should be able to run

kubectl get applications.application.sample.ibm.com/application -n application-beta -oyaml
kubectl exec -n application-beta $(kubectl get pods -n application-beta | awk '/application-deployment-microservice/ {print $1;exit}') --container application-microservice -- curl -s http://localhost:8081/hello

Test case 01- Infinite loop running on install-everything-on-k8s-script.sh

Issue:
Infinite loop running on install-everything-on-k8s-script.sh

Below is the error..!!


Check catalog-operator
Status: Running
2022-05-31 13:33:01 Status: catalog-operator is Ready


Check olm-operator
Status: Running
2022-05-31 13:33:05 Status: olm-operator is Ready


Check operatorhubio-catalog
Status: Running
Running
2022-05-31 13:33:06 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:11 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:15 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:19 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:24 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:28 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:33 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:37 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:41 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:46 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:50 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:55 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:33:59 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:03 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:08 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:12 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:17 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:21 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:25 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:30 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:34 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:38 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:43 Status: operatorhubio-catalog(Running
Running)

Status: Running
Running
2022-05-31 13:34:47 Status: operatorhubio-catalog(Running
Running)

Link to the documentation:

https://github.com/IBM/operator-sample-go/blob/main/documentation/Prerequisites.md

Test Case 10 : DatabaseBackup yaml has incorrect cron frequency

Issue:
The sample DatabaseBackup CR specifies a cron job schedule of "*/3 * * * *" which is every 3 minutes. This is too frequent and ends up filling the COS instance with many buckets which makes it hard to navigate or delete. The frequency should be once per day.

The golden version of this file should be updated:
https://github.com/IBM/operator-sample-go/blob/main/operator-database/config/samples/database.sample_v1alpha1_databasebackup.yaml

This requires changing the associated template.

Link to the documentation:

Application Operator - Operator deployed without OLM in OpenShift

Issue:
In "Build and push new image" step;
podman push "$REGISTRY/$ORG/$IMAGE_APPLICATION_OPERATOR"
Results;
Error: error pushing image "docker.io/nheidloff/application-operator:v1.0.106": writing blob: initiating layer upload to /v2/nheidloff/application-operator/blobs/uploads/ in registry-1.docker.io: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

Link to the documentation:
https://github.com/IBM/operator-sample-go/issues/new?assignees=&labels=test_manual&template=issue-during-test.md&title=

Test case 10 : Catalog sources have incorrect namespace scope

Issue:
After running the script sh scripts/demo-openshift-operators.sh app demo reset, new Catalog sources are successfully created for the Application and Database operators. However, these Catalog sources can only be seen when in namespace OpenShift-operators. Every other Catalog source has "cluster wide" scope, and our Catalogs should be the same.

See menu Administration->Cluster Settings->OperatorHub

Link to the documentation:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.