Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions charts/proxmox-hosted-cp/.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/
24 changes: 24 additions & 0 deletions charts/proxmox-hosted-cp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: proxmox-hosted-cp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: proxmox-hosted-cp
name: capi-infra-proxmox

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the directory name as well.

Copy link
Contributor Author

@shivani446 shivani446 Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/k0rdent/kcm/tree/main/templates/cluster
In the repo which is already having the clustertemplate charts have convention like this when naming so i just added that name so that whenever the template is applied our chart have the same convention like all the other cluster template charts but we can change it

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: 0.1.0
version: 1.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/k0rdent/kcm/tree/main/templates/cluster
I have took the reference of this chart for the the same but will be changing it


# 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"
23 changes: 23 additions & 0 deletions charts/proxmox-hosted-cp/templates/clusters.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
28 changes: 28 additions & 0 deletions charts/proxmox-hosted-cp/templates/proxmox-cluster.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 26 additions & 0 deletions charts/proxmox-hosted-cp/templates/proxmoxmachinetemplate.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
36 changes: 36 additions & 0 deletions charts/proxmox-hosted-cp/templates/taloscontrolplane.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Comment on lines +19 to +36
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be templatized with default values in values.yml

75 changes: 75 additions & 0 deletions charts/proxmox-hosted-cp/values.yaml
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +4 to +12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three should be templatized independently


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
Comment on lines +14 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be templatized.


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
Comment on lines +37 to +58
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be templatized


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
Comment on lines +60 to +73
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be templatized. Could be anything other than Talos.



Check failure on line 75 in charts/proxmox-hosted-cp/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.24.17)

75:1 [empty-lines] too many blank lines (2 > 0)

Check failure on line 75 in charts/proxmox-hosted-cp/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.26.15)

75:1 [empty-lines] too many blank lines (2 > 0)

Check failure on line 75 in charts/proxmox-hosted-cp/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.28.15)

75:1 [empty-lines] too many blank lines (2 > 0)

Check failure on line 75 in charts/proxmox-hosted-cp/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.30.10)

75:1 [empty-lines] too many blank lines (2 > 0)

Check failure on line 75 in charts/proxmox-hosted-cp/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.31.6)

75:1 [empty-lines] too many blank lines (2 > 0)
Loading