0
0
Kubernetesdevops~30 mins

OperatorHub for community operators in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
OperatorHub for Community Operators
📖 Scenario: You are part of a Kubernetes community team. Your goal is to prepare a simple Operator manifest and configure it for publishing on OperatorHub, a platform where Kubernetes operators are shared and discovered by users.This project will guide you through creating a basic Operator manifest, adding metadata configuration, applying core OperatorHub labels, and finally displaying the manifest ready for submission.
🎯 Goal: Build a Kubernetes Operator manifest YAML file with the required metadata and labels for OperatorHub community operators.You will create the manifest step-by-step, add configuration labels, and output the final YAML manifest.
📋 What You'll Learn
Create a basic Operator manifest dictionary with apiVersion, kind, and metadata
Add a label for the OperatorHub community operator category
Add core OperatorHub labels like 'operators.operatorframework.io.bundle.channels.v1'
Print the final YAML manifest as output
💡 Why This Matters
🌍 Real World
Community operators are shared on OperatorHub to help Kubernetes users find and install useful software easily.
💼 Career
Knowing how to prepare and configure Operator manifests is important for DevOps roles working with Kubernetes and cloud-native applications.
Progress0 / 4 steps
1
Create the basic Operator manifest dictionary
Create a dictionary called operator_manifest with these exact entries: apiVersion: "operators.coreos.com/v1alpha1", kind: "ClusterServiceVersion", and metadata as a nested dictionary with name: "community-operator" and namespace: "operators".
Kubernetes
Need a hint?

Use a Python dictionary with keys apiVersion, kind, and metadata. The metadata itself is a dictionary with name and namespace.

2
Add OperatorHub community operator label
Add a labels dictionary inside operator_manifest["metadata"] with the exact entry "operators.operatorframework.io/community-operator": "true".
Kubernetes
Need a hint?

Inside the metadata dictionary, add a labels dictionary with the required key and value.

3
Add core OperatorHub labels for channels
Inside operator_manifest["metadata"]["labels"], add the exact entry "operators.operatorframework.io.bundle.channels.v1": "stable".
Kubernetes
Need a hint?

Add the new label inside the existing labels dictionary without removing the previous label.

4
Print the final Operator manifest as YAML
Import the yaml module and use print(yaml.dump(operator_manifest)) to display the final Operator manifest in YAML format.
Kubernetes
Need a hint?

Use import yaml at the top and then print(yaml.dump(operator_manifest)) to show the manifest.