1
0
forked from suse-edge/Factory

Add rancher turtles charts

Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
This commit is contained in:
2024-10-31 16:54:18 +01:00
parent 71bd51893e
commit b39277a6cb
42 changed files with 44830 additions and 0 deletions

View File

@@ -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/

View File

@@ -0,0 +1,6 @@
apiVersion: v2
appVersion: 0.12.0
description: Cluster API Operator
name: cluster-api-operator
type: application
version: 0.12.0

View File

@@ -0,0 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "capi-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).
*/}}
{{- define "capi-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 -}}

View File

@@ -0,0 +1,56 @@
# Addon provider
{{- if .Values.addon }}
{{- $addons := split ";" .Values.addon }}
{{- $addonNamespace := "" }}
{{- $addonName := "" }}
{{- $addonVersion := "" }}
{{- range $addon := $addons }}
{{- $addonArgs := split ":" $addon }}
{{- $addonArgsLen := len $addonArgs }}
{{- if eq $addonArgsLen 3 }}
{{- $addonNamespace = $addonArgs._0 }}
{{- $addonName = $addonArgs._1 }}
{{- $addonVersion = $addonArgs._2 }}
{{- else if eq $addonArgsLen 2 }}
{{- $addonNamespace = print $addonArgs._0 "-addon-system" }}
{{- $addonName = $addonArgs._0 }}
{{- $addonVersion = $addonArgs._1 }}
{{- else if eq $addonArgsLen 1 }}
{{- $addonNamespace = print $addonArgs._0 "-addon-system" }}
{{- $addonName = $addonArgs._0 }}
{{- else }}
{{- fail "addon provider argument should have the following format helm:v1.0.0 or mynamespace:helm:v1.0.0" }}
{{- end }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
"argocd.argoproj.io/sync-wave": "1"
name: {{ $addonNamespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: AddonProvider
metadata:
name: {{ $addonName }}
namespace: {{ $addonNamespace }}
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
{{- if or $addonVersion $.Values.secretName }}
spec:
{{- end}}
{{- if $addonVersion }}
version: {{ $addonVersion }}
{{- end }}
{{- if $.Values.secretName }}
secretName: {{ $.Values.secretName }}
{{- end }}
{{- if $.Values.secretNamespace }}
secretNamespace: {{ $.Values.secretNamespace }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,55 @@
# Bootstrap provider
{{- if .Values.bootstrap }}
{{- $bootstraps := split ";" .Values.bootstrap }}
{{- $bootstrapNamespace := "" }}
{{- $bootstrapName := "" }}
{{- $bootstrapVersion := "" }}
{{- range $bootstrap := $bootstraps }}
{{- $bootstrapArgs := split ":" $bootstrap }}
{{- $bootstrapArgsLen := len $bootstrapArgs }}
{{- if eq $bootstrapArgsLen 3 }}
{{- $bootstrapNamespace = $bootstrapArgs._0 }}
{{- $bootstrapName = $bootstrapArgs._1 }}
{{- $bootstrapVersion = $bootstrapArgs._2 }}
{{- else if eq $bootstrapArgsLen 2 }}
{{- $bootstrapNamespace = print $bootstrapArgs._0 "-bootstrap-system" }}
{{- $bootstrapName = $bootstrapArgs._0 }}
{{- $bootstrapVersion = $bootstrapArgs._1 }}
{{- else if eq $bootstrapArgsLen 1 }}
{{- $bootstrapNamespace = print $bootstrapArgs._0 "-bootstrap-system" }}
{{- $bootstrapName = $bootstrapArgs._0 }}
{{- else }}
{{- fail "bootstrap provider argument should have the following format kubeadm:v1.0.0 or mynamespace:kubeadm:v1.0.0" }}
{{- end }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
name: {{ $bootstrapNamespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: {{ $bootstrapName }}
namespace: {{ $bootstrapNamespace }}
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
{{- if or $bootstrapVersion $.Values.configSecret.name }}
spec:
{{- end}}
{{- if $bootstrapVersion }}
version: {{ $bootstrapVersion }}
{{- end }}
{{- if $.Values.configSecret.name }}
configSecret:
name: {{ $.Values.configSecret.name }}
{{- if $.Values.configSecret.namespace }}
namespace: {{ $.Values.configSecret.namespace }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,55 @@
# Control plane provider
{{- if .Values.controlPlane }}
{{- $controlPlanes := split ";" .Values.controlPlane }}
{{- $controlPlaneNamespace := "" }}
{{- $controlPlaneName := "" }}
{{- $controlPlaneVersion := "" }}
{{- range $controlPlane := $controlPlanes }}
{{- $controlPlaneArgs := split ":" $controlPlane }}
{{- $controlPlaneArgsLen := len $controlPlaneArgs }}
{{- if eq $controlPlaneArgsLen 3 }}
{{- $controlPlaneNamespace = $controlPlaneArgs._0 }}
{{- $controlPlaneName = $controlPlaneArgs._1 }}
{{- $controlPlaneVersion = $controlPlaneArgs._2 }}
{{- else if eq $controlPlaneArgsLen 2 }}
{{- $controlPlaneNamespace = print $controlPlaneArgs._0 "-control-plane-system" }}
{{- $controlPlaneName = $controlPlaneArgs._0 }}
{{- $controlPlaneVersion = $controlPlaneArgs._1 }}
{{- else if eq $controlPlaneArgsLen 1 }}
{{- $controlPlaneNamespace = print $controlPlaneArgs._0 "-control-plane-system" }}
{{- $controlPlaneName = $controlPlaneArgs._0 }}
{{- else }}
{{- fail "controlplane provider argument should have the following format kubeadm:v1.0.0 or mynamespace:kubeadm:v1.0.0" }}
{{- end }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
name: {{ $controlPlaneNamespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: ControlPlaneProvider
metadata:
name: {{ $controlPlaneName }}
namespace: {{ $controlPlaneNamespace }}
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
{{- if or $controlPlaneVersion $.Values.configSecret.name }}
spec:
{{- end}}
{{- if $controlPlaneVersion }}
version: {{ $controlPlaneVersion }}
{{- end }}
{{- if $.Values.configSecret.name }}
configSecret:
name: {{ $.Values.configSecret.name }}
{{- if $.Values.configSecret.namespace }}
namespace: {{ $.Values.configSecret.namespace }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,31 @@
{{- if or .Values.addon .Values.bootstrap .Values.controlPlane .Values.infrastructure }}
# Deploy core components if not specified
{{- if not .Values.core }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
name: capi-system
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
namespace: capi-system
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
{{- with .Values.configSecret }}
spec:
configSecret:
name: {{ .name }}
{{- if .namespace }}
namespace: {{ .namespace }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,63 @@
# Core provider
{{- if .Values.core }}
{{- $coreArgs := split ":" .Values.core }}
{{- $coreArgsLen := len $coreArgs }}
{{- $coreVersion := "" }}
{{- $coreNamespace := "" }}
{{- $coreName := "" }}
{{- $coreVersion := "" }}
{{- if eq $coreArgsLen 3 }}
{{- $coreNamespace = $coreArgs._0 }}
{{- $coreName = $coreArgs._1 }}
{{- $coreVersion = $coreArgs._2 }}
{{- else if eq $coreArgsLen 2 }}
{{- $coreNamespace = "capi-system" }}
{{- $coreName = $coreArgs._0 }}
{{- $coreVersion = $coreArgs._1 }}
{{- else if eq $coreArgsLen 1 }}
{{- $coreNamespace = "capi-system" }}
{{- $coreName = $coreArgs._0 }}
{{- else }}
{{- fail "core provider argument should have the following format cluster-api:v1.0.0 or mynamespace:cluster-api:v1.0.0" }}
{{- end }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
name: {{ $coreNamespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: {{ $coreName }}
namespace: {{ $coreNamespace }}
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
{{- if or $coreVersion $.Values.configSecret.name }}
spec:
{{- end}}
{{- if $coreVersion }}
version: {{ $coreVersion }}
{{- end }}
{{- if $.Values.manager }}
manager:
{{- if and $.Values.manager.featureGates $.Values.manager.featureGates.core }}
featureGates:
{{- range $key, $value := $.Values.manager.featureGates.core }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
{{- if $.Values.configSecret.name }}
configSecret:
name: {{ $.Values.configSecret.name }}
{{- if $.Values.configSecret.namespace }}
namespace: {{ $.Values.configSecret.namespace }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,146 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "capi-operator.fullname" . }}
namespace: '{{ .Release.Namespace }}'
labels:
app: {{ template "capi-operator.name" . }}
app.kubernetes.io/name: {{ template "capi-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: "controller"
control-plane: controller-manager
clusterctl.cluster.x-k8s.io/core: capi-operator
{{- with .Values.deploymentLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "capi-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: "controller"
control-plane: controller-manager
clusterctl.cluster.x-k8s.io/core: capi-operator
{{- with .Values.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
template:
metadata:
labels:
app: {{ template "capi-operator.name" . }}
app.kubernetes.io/name: {{ template "capi-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: "controller"
control-plane: controller-manager
clusterctl.cluster.x-k8s.io/core: capi-operator
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: capi-operator-manager
automountServiceAccountToken: true
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
{{- if .Values.logLevel }}
- --v={{ .Values.logLevel }}
{{- end }}
{{- if .Values.healthAddr }}
- --health-addr={{ .Values.healthAddr }}
{{- end }}
{{- if .Values.metricsBindAddr }}
- --metrics-bind-addr={{ .Values.metricsBindAddr }}
{{- end }}
{{- if .Values.diagnosticsAddress }}
- --diagnostics-address={{ .Values.diagnosticsAddress }}
{{- end }}
{{- if .Values.insecureDiagnostics }}
- --insecure-diagnostics={{ .Values.insecureDiagnostics }}
{{- end }}
{{- with .Values.leaderElection }}
- --leader-elect={{ .enabled }}
{{- if .leaseDuration }}
- --leader-elect-lease-duration={{ .leaseDuration }}
{{- end }}
{{- if .renewDeadline }}
- --leader-elect-renew-deadline={{ .renewDeadline }}
{{- end }}
{{- if .retryPeriod }}
- --leader-elect-retry-period={{ .retryPeriod }}
{{- end }}
{{- end }}
command:
- /manager
{{- with .Values.image.manager }}
image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
{{- end }}
imagePullPolicy: {{ .Values.image.manager.pullPolicy }}
name: manager
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
- containerPort: {{ ( split ":" $.Values.metricsBindAddr)._1 | int }}
name: metrics
protocol: TCP
{{- with .Values.resources.manager }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.env.manager }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.containerSecurityContext.manager }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumeMounts.manager }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: 10
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podDnsPolicy }}
dnsPolicy: {{ . }}
{{- end }}
{{- with .Values.podDnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,64 @@
{{- if .Values.infrastructure }}
# Deploy bootstrap, and infrastructure components if not specified
{{- if not .Values.bootstrap }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
"argocd.argoproj.io/sync-wave": "1"
name: capi-kubeadm-bootstrap-system
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: kubeadm
namespace: capi-kubeadm-bootstrap-system
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
{{- with .Values.configSecret }}
spec:
configSecret:
name: {{ .name }}
{{- if .namespace }}
namespace: {{ .namespace }}
{{- end }}
{{- end }}
{{- end }}
{{- if not .Values.controlPlane }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
"argocd.argoproj.io/sync-wave": "1"
name: capi-kubeadm-control-plane-system
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: ControlPlaneProvider
metadata:
name: kubeadm
namespace: capi-kubeadm-control-plane-system
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
{{- with .Values.configSecret }}
spec:
configSecret:
name: {{ .name }}
{{- if .namespace }}
namespace: {{ .namespace }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,84 @@
{{- define "recursivePrinter" }}
{{- range $key, $value := . }}
{{- if kindIs "map" $value }}
{{ $key }}:
{{- include "recursivePrinter" $value | indent 2 }}
{{- else }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
# Infrastructure providers
{{- if .Values.infrastructure }}
{{- $infrastructures := split ";" .Values.infrastructure }}
{{- $infrastructureNamespace := "" }}
{{- $infrastructureName := "" }}
{{- $infrastructureVersion := "" }}
{{- range $infrastructure := $infrastructures }}
{{- $infrastructureArgs := split ":" $infrastructure }}
{{- $infrastructureArgsLen := len $infrastructureArgs }}
{{- if eq $infrastructureArgsLen 3 }}
{{- $infrastructureNamespace = $infrastructureArgs._0 }}
{{- $infrastructureName = $infrastructureArgs._1 }}
{{- $infrastructureVersion = $infrastructureArgs._2 }}
{{- else if eq $infrastructureArgsLen 2 }}
{{- $infrastructureNamespace = print $infrastructureArgs._0 "-infrastructure-system" }}
{{- $infrastructureName = $infrastructureArgs._0 }}
{{- $infrastructureVersion = $infrastructureArgs._1 }}
{{- else if eq $infrastructureArgsLen 1 }}
{{- $infrastructureNamespace = print $infrastructureArgs._0 "-infrastructure-system" }}
{{- $infrastructureName = $infrastructureArgs._0 }}
{{- else }}
{{- fail "infrastructure provider argument should have the following format aws:v1.0.0 or mynamespace:aws:v1.0.0" }}
{{- end }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "1"
"argocd.argoproj.io/sync-wave": "1"
name: {{ $infrastructureNamespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: InfrastructureProvider
metadata:
name: {{ $infrastructureName }}
namespace: {{ $infrastructureNamespace }}
annotations:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
{{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }}
spec:
{{- end }}
{{- if $infrastructureVersion }}
version: {{ $infrastructureVersion }}
{{- end }}
{{- if $.Values.manager }}
manager:
{{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $infrastructureName) }}
{{- range $key, $value := $.Values.manager.featureGates }}
{{- if eq $key $infrastructureName }}
featureGates:
{{- range $k, $v := $value }}
{{ $k }}: {{ $v }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if $.Values.configSecret.name }}
configSecret:
name: {{ $.Values.configSecret.name }}
{{- if $.Values.configSecret.namespace }}
namespace: {{ $.Values.configSecret.namespace }}
{{- end }}
{{- end }}
{{- if $.Values.additionalDeployments }}
additionalDeployments:
{{- include "recursivePrinter" $.Values.additionalDeployments | indent 2 }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,69 @@
---
# ---
# Cluster API provider options
core: ""
bootstrap: ""
controlPlane: ""
infrastructure: ""
addon: ""
manager.featureGates: {}
# ---
# Common configuration secret options
configSecret: {}
# ---
# CAPI operator deployment options
logLevel: 2
replicaCount: 1
leaderElection:
enabled: true
image:
manager:
repository: registry.k8s.io/capi-operator/cluster-api-operator
tag: v0.12.0
pullPolicy: IfNotPresent
env:
manager: []
healthAddr: ":8081"
metricsBindAddr: "127.0.0.1:8080"
diagnosticsAddress: "8443"
insecureDiagnostics: false
imagePullSecrets: {}
resources:
manager:
limits:
cpu: 100m
memory: 150Mi
requests:
cpu: 100m
memory: 100Mi
containerSecurityContext: {}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
- ppc64le
- key: kubernetes.io/os
operator: In
values:
- linux
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
volumes:
- name: cert
secret:
defaultMode: 420
secretName: capi-operator-webhook-service-cert
volumeMounts:
manager:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true