diff --git a/charts/proxmox-hosted-cp/.helmignore b/charts/proxmox-hosted-cp/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/proxmox-hosted-cp/.helmignore @@ -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/ diff --git a/charts/proxmox-hosted-cp/Chart.yaml b/charts/proxmox-hosted-cp/Chart.yaml new file mode 100644 index 0000000..eb6c9ba --- /dev/null +++ b/charts/proxmox-hosted-cp/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: proxmox-hosted-cp +description: A KCM template to deploy and manage proxmox clusters + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.0.0" diff --git a/charts/proxmox-hosted-cp/templates/clusters.yaml b/charts/proxmox-hosted-cp/templates/clusters.yaml new file mode 100644 index 0000000..3c7edb4 --- /dev/null +++ b/charts/proxmox-hosted-cp/templates/clusters.yaml @@ -0,0 +1,23 @@ +apiVersion: cluster.x-k8s.io/v1beta1 +kind: Cluster +metadata: + name: {{ .Values.cluster.name }} + namespace: {{ .Values.cluster.namespace }} +spec: + clusterNetwork: + pods: + cidrBlocks: + - {{ .Values.cluster.network.podsCidr }} + services: + cidrBlocks: + - {{ .Values.cluster.network.servicesCidr }} + controlPlaneRef: + apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 + kind: TalosControlPlane + name: {{ .Values.cluster.controlPlane.name }} + namespace: {{ .Values.cluster.controlPlane.namespace }} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 + kind: ProxmoxCluster + name: {{ .Values.cluster.infrastructure.name }} + namespace: {{ .Values.cluster.infrastructure.namespace }} diff --git a/charts/proxmox-hosted-cp/templates/proxmox-cluster.yaml b/charts/proxmox-hosted-cp/templates/proxmox-cluster.yaml new file mode 100644 index 0000000..b437c54 --- /dev/null +++ b/charts/proxmox-hosted-cp/templates/proxmox-cluster.yaml @@ -0,0 +1,28 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 +kind: ProxmoxCluster +metadata: + name: {{ .Values.proxmoxCluster.name }} + namespace: {{ .Values.proxmoxCluster.namespace }} +spec: + credentialsRef: + name: {{ .Values.proxmoxCluster.spec.credentialsRef.name }} + allowedNodes: + {{- range .Values.proxmoxCluster.spec.allowedNodes }} + - {{ . }} + {{- end }} + controlPlaneEndpoint: + host: {{ .Values.proxmoxCluster.spec.controlPlaneEndpoint.host }} + port: {{ .Values.proxmoxCluster.spec.controlPlaneEndpoint.port }} + dnsServers: + {{- range .Values.proxmoxCluster.spec.dnsServers }} + - {{ . }} + {{- end }} + ipv4Config: + gateway: {{ .Values.proxmoxCluster.spec.ipv4Config.gateway }} + prefix: {{ .Values.proxmoxCluster.spec.ipv4Config.prefix }} + addresses: + {{- range .Values.proxmoxCluster.spec.ipv4Config.addresses }} + - {{ . }} + {{- end }} + schedulerHints: + memoryAdjustment: {{ .Values.proxmoxCluster.spec.schedulerHints.memoryAdjustment }} diff --git a/charts/proxmox-hosted-cp/templates/proxmoxmachinetemplate.yaml b/charts/proxmox-hosted-cp/templates/proxmoxmachinetemplate.yaml new file mode 100644 index 0000000..77818af --- /dev/null +++ b/charts/proxmox-hosted-cp/templates/proxmoxmachinetemplate.yaml @@ -0,0 +1,26 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 +kind: ProxmoxMachineTemplate +metadata: + name: {{ .Values.proxmoxMachineTemplate.name }} + namespace: {{ .Values.proxmoxMachineTemplate.namespace }} +spec: + template: + spec: + full: {{ .Values.proxmoxMachineTemplate.spec.full }} + sourceNode: {{ .Values.proxmoxMachineTemplate.spec.sourceNode }} + templateID: {{ .Values.proxmoxMachineTemplate.spec.templateID }} + format: {{ .Values.proxmoxMachineTemplate.spec.format }} + numSockets: {{ .Values.proxmoxMachineTemplate.spec.numSockets }} + numCores: {{ .Values.proxmoxMachineTemplate.spec.numCores }} + memoryMiB: {{ .Values.proxmoxMachineTemplate.spec.memoryMiB }} + disks: + bootVolume: + disk: {{ .Values.proxmoxMachineTemplate.spec.disks.bootVolume.disk }} + sizeGb: {{ .Values.proxmoxMachineTemplate.spec.disks.bootVolume.sizeGb }} + network: + default: + bridge: {{ .Values.proxmoxMachineTemplate.spec.network.default.bridge }} + model: {{ .Values.proxmoxMachineTemplate.spec.network.default.model }} + checks: + skipQemuGuestAgent: {{ .Values.proxmoxMachineTemplate.spec.checks.skipQemuGuestAgent }} + skipCloudInitStatus: {{ .Values.proxmoxMachineTemplate.spec.checks.skipCloudInitStatus }} diff --git a/charts/proxmox-hosted-cp/templates/taloscontrolplane.yaml b/charts/proxmox-hosted-cp/templates/taloscontrolplane.yaml new file mode 100644 index 0000000..b4aad3c --- /dev/null +++ b/charts/proxmox-hosted-cp/templates/taloscontrolplane.yaml @@ -0,0 +1,36 @@ +apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 +kind: TalosControlPlane +metadata: + name: {{ .Values.talosControlPlane.name }} + namespace: {{ .Values.talosControlPlane.namespace }} +spec: + replicas: {{ .Values.talosControlPlane.spec.replicas }} + version: {{ .Values.talosControlPlane.spec.version }} + infrastructureTemplate: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 + kind: ProxmoxMachineTemplate + name: {{ .Values.talosControlPlane.spec.infrastructureTemplate.name }} + namespace: {{ .Values.talosControlPlane.spec.infrastructureTemplate.namespace }} + controlPlaneConfig: + controlplane: + talosVersion: {{ .Values.talosControlPlane.spec.controlPlaneConfig.controlplane.talosVersion }} + generateType: {{ .Values.talosControlPlane.spec.controlPlaneConfig.controlplane.generateType }} + strategicPatches: + - | + - op: replace + path: /machine/install + value: + disk: /dev/sda + extensions: + - image: ghcr.io/siderolabs/qemu-guest-agent:9.2.0 + - op: add + path: /machine/install/extraKernelArgs + value: + - net.ifnames=0 + - op: add + path: /machine/network/interfaces + value: + - interface: eth0 + dhcp: false + vip: + ip: {{ .Values.talosControlPlane.spec.controlPlaneConfig.controlplane.ip }} diff --git a/charts/proxmox-hosted-cp/values.yaml b/charts/proxmox-hosted-cp/values.yaml new file mode 100644 index 0000000..3dbc27a --- /dev/null +++ b/charts/proxmox-hosted-cp/values.yaml @@ -0,0 +1,75 @@ +cluster: + name: capi-cluster + namespace: your-namespace + network: + podsCidr: 10.x.x.x/16 + servicesCidr: 10.x.x.x/16 + controlPlane: + name: capi-talos-control-plane + namespace: your-namespace + infrastructure: + name: capi-proxmox-cluster + namespace: your-namespace + +proxmoxCluster: + name: capi-proxmox-cluster + namespace: your-namespace + spec: + credentialsRef: + name: pride-proxmox-credentials + allowedNodes: + - proxmox-node + controlPlaneEndpoint: + host: 10.0.x.x + port: 6443 + dnsServers: + - 10.0.x.x + ipv4Config: + gateway: 10.0.x.x + prefix: 20 + addresses: + - 10.0.x.x + - 10.0.x.x + - 10.0.x.x + schedulerHints: + memoryAdjustment: 0 + +proxmoxMachineTemplate: + name: capi-proxmox-control-plane-machine-template + namespace: your-namespace + spec: + full: true + sourceNode: "proxmox-node" + templateID: 123456 + format: qcow2 + numSockets: 1 + numCores: 4 + memoryMiB: 2048 + disks: + bootVolume: + disk: scsi0 + sizeGb: 8 + network: + default: + bridge: vmbr0 + model: virtio + checks: + skipQemuGuestAgent: true + skipCloudInitStatus: true + +talosControlPlane: + name: capi-talos-control-plane + namespace: your-namespace + spec: + replicas: 1 + version: v1.30.3 + infrastructureTemplate: + name: capi-proxmox-control-plane-machine-template + namespace: your-namespace + controlPlaneConfig: + controlplane: + talosVersion: v1.9.0 + generateType: controlplane + ip: 10.x.x.x + +