blog に戻る

2021年08月31日 Frank Reno and Katarzyna Kujawa

Sumo Logic Red Hat Marketplace Operator

Red Hat OpenShift is an open source container application platform that incorporates a collection of software that enables developers the ability to run an entire Kubernetes environment. It includes streamlined workflows to help teams get to production faster and is tested with dozens of technologies while providing a robust tightly-integrated platform supported over a 9-year lifecycle. More than 1000 Enterprises are leveraging OpenShift as the platform of choice for their digital transformation and migration to Kubernetes. Today, I'm excited to announce that Sumo Logic has expanded its partnership with Red Hat to accelerate hybrid cloud adoption with Red Hat Operator Certification and availability in the Red Hat Marketplace. In addition, we've also announced the release of Sumo Logic Helm Operator.

What is an Operator?

Kubernetes Operators provide developers with a way to package, deploy and manage Kubernetes applications. Operators build on top of the Kubernetes resource model and controller concepts and leverage Customer Resources to manage applications and their components. OpenShift users can find and install many different operators in the Red Hat Marketplace today.

Redhat Market Operator

The Helm Operator

RedHat HELM Operator

The Helm Operator enables developers to package their Helm Charts with all the operational knowledge of installing, upgrading and managing that Helm Chart on Kubernetes clusters. The operators are built using the Operator SDK which creates an operator based on a Helm Chart. Essentially, the Helm Operator enables you to repackage your Helm Chart as an operator, containing all the information required to install, upgrade and manage that Helm Chart in Kubernetes.

Introducing the Sumo Logic Helm Operator

The Sumo Logic Helm Chart packages up all the components to collect comprehensive Observability data from Kubernetes clusters. With a simple helm install command, you can easily get all your critical telemetry from your Kubernetes cluster to Sumo Logic, no matter where that Kubernetes cluster is running.

RedHat Sumo Logic Market Operator

By leveraging the Operator SDK, we were able to repackage our Helm Chart as an Operator, encapsulating all the knowledge needed to install, upgrade and manage the Helm chart into an operator. Thanks to the Operator SDK, creating an operator from an existing Helm chart is just a few simple steps.

1. Add the Helm chart to the local the local repository list, e.g.

$ helm repo add sumologic

https://sumologic.github.io/sumologic-kubernetes-collection

$ helm repo update

2. Initialize Helm operator by operator-sdk init command e.g.

operator-sdk init --plugins helm --helm-chart sumologic/sumologic --domain sumologic.com --group helm-operator --version v1alpha1 --kind SumologicCollection

This command initializes the Helm operator and generates all necessary files. The structure of directory with files generated for Helm operator has following form:

sumologic-kubernetes-collection-helm-operator

├── config

│ ├── crd

│ │ ├── bases

│ │ │ └── helm-operator.sumologic.com_sumologiccollections.yaml

│ │ └── kustomization.yaml

│ ├── default

│ │ ├── kustomization.yaml

│ │ ├── manager_auth_proxy_patch.yaml

│ │ └── manager_config_patch.yaml

│ ├── manager

│ │ ├── controller_manager_config.yaml

│ │ ├── kustomization.yaml

│ │ └── manager.yaml

│ ├── manifests

│ │ └── kustomization.yaml

│ ├── prometheus

│ │ ├── kustomization.yaml

│ │ └── monitor.yaml

│ ├── rbac

│ │ ├── auth_proxy_client_clusterrole.yaml

│ │ ├── auth_proxy_role_binding.yaml

│ │ ├── auth_proxy_role.yaml

│ │ ├── auth_proxy_service.yaml

│ │ ├── kustomization.yaml

│ │ ├── leader_election_role_binding.yaml

│ │ ├── leader_election_role.yaml

│ │ ├── role_binding.yaml

│ │ ├── role.yaml

│ │ ├── service_account.yaml

│ │ ├── sumologiccollection_editor_role.yaml

│ │ └── sumologiccollection_viewer_role.yaml

│ ├── samples

│ │ ├── helm-operator_v1alpha1_sumologiccollection.yaml

│ │ └── kustomization.yaml

│ └── scorecard

│ ├── bases

│ │ └── config.yaml

│ ├── kustomization.yaml

│ └── patches

│ ├── basic.config.yaml

│ └── olm.config.yaml

├── Dockerfile

├── helm-charts

│ └── sumologic

│ └── …

├── Makefile

├── PROJECT

└── watches.yaml

  • config directory contains patches for kustomize which are used to deploy Helm operator to the Kubernetes cluster. It is important to remember about adjusting patch for ClusterRole for Helm operator (available in config/rbac/role.yaml) When Helm Chart makes some operations on Kubernetes resources then Helm operator needs to have permissions to make these operations, e.g. Helm Chart creates and deletes Pods so Helm operator needs to have permissions to create and delete Pods.

In this directory there is also a patch with CustomResourceDefinition for Helm operator (see config/crd directory) and example Custom Resource for Helm Operator (see config/samples directory). Generated Custom Resource in config/samples directory contains all parameters from values.yaml for Helm Chart, e.g.

apiVersion: helm-operator.sumologic.com/v1alpha1

kind: SumologicCollection

metadata:

name: sumologiccollection-sample

spec:

# Default values copied from

#<project_dir>/helm-charts/sumologic/values.yaml

  • helm-charts directory contains Helm chart for which Helm operator is created, operator-sdk automatically downloads sources of Helm chart to this directory (on the diagram with structure of directory for the Helm operator the directory with Sumo Logic Kubernetes Collection Chart was cut because of its complex structure).
  • Makefile by default has all necessary targets to build, test and deploy Helm operator.
  • PROJECT file contains information project configuration.
  • watches.yaml defines the mapping between Helm Operator API and the Helm chart. Its example structure has following form:

- group: helm-operator.sumologic.com

version: v1alpha1

kind: SumologicCollection

chart: helm-charts/sumologic

  • Dockerfile generated by the Operator SDK is quite generic and its form can be similar to many different Helm operators. Container image for Helm operator bases on helm-operator image which is part of Operator SDK and adds to the image watches.yaml and sources of Helm Chart, example Dockerfile for Helm Operator:

FROM quay.io/operator-framework/helm-operator:v1.6.4

ENV HOME=/opt/helm

COPY watches.yaml ${HOME}/watches.yaml

COPY helm-charts ${HOME}/helm-charts

WORKDIR ${HOME}

3. To test Helm operator, build and push Helm operator image:

    make docker-build docker-push IMG=<CONTAINER_IMAGE>:<CONTAINER_TAG>

    And deploy Helm operator from sources:

    make deploy IMG=<CONTAINER_IMAGE>:<CONTAINER_TAG>

    If needed adjust sample Custom Resource in in config/samples directory and create its instance in the Kubernetes cluster:

    kubectl apply -f config/samples/<file_name>.yaml

    After creation of Custom Resource in the cluster you should see that resources corresponding to Helm Chart are created.

    In addition, Red Hat OpenShift Users can now integrate Sumo Logic by simply installing our operator in the Red Hat MarketPlace. Simply provide your Sumo Logic credentials and Kubenetes cluster name, and with a click our Operator is installed collecting all the critical telemetry you need.

    RedHat Create Sumo Logic Collection


    Sumo Logic’s Kubernetes Observability Solution is an integrated solution to monitor, diagnose, troubleshoot, and secure Kubernetes applications. Our solution provides customers many benefits including:

    • Native integrations with best practice, open-source technologies for comprehensive data collection and enrichment for Kubernetes.
    • Out-of-the-box Kubernetes apps that provide immediate insights into all of your Kubernetes clusters no matter where they are running.
    • Intuitive entity driven navigation to reduce MTTI and MTTR of resolving any issues in your Kubernetes clusters.
    • Full support for OpenTelemetry and open source standards.
    • Top to bottom DevSecOps view you need – from your containers to your application
    • Native integrations with popular CI/CD and security tools
    RedHat Market Operator Cluster Stats


    Sumo Logic fully integrates and supports Red Hat OpenShift, ensuring customers have complete observability of their Kubernetes clusters. Our solution gives you the discoverability you need to understand your Kubernetes deeply and with the context needed to navigate at the infrastructure and service and application level. The discoverability is powered by comprehensive observability, capturing all the critical signals from Kubernetes and enriching that data with complete metadata. We provide you with integrated security out of the box and through deep integrations with the wider Kubernetes ecosystem. Be sure to check out more details about our Kubernetes Observability Solution, watch a demo, and sign up for a 30-day free trial!

Complete visibility for DevSecOps

Reduce downtime and move from reactive to proactive monitoring.

Sumo Logic cloud-native SaaS analytics

Build, run, and secure modern applications and cloud infrastructures.

Start free trial

Frank Reno and Katarzyna Kujawa

More posts by Frank Reno and Katarzyna Kujawa.

これを読んだ人も楽しんでいます