Addon Operator coordinates the lifecycle of Add-ons in managed OpenShift

Addon Operator


Addon Operator coordinates the lifecycle of Addons in managed OpenShift.


dev tools

  • setup pre-commit hooks: make pre-commit-install
  • global requirements:
    • golang
    • kubectl/oc
    • make
    • either docker or podman
Owner
OpenShift
The developer and operations friendly Kubernetes distro
OpenShift
Comments
  • MTSRE-282 | add: TLS-terminated relay for metrics server

    MTSRE-282 | add: TLS-terminated relay for metrics server

    Signed-off-by: Yashvardhan Kukreja [email protected]

    Why not directly configure the existing metrics server to be TLS-terminated? Because the existing metrics server isn't setup by us but by controller-runtime, behind the scenes, while the manager gets bootstrapped and it is currently hardcoded to be http-exposed. Hence, this PR adds a relay server (a sidecar to our metrics-server) which acts as the TLS-terminated front-end to our clients (Prometheus scraper, ServiceMonitors) masking the insecure http-exposed server.

    The addon-operator-metrics.addon-operator.svc (service) exposes the metrics at /metrics at the following hosts: https://addon-operator-metrics.addon-operator.svc:8443/metrics and http://addon-operator-metrics.addon-operator.svc:8080/metrics.

  • Add 'olm' prefix to 'ownNamespace' and 'allNamespace' params and config

    Add 'olm' prefix to 'ownNamespace' and 'allNamespace' params and config

    Description

    With https://github.com/openshift/addon-operator/pull/32 AllNamespaces and OwnNamespace install types have gained OLM specific parameters. This PR prefixes those options and config stanzas with OLM to reflect that.

    Signed-off-by: Mayank Shah [email protected]

  • Code Review

    Code Review

    Description

    To get started with this operator, I have reviewed and did some minor refactors. I have not reviewed everything, as I feel this is already large enough for a PR and to get us started.

    Out-of-scope

    • Test cases
    • Stopped at Phase 4 of the Reconcile loop

    Work done

    • make test-unit + make lint + pre-commit-hooks work (counting on CI to run integration tests)
    • I left a few // TODO ... comments directly inline. This is not ideal so I tried to avoid it as much as possible.
    • renamed k8sApiErrors to apierrors to mimic kubebuilder/controller-runtime
    • added probe endpoints to the manager (healthz + readyz)
    • added minimal error logging inside of Reconcile
    • condensed few error handling statements like this one:
    if err := myFunc(...); err != nil { 
        return err 
    }
    

    Comments / Questions

    • Migrate testing to Ginkgo/Gomega? controller-runtime + kubebuilder have settled on that. Great example here microsoft/azure-databricks-operator
    • We are missing some info/debug logging inside the controller
    • How do we want to instrument the controller to play nice with OSD? Prometheus? Do we have an example?
    • We should avoid passing the logger around, it is internal to Reconciler (I saw a comment acknowledging this). We can just instantiate a new one:
    log := r.Log.WithName("mrbean")
    
    • I feel we should try to stick to kubebuilder framework as much as we can. Under heavy development. Lot's of experience. If they think something should be done in a certain way, I would tend to agree and blindly follow. Aren't we all sheeps? :sheep:
    • In another PR, bump Makefile dependencies to latest + retest? Can we enable this via bot PR's?
    • parseAddonInstallConfig is what I would call 'defensive' programming, but the comment acknowledges this and suggests migrating to Defaulting/Validating webhooks. Also, returning more than two values is always a red flag from my perspective, maybe we can refactor this?
  • [OHSS-16151] fix: addon operator schedules on infra nodes

    [OHSS-16151] fix: addon operator schedules on infra nodes

    Signed-off-by: Ankit Kurmi [email protected]

    Description

    Updating preferredDuringSchedulingIgnoredDuringExecution to requiredDuringSchedulingIgnoredDuringExecution.

  • [MTSRE-298] Refactor integration test suite

    [MTSRE-298] Refactor integration test suite

    This PR introduces the testify/suite library for integration tests. This mechanism allows us to group theses tests into a common integrationTestSuite and add proper setup and teardown for it.

    • Use SetupSuite and TeardownSuite methods for the test suite
    • De-duplicate test code and combine catalog_source_test.go, namespaces_test.go, and subscription_test.go into a single test with each of them as a subtest in addon_test.go
    • Minor refactors within the integration/ package to adapt to the suite library
    • Move Addon object declarations into re-usable fixtures in fixtures_test.go, thereby removing redundant Addon object initializations

    Removal of parallel test execution

    This PR also removes parallel execution of tests becausetestify/suite has poor support for parallel test execution - https://github.com/stretchr/testify/issues/187 . Running tests within a test suite in parallel causes the following problems:

    • Raciness - test suite is torn down while some tests are still running
    • Pod logs printing happens out-of-order
  • Reduce csv cache size

    Reduce csv cache size

    Disable for cache for CSV resource

    Add OnlyMetadata option to ClusterServiceVersion watch setup

    Replace the use of operatorsv1alpha1.ClusterServiceVersion type with unstructured.Unstructured in the get CSV operation. This ensures that Get operations on CSV resource are not cached as unstructured.Unstructured based client operations are not cached by default in the manager default client.

    Ref: https://github.com/kubernetes-sigs/controller-runtime/blob/cd0058ad295c268da1e7233e609a9a18dd60b5f6/pkg/client/split.go#L115

    Upgrade go version, controller-runtime and k8s libraries

  • doc-fix: Updated README

    doc-fix: Updated README

    Signed-off-by: Ankit Kurmi [email protected]

    Description

    1. Added Prerequisites, Unit test, Releasing and Deployment into the Index section.
    2. Added Unit test section into the README file.
  • Added better code readability

    Added better code readability

    Signed-off-by: Ankit Kurmi [email protected]

    Description

    Changing variable name for better code readability for webhook_test.go under internal/webhooks and to make it consistent.

  • Added unit test for HasAdoptAllStrategy function

    Added unit test for HasAdoptAllStrategy function

    Signed-off-by: Ankit Kurmi [email protected]

    Description

    Adding unit test for HasAdoptAllStrategy function under internal/controllers/addon/utils.go which checks if an addon has ResourceAdoptionAdoptAll strategy.

  • [MTSRE-298] Refactor Addon status reporting and exit handling

    [MTSRE-298] Refactor Addon status reporting and exit handling

    This is the final refactor left for https://issues.redhat.com/browse/MTSRE-298

    This PR refactors the Addon Reconciler code to have consistent exit handling and a single place where the Addon Status is updated via the kube-api.

    Signed-off-by: Mayank Shah [email protected]

  • [MTSRE-205] Adding addon metrics exposed through prometheus

    [MTSRE-205] Adding addon metrics exposed through prometheus

    Adding a way to track all addons being reconciled by the addon-operator and expose metrics with prometheus.

    What it looks like at the end of running tests make test-integration-short (addons go from Pending to Ready to Terminating):

    Update what metrics output looks like: https://pastebin.com/2N5gHNRc

    TODO

    • [x] The Terminating state is final, addon never get updated afterwards. Meaning the addon_operator_addons_phase_total{phase="Terminating"} 6 will effectively be a counter never going down. Is that OK?
    • [x] Write integration test and validate localhost:8080/metrics exposes this metric
    • [x] I noticed that we have a helper method to update all phases except PhasePending. Is it worth refactoring this?
  • Replace 'ClusterServiceVersion' watch with 'Operator' watch

    Replace 'ClusterServiceVersion' watch with 'Operator' watch

    Make addon reconciler watch operatorv1/Operator instead of operatorv1alpha1/ClusterServiceVersion

    Replace CSV based addon install succes validation with operator resource based install success validation

    Signed-off-by: Nikhil Thomas [email protected]

  • Refactor 'ReplaceMap' in CSV handler

    Refactor 'ReplaceMap' in CSV handler

    Note: the current code might be deleting the csvKey to AddonKey mappings of addons other than the one being reconciled at a given moment.

    This patch ensures that only the mappings of the current Addon, which are obsolete are removed

    Signed-off-by: Nikhil Thomas [email protected]

Helm Operator is designed to managed the full lifecycle of Helm charts with Kubernetes CRD resource.

Helm Operator Helm Operator is designed to install and manage Helm charts with Kubernetes CRD resource. Helm Operator does not create the Helm release

Aug 25, 2022
Open Source runtime scanner for OpenShift cluster and perform security audit checks based on CIS RedHat OpenShift Benchmark specification
Open Source runtime scanner for OpenShift cluster and perform security audit checks based on CIS RedHat OpenShift Benchmark specification

OpenShift-Ordeal Scan your Openshift cluster !! OpenShift-Ordeal is an open source audit scanner who perform audit check on OpenShift Cluster and outp

Sep 6, 2022
Oc-clusteroperator - OpenShift CLI plugin to change the state of ClusterOperators from managed to unmanaged and back again

oc-clusteroperator OpenShift CLI plugin to change the state of ClusterOperators

Feb 15, 2022
Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behaviors.

add-operator Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behavio

Dec 15, 2021
An operator which complements grafana-operator for custom features which are not feasible to be merged into core operator

Grafana Complementary Operator A grafana which complements grafana-operator for custom features which are not feasible to be merged into core operator

Aug 16, 2022
Modular Kubernetes operator to manage the lifecycle of databases

Ensemble Ensemble is a simple and modular Kubernetes Operator to manage the lifecycle of a wide range of databases. Infrastructure as code with Kubern

Aug 12, 2022
The cortex-operator is a project to manage the lifecycle of Cortex in Kubernetes.

cortex-operator The cortex-operator is a project to manage the lifecycle of Cortex in Kubernetes. Project status: alpha Not all planned features are c

Dec 14, 2022
The Elastalert Operator is an implementation of a Kubernetes Operator, to easily integrate elastalert with gitops.

Elastalert Operator for Kubernetes The Elastalert Operator is an implementation of a Kubernetes Operator. Getting started Firstly, learn How to use el

Jun 28, 2022
Test Operator using operator-sdk 1.15

test-operator Test Operator using operator-sdk 1.15 operator-sdk init --domain rbt.com --repo github.com/ravitri/test-operator Writing kustomize manif

Dec 28, 2021
Minecraft-operator - A Kubernetes operator for Minecraft Java Edition servers

Minecraft Operator A Kubernetes operator for dedicated servers of the video game

Dec 15, 2022
K8s-network-config-operator - Kubernetes network config operator to push network config to switches

Kubernetes Network operator Will add more to the readme later :D Operations The

May 16, 2022
a k8s operator 、operator-sdk

helloworld-operator a k8s operator 、operator-sdk Operator 参考 https://jicki.cn/kubernetes-operator/ https://learnku.com/articles/60683 https://opensour

Jan 27, 2022
Pulumi-k8s-operator-example - OpenGitOps Compliant Pulumi Kubernetes Operator Example

Pulumi GitOps Example OpenGitOps Compliant Pulumi Kubernetes Operator Example Pr

May 6, 2022
Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install. The permissions are aggregated from the following sources:

Apr 22, 2022
Kubernetes Operator Samples using Go, the Operator SDK and OLM
Kubernetes Operator Samples using Go, the Operator SDK and OLM

Kubernetes Operator Patterns and Best Practises This project contains Kubernetes operator samples that demonstrate best practices how to develop opera

Nov 24, 2022
A controller to create K8s Ingresses for Openshift routes.

route-to-ingress-operator A controller to create corresponding ingress.networking.k8s.io/v1 resources for route.openshift.io/v1 TODO int port string p

Jan 7, 2022
a small form factor OpenShift/Kubernetes optimized for edge computing

Microshift Microshift is OpenShift1 Kubernetes in a small form factor and optimized for edge computing. Edge devices deployed out in the field pose ve

Dec 29, 2022
A TUI interface to navigate and view OpenShift 4 must-gather logs
A TUI interface to navigate and view OpenShift 4 must-gather logs

MGR "Must Gather Reader" MGR "not the final name" is a simple TUI interface to navigate and view OpenShift 4 must-gather files. How to run it: Downloa

Dec 21, 2022