Files
cluster-templates/tinkerbell-k0s-hcp/templates/k0smotroncontrolplane.yaml
2025-12-15 20:35:51 +01:00

56 lines
1.8 KiB
YAML

apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: K0smotronControlPlane
metadata:
name: {{ .Release.Name }}-cp
namespace: {{ .Release.Namespace }}
spec:
version: {{ .Values.k0s.version }}
replicas: {{ .Values.controlPlaneNumber }}
{{- with .Values.k0smotron.persistence }}
persistence:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.k0smotron.externalAddress }}
externalAddress: {{ .Values.k0smotron.externalAddress }}
{{- end }}
{{- with .Values.k0smotron.etcd }}
etcd:
{{- toYaml . | nindent 4 }}
{{- end }}
service:
type: {{ .Values.k0smotron.service.type }}
apiPort: {{ .Values.k0smotron.service.apiPort }}
konnectivityPort: {{ .Values.k0smotron.service.konnectivityPort }}
{{- with .Values.k0smotron.service.annotations }}
annotations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.k0smotron.k0sConfig }}
k0sConfig:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
metadata:
name: k0s
spec:
telemetry:
enabled: {{ .Values.k0s.telemetry.enabled }}
{{- with .Values.k0s.api }}
api:
{{- with .extraArgs }}
extraArgs:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
network:
provider: {{ .Values.k0s.network.provider }}
podCIDR: {{ index .Values.clusterNetwork.pods.cidrBlocks 0 }}
serviceCIDR: {{ index .Values.clusterNetwork.services.cidrBlocks 0 }}
{{- if eq .Values.k0s.network.provider "calico" }}
calico:
mode: {{ .Values.k0s.network.calico.mode }}
{{- if .Values.k0s.network.calico.ipAutodetectionMethod }}
ipAutodetectionMethod: {{ .Values.k0s.network.calico.ipAutodetectionMethod }}
{{- end }}
{{- end }}
{{- end }}