Skip to content

Commit

Permalink
feat: Add network-observability-operator chart (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm authored Feb 17, 2025
1 parent 5dc6e13 commit aba7607
Show file tree
Hide file tree
Showing 12 changed files with 9,304 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/network-observability-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions charts/network-observability-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: network-observability-operator
description: A Helm chart for Kubernetes that installs Network Observability Operator
type: application
version: 0.1.0
appVersion: "1.8.0-community"
home: https://github.com/netobserv/network-observability-operator

Large diffs are not rendered by default.

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions charts/network-observability-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "network-observability-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "network-observability-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "network-observability-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "network-observability-operator.labels" -}}
helm.sh/chart: {{ include "network-observability-operator.chart" . }}
{{ include "network-observability-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "network-observability-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "network-observability-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "network-observability-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "network-observability-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/network-observability-operator/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: serving-cert
spec:
secretName: webhook-server-cert
dnsNames:
- netobserv-webhook-service.{{ .Release.Namespace }}.svc
- netobserv-webhook-service.{{ .Release.Namespace }}.svc.cluster.local
{{ if .Values.certManager.existingIssuer.name }}
issuerRef:
kind: {{ .Values.certManager.existingIssuer.kind }}
name: {{ .Values.certManager.existingIssuer.name }}
{{ else }}
issuerRef:
kind: Issuer
name: self-signed
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: self-signed
spec:
selfSigned: {}
{{ end }}
19 changes: 19 additions & 0 deletions charts/network-observability-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
data:
controller_manager_config.yaml: |
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
kind: ControllerManagerConfig
health:
healthProbeBindAddress: :8081
metrics:
bindAddress: 127.0.0.1:8080
webhook:
port: 9443
leaderElection:
leaderElect: true
resourceName: 7a7ecdcd.netobserv.io
kind: ConfigMap
metadata:
labels:
app: netobserv-operator
name: netobserv-manager-config
87 changes: 87 additions & 0 deletions charts/network-observability-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{- $appVersion := .Chart.AppVersion -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: netobserv-controller-manager
labels:
app: netobserv-operator
control-plane: controller-manager
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: netobserv-operator
control-plane: controller-manager
strategy: {}
template:
metadata:
labels:
app: netobserv-operator
control-plane: controller-manager
spec:
containers:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
- --ebpf-agent-image=$(RELATED_IMAGE_EBPF_AGENT)
- --flowlogs-pipeline-image=$(RELATED_IMAGE_FLOWLOGS_PIPELINE)
- --console-plugin-image=$(RELATED_IMAGE_CONSOLE_PLUGIN)
- --downstream-deployment=$(DOWNSTREAM_DEPLOYMENT)
- --profiling-bind-address=$(PROFILING_BIND_ADDRESS)
command:
- /manager
env:
- name: RELATED_IMAGE_EBPF_AGENT
value: quay.io/netobserv/netobserv-ebpf-agent:v1.8.0-community
- name: RELATED_IMAGE_FLOWLOGS_PIPELINE
value: quay.io/netobserv/flowlogs-pipeline:v1.8.0-community
- name: RELATED_IMAGE_CONSOLE_PLUGIN
value: quay.io/netobserv/network-observability-console-plugin:v1.8.0-community
- name: DOWNSTREAM_DEPLOYMENT
value: "false"
- name: PROFILING_BIND_ADDRESS
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default $appVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
memory: 400Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
securityContext:
runAsNonRoot: true
serviceAccountName: {{ include "network-observability-operator.serviceAccountName" . }}
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-cert
Loading

0 comments on commit aba7607

Please sign in to comment.