operator

by joaquinito2051

Helm chartv80.0.0-implement-native-security-analysis-tool-from-git-in-the-ci-sast-cve-dependency-analysis-dev

A Helm chart for the Punch Operator

About this chart

Punch Operator

Overview

The punch operator is actually a set of several Kubernetes Operators in charge of managing the punch CRDs (Custom Resources Definitions). Several types of CRDs are supported by the Punch:

  • Flinkline: used to model a flink-compatible punchline.
  • SparkPunchline: used to model a spark-compatible punchline.
  • BatchApplication: used to model arbitrary batch applications.
  • StreamApplication: used to model arbitrary streaming applications.
  • BatchPunchline: used to model batch punchline.
  • StreamPunchline: used to model streaming punchline.
  • Plan: used to model a plan. A plan is a sort of CronJob extended with an exactly once guarantee for executing periodic punchlines.

Usage

Once the operator is up and running on your Kubernetes (see below) here is how to use it:

To start a punchline (flink,spark,bapp,sapp,bpun,spun) simply type:

kubectl apply -f <punchline_crd.yaml>

To stop it:

kubectl delete -f <punchline_crd.yaml>

To list the deployed punchlines:

kubectl get sparkpunchlines
kubectl get flinklines
kubectl get platforms
kubectl get batchapplication
kubectl get streamapplication
kubectl get batchpunchline
kubectl get streampunchline

Starting a plan is similar. I.e you use the same commands.

kubectl apply -f <plan_crd.yaml>
kubectl apply -f <diagram_crd.yaml>

To stop it:

kubectl delete -f <plan_crd.yaml>
kubectl delete -f <diagram_crd.yaml>
# schedulers
kubectl get plans
kubectl get diagrams

Configuration

Kubernetes configuration

Image

ConfigurationDescriptionDefault value
kubernetes.imageThe Punch Operator docker imageghcr.io/punchplatform/operator:v1.0.2
kubernetes.imagePullPolicyThe Kubernetes image pull policyIfNotPresent
kubernetes.imageSecretSecret name to pull docker imageadmin-secret

Punchplatform Operator configuration

Annotations

ConfigurationDescriptionDefault value
additionalAnnotationsAdd custom annotations for pod Operatorempty
additionalLabelsAdd custom labels for pod Operatorempty

Flinkline

ConfigurationDescriptionDefault value
operator.punch.flinkline.enableIf Flinkline CRD is enabledtrue
operator.punch.flinkline.workersNumber of threads to manage Flinkline CRDs. This is not the number of workers within a topology.2

SparkPunchline

ConfigurationDescriptionDefault value
operator.punch.sparkpunchline.enableIf SparkPunchline CRD is enabledtrue
operator.punch.sparkpunchline.workersNumber of threads to manage SparkPunchline CRDs. This is not the number of workers within a topology.2

BatchApplication

ConfigurationDescriptionDefault value
operator.punch.batchApplication.enableIf Application CRD is enabledtrue
operator.punch.batchApplication.workersNumber of threads to manage Application CRDs. This is not the number of workers within the application.2

StreamApplication

ConfigurationDescriptionDefault value
operator.punch.streamApplication.enableIf Application CRD is enabledtrue
operator.punch.streamApplication.workersNumber of threads to manage Application CRDs. This is not the number of workers within the application.2

Plan

ConfigurationDescriptionDefault value
operator.punch.plan.enableIf Plan CRD is enabledtrue
operator.punch.plan.workersNumber of threads to manage Plan CRDs. This is not the number of workers within the planned application.2

Diagram

ConfigurationDescriptionDefault value
operator.punch.diagram.enableIf Diagram CRD is enabledtrue
operator.punch.diagram.workersNumber of threads to manage Diagram CRDs. This is not the number of workers within the planned application.2

Install

The CRDs will be installed first, and then the punch Operator will be installed by Helm.

helm install my-punchoperator-release $PUNCHPLATFORM_HELM_CHARTS/operator -n punchoperator-system

Uninstall

First, run :

helm uninstall my-punchoperator-release -n punchoperator-system

Helm will not remove CRD while uninstalling. This must be done manually. Check Helm limitations on CRD.

Deploy operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartoperator is pinned at v80.0.0-implement-native-security-analysis-tool-from-git-in-the-ci-sast-cve-dependency-analysis-dev in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply