Code Monkey home page Code Monkey logo

operand-deployment-lifecycle-manager's Introduction

Docker Repository on Quay License Go Report Card

Operand Deployment Lifecycle Manager (ODLM)

Overview

Note: Documents in this repo are in active development. For the official documentation, see IBM Knowledge Center.

Operand Deployment Lifecycle Manager is used to manage the lifecycle of a group of operands. Check the design document here.

Operand Deployment Lifecycle Manager has four CRDs:

Resource Short Name Description
OperandRequest opreq It defines which operator/operand want to be installed in the cluster
OperandRegistry opreg It defines the OLM information, like channel and catalog source, for each operator
OperandConfig opcon It defines the parameters that should be used to install the operator's operand
OperandBindInfo opbi It identifies secrets and/or configmaps that should be shared with requests

Supported platforms

You can install the Operand Deployment Lifecycle Manager on Linux® x86_64 with Red Hat® OpenShift® Container Platform version 4.3+.

Prerequisites

  • operator-sdk version v1.3.0.
  • go version 1.15.7+
  • oc version v3.11+ or kubectl v1.11.3+
  • Access to an Openshift v4.3+ cluster

Documentation

Developer guide

Cloning the repository

Checkout this Operand Deployment Lifecycle Manager repository

# git clone https://github.com/IBM/operand-deployment-lifecycle-manager.git
# cd operand-deployment-lifecycle-manager

Building the operator

Build the odlm image and push it to a public registry, such as quay.io:

# make build
# make images

Installing

Run make install to install the operator. Check that the operator is running in the cluster, also check that the common service was deployed.

Following the expected result.

# kubectl get all -n ibm-common-services
NAME                                           READY   STATUS    RESTARTS   AGE
pod/operand-deployment-lifecycle-manager-786d699956-z7k4n   1/1     Running   0          21s

NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/operand-deployment-lifecycle-manager   1/1     1            1           22s

NAME                                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/operand-deployment-lifecycle-manager-786d699956   1         1         1       22s

Uninstalling

To uninstall all that was performed in the above step run make uninstall.

Troubleshooting

Use the following command to check the operator logs.

# kubectl logs deployment.apps/operand-deployment-lifecycle-manager -n ibm-common-services

Running Tests

Development

When the API or CRD changed, run make code-dev re-generate the code.

SecurityContextConstraints Requirements

The Operand Deployment Lifecycle Manager supports running under the OpenShift Container Platform default restricted security context constraints.

operand-deployment-lifecycle-manager's People

Contributors

adamdyszy avatar ashank07 avatar bitscuit avatar bluzarraga avatar cdjohnson avatar chenzhiwei avatar daniel-fan avatar dependabot[bot] avatar dian-xh avatar dongyingbo avatar ericabr avatar gyliu513 avatar hbradfield avatar hchenxa avatar hmtai avatar horis233 avatar ibm-ci-bot avatar imgbot[bot] avatar jinchun-dev avatar liqlin2015 avatar nemivant avatar qpdpq avatar rcsherro avatar sgrube avatar snehahegde7 avatar stevemar avatar taosha121 avatar ycshen1010 avatar zhuoxili avatar znhafeez 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

operand-deployment-lifecycle-manager's Issues

When the operator is deleted, they are not removed from status

/kind bug

What steps did you take and what happened:
[A clear and concise description of what the bug is.]

When I set an operator to the absent state, after it is deleted, I found it's still in the member list of the status.

apiVersion: operator.ibm.com/v1alpha1
kind: OperandRequest
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"operator.ibm.com/v1alpha1","kind":"OperandRequest","metadata":{"annotations":{},"name":"common-service","namespace":"ibm-common-services"},"spec":{"services":[{"name":"ibm-cert-manager-operator","state":"present"},{"name":"ibm-mongodb-operator","state":"present"},{"name":"ibm-iam-operator","state":"present"},{"name":"ibm-management-ingress-operator","state":"absent"},{"name":"ibm-ingress-nginx-operator","state":"absent"},{"name":"ibm-metering-operator","state":"absent"},{"name":"ibm-licensing-operator","state":"absent"},{"name":"ibm-commonui-operator","state":"absent"},{"name":"ibm-healthcheck-operator","state":"present"},{"name":"ibm-auditlogging-operator","state":"absent"},{"name":"ibm-catalog-operator","state":"absent"},{"name":"ibm-platform-api-operator","state":"absent"}]}}
  selfLink: >-
    /apis/operator.ibm.com/v1alpha1/namespaces/ibm-common-services/operandrequests/common-service
  resourceVersion: '9623622'
  name: common-service
  uid: 5cfb4833-5a8a-11ea-8270-0aa228443300
  creationTimestamp: '2020-02-29T00:28:10Z'
  generation: 3
  namespace: ibm-common-services
  finalizers:
    - finalizer.request.ibm.com
spec:
  services:
    - name: ibm-cert-manager-operator
      state: absent
    - name: ibm-mongodb-operator
      state: present
    - name: ibm-iam-operator
      state: absent
    - name: ibm-management-ingress-operator
      state: absent
    - name: ibm-ingress-nginx-operator
      state: absent
    - name: ibm-metering-operator
      state: absent
    - name: ibm-licensing-operator
      state: absent
    - name: ibm-commonui-operator
      state: absent
    - name: ibm-healthcheck-operator
      state: present
    - name: ibm-auditlogging-operator
      state: absent
    - name: ibm-catalog-operator
      state: absent
    - name: ibm-platform-api-operator
      state: absent
status:
  conditions:
    - lastTransitionTime: '2020-02-28T19:31:04-05:00'
      lastUpdateTime: '2020-02-28T19:31:04-05:00'
      message: Creating subscription ibm-cert-manager-operator
      reason: Creating subscription
      status: 'True'
      type: Creating
    - lastTransitionTime: '2020-02-28T19:31:04-05:00'
      lastUpdateTime: '2020-02-28T19:31:04-05:00'
      message: Creating subscription ibm-healthcheck-operator
      reason: Creating subscription
      status: 'True'
      type: Creating
    - lastTransitionTime: '2020-02-28T19:31:04-05:00'
      lastUpdateTime: '2020-02-28T19:31:04-05:00'
      message: Creating subscription ibm-mongodb-operator
      reason: Creating subscription
      status: 'True'
      type: Creating
    - lastTransitionTime: '2020-02-28T19:31:05-05:00'
      lastUpdateTime: '2020-02-28T19:31:05-05:00'
      message: Creating subscription ibm-iam-operator
      reason: Creating subscription
      status: 'True'
      type: Creating
    - lastTransitionTime: '2020-02-28T19:37:49-05:00'
      lastUpdateTime: '2020-02-28T19:37:49-05:00'
      message: Deleting subscription ibm-cert-manager-operator
      reason: Deleting subscription
      status: 'True'
      type: Deleting
    - lastTransitionTime: '2020-02-28T19:37:50-05:00'
      lastUpdateTime: '2020-02-28T19:37:50-05:00'
      message: Deleting csv ibm-cert-manager-operator.v3.7.0
      reason: Deleting csv
      status: 'True'
      type: Deleting
    - lastTransitionTime: '2020-02-28T19:40:49-05:00'
      lastUpdateTime: '2020-02-28T19:40:49-05:00'
      message: Deleting subscription ibm-iam-operator
      reason: Deleting subscription
      status: 'True'
      type: Deleting
    - lastTransitionTime: '2020-02-28T19:40:50-05:00'
      lastUpdateTime: '2020-02-28T19:40:50-05:00'
      message: Deleting csv ibm-iam-operator.v3.5.0
      reason: Deleting csv
      status: 'True'
      type: Deleting
  members:
    - name: ibm-cert-manager-operator
      phase:
        operatorPhase: Succeeded
    - name: ibm-healthcheck-operator
      phase:
        operatorPhase: Succeeded
    - name: ibm-iam-operator
      phase:
        operatorPhase: Installing
    - name: ibm-mongodb-operator
      phase:
        operatorPhase: Succeeded
  phase: Creating

@DanielXLee

What did you expect to happen:

The deleted operator can be removed from the status.members and status.phase can be updated.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • ODLM version: 0.0.1
  • Minikube/KIND/OCP version: OCP 4.2
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Rename some CRDs

Considering we want to make the common service operator as a generic meta operator, so we may need to change the CRD name a bit to make it more generic.

Here are some of my thinking:

  • MetaOperator->MetaOperatorCatalog
  • CommonServiceConfig->MetaOperatorConfig
  • CommonServiceSet->MetaOperatorSet

Please propose your comments here before we go forward.

FYI @chenzhiwei @horis233 @shikhasriva

Set some fields as optional for ODLM CRDs

/kind bug

An example as follows:

// Tolerations are the pod's tolerations.
// +optional <<<
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

FYI @IBM/odlm-maintainers

pass operator-courier verify

https://github.com/operator-framework/operator-courier

Create your Operator Bundle, this is the tgz file you will be uploading to the operator certification portal (see operator-metadata for bundle definition).
This will package up your CSV's/CRD's package manifest
Note: Your zip file should NOT include subdirectories, courier expects this path to contain only the required yaml files.

operator-courier verify --ui_validate_io <path_to_metadata_bundle zip file>

Adding OperandBindInfo

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

The Operand BindInfo CR identifies a secret and/or configmap information from a deployed operand that should be shared with those creating OperandRequests CRs for the operand. This information is used to interact with the deployed operand.

An example of the Operand BindInfo CR is below:

apiVersion: odlm.ibm.com/v1alpha1
kind: OperandBindInfo
metadata:
  name: publiciambinding
spec:
  operand: iam
  registry: comon-services
  description: "Binding information that should be accessible to IAM adopters"
  bindings:
  - scope: public
    secret: iambindsecret
    configmap: iamconfigmap

The parameters are described below:

  • operand: specifies the name of the operand from the OperandRegistry in the same namespace as the
  • bindings: specify the names of public and private secrets and configmaps that contain information that should be shared with requestor who want to interact with the operand. An OperandBindInfo CR can have at MOST one public scoped binding and one private scope binding. Private binding information is only shared between operands in the same namespace.
  • secret: specifies that name of a secret that contains information that should be shared with a requestor.
  • configmap: specifies that name of a configmap contains information that should be shared with requestors.

allow OperandRequest from other namespace

/kind feature

Describe the solution you'd like
When users create an OperandRequest from other namespace and point to the OperandRegistry, then ODLM should install the requested operators.

Enhance operand request member status

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Update metaOperatorCatalog

@DanielXLee
Currently, we only update the subscription when the channel changes.
https://github.com/IBM/meta-operator/blob/master/pkg/controller/metaoperatorset/reconcile_metaoperatorcatalog.go#L57

Do we need to reconcile metaOperatorCatalog when Package CatalogSource and CatalogSourceNamespace change?

if a user makes a typo on the value CatalogSource in the metaOperatorConfig, he can't correct it by update metaOperatorCatalog. He has to manually delete the hanging subscription before he corrects the metaOperatorCatalog.

remove state in OperandRequest

/kind feature

Describe the solution you'd like

Per the design, when users set a service in the OperanRequest, the ODLM should install the service and its dependencies.

This also needs all the services to add the required section in their CSV with the dependencies.

Add default value for operandrequest scope

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Build operator registry image failed on OCP3.11

/kind bug

What steps did you take and what happened:
[A clear and concise description of what the bug is.]
Following the install doc https://github.com/IBM/operand-deployment-lifecycle-manager/blob/master/docs/install/install.md to run ODLM on ocp3.11
On step 1, hit below such error:

[ec2-user@suited-goldfish-ocp-master deploy]$ sudo docker build -t quay.io/opencloudio/operator-registry -f operator-registry.Dockerfile .
Sending build context to Docker daemon  72.7 kB
Step 1/10 : FROM quay.io/operator-framework/upstream-registry-builder as builder
Error parsing reference: "quay.io/operator-framework/upstream-registry-builder as builder" is not a valid repository/tag: invalid reference format

so skip step 1, continue to run step2, seem the quay.io/opencloudio/operator-registry:latest is too old.

[ec2-user@suited-goldfish-ocp-master ~]$ oc get CatalogSource -n olm
NAME                    DISPLAY               TYPE      PUBLISHER        AGE
opencloud-operators                           grpc                       3m
operatorhubio-catalog   Community Operators   grpc      OperatorHub.io   6m

[ec2-user@suited-goldfish-ocp-master ~]$ oc get packagemanifest -l catalog=opencloud-operators
NAME                CATALOG   AGE
meta-operator-app             4m45s
[ec2-user@suited-goldfish-ocp-master ~]$

What did you expect to happen:
Can be running ODLM on ocp3.11
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • ODLM version:
  • Minikube/KIND/OCP version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Check subscription if used by other when delete it

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Rename CRD and project repo

meta-operator -> operand-deployment-lifecycle-managent
MetaOperatorCatalog -> OperandRegistry
MetaOperatorConfig -> OperandConfigs
MetaOperatorSet -> OperandRequests

Migrate to klog

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

We should use klog to mange the log of odlm to align with k8s eco-system.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

FYI @IBM/odlm-maintainers

can't uninstall common services when uninstall meta-operator

Install meta-operator on OCP4.2 then uninstall it.

[root@knolls-inf common-svcs-sert-tests]# oc get sub meta-operator-app -n yhliu
NAME                PACKAGE             SOURCE                CHANNEL
meta-operator-app   meta-operator-app   opencloud-operators   alpha
[root@knolls-inf common-svcs-sert-tests]# oc delete sub meta-operator-app -n yhliu
subscription.operators.coreos.com "meta-operator-app" deleted
[root@knolls-inf common-svcs-sert-tests]# oc delete clusterserviceversion meta-operator.v0.0.1 -n yhliu
clusterserviceversion.operators.coreos.com "meta-operator.v0.0.1" deleted
[root@knolls-inf common-svcs-sert-tests]# oc get pods -n yhliu
NAME                             READY   STATUS        RESTARTS   AGE
meta-operator-756c747948-b6wcl   0/1     Terminating   0          28h
[root@knolls-inf common-svcs-sert-tests]# oc get pods -n yhliu
No resources found.
[root@knolls-inf common-svcs-sert-tests]# oc get pods -n ibm-cert-manager-operator
NAME                                         READY   STATUS    RESTARTS   AGE
ibm-cert-manager-operator-66f9545ff9-zswgm   1/1     Running   0          26h
[root@knolls-inf common-svcs-sert-tests]# oc get pods -n ibm-licensing-operator
NAME                                      READY   STATUS    RESTARTS   AGE
ibm-licensing-operator-7969d99754-cv54q   1/1     Running   0          18h
[root@knolls-inf common-svcs-sert-tests]#

enhance logs to track the install process

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

More clear logs for troubleshooting

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Enhance uninstall

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Currently, the uninstall is implemented by the following steps

  1. When operator CR is created by ODLM, Its CSV will be added as its owner.
  2. ODLM will delete the CSV and subscription, and CR will be removed together with CSV.
  3. Because the resources created by the common service operator take their CR as their owner. Thus, when deleting the operator, operator CSV subscription CR and its resources will be removed.

But when the operator is a cluster scoped operator, and CSV and CR don't in the same namespace. The uninstall mechanism doesn't work. Therefore, we need to enhance it.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Steps to uninstall an operator:

  1. Save generated CR into the status, when creating the CR.
  2. Remove CR of an operator
  3. Wait for the resources being deleted.
  4. Delete CSV and Subscription.

/cc @gyliu513 @chenzhiwei @DanielXLee

When addon a operand, the status is not correct

/kind feature

When adding an operand after install. the added operand doesn't have operaterPhase.
like:

    - name: ibm-monitoring-exporters-operator
      phase:
        operandPhase: Running

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Add description field to MetaOperatorCatalog

The description field will add some detail for the dependency of the common services.

  - name: mongodb
    namespace: ibmcs-mongodb
    channel: stable-3.3
    packageName: mongodb
    sourceName: ibmcloud-operators
    sourceNamespace: openshift-marketplace
    description: < to make sure description includes the dependencies >

/cc @chenzhiwei @horis233 @DanielXLee

Update operator-sdk version to 0.15.1 go version to 1.13.7

The latest stable version has more strict checks and will find some potential issue in the code.

Generate crds

operator-sdk generate crds

Generate k8s

operator-sdk generate k8s

Generate csv

operator-sdk generate csv

Generate openapi

which ./bin/openapi-gen > /dev/null || go build -o ./bin/openapi-gen k8s.io/kube-openapi/cmd/openapi-gen

GOPATH=/tmp ./bin/openapi-gen --logtostderr=true -o "" -i ./pkg/apis/operator/v1alpha1 -O zz_generated.openapi -p ./pkg/apis/operator/v1alpha1/ -h ./hack/boilerplate.go.txt -r "-"

build multi-arch image

Quay.io is now supporting multiarch image, so it is time to build multiarch image of this operator.

Update the image name to odlm

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

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.