Skip to content

Commit e2f2d6d

Browse files
authored
Merge pull request #2 from /issues/1
use secrets not in the chart
2 parents 43a5a78 + 334b277 commit e2f2d6d

File tree

6 files changed

+15
-48
lines changed

6 files changed

+15
-48
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ The implementation uses hash-suffixed templates, `ProxmoxMachineTemplate` and `K
5353
2. Run: `helm upgrade my-cluster ./cluster-api-kamaji-proxmox`
5454
3. Cluster API automatically replaces nodes using the new configuration
5555

56-
57-
5856
### Cluster Autoscaler Integration
5957

6058
The chart includes support for enabling the Cluster Autoscaler for each node pool. This feature allows you to mark node pool machines to be autoscaled. However, you still need to install the Cluster Autoscaler separately.
@@ -122,17 +120,17 @@ export PROXMOX_TOKEN: "clastix@pam!capi" # The Proxmox VE TokenID for aut
122120
export PROXMOX_SECRET: "REDACTED" # The secret associated with the TokenID
123121
```
124122

125-
Then you can leave the chart to create the secret for you by filling the proper fields in your `values.yaml` or you can create the secret manually.
123+
Then you create the secret manually:
126124

127125
```bash
128126
# Create the proxmox secret for Cluster API
129127
cat <<EOF | kubectl apply -f -
130128
apiVersion: v1
131129
kind: Secret
132130
metadata:
133-
name: proxmox-secret
131+
name: sample-proxmox-secret
134132
labels:
135-
cluster.x-k8s.io/cluster-name: "my-cluster"
133+
cluster.x-k8s.io/cluster-name: "sample"
136134
stringData:
137135
url: "${PROXMOX_URL}"
138136
token: "${PROXMOX_TOKEN}"
@@ -148,8 +146,9 @@ and reference it in your `values.yaml`:
148146
# Using existing secrets
149147
proxmox:
150148
secret:
151-
create: false
152-
name: proxmox-secret
149+
name: sample-proxmox-secret
150+
# -- omitting namespace will use the release namespace
151+
namespace: default
153152
```
154153
155154
## Usage

charts/capi-kamaji-proxmox/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ A Helm chart for deploying a Kamaji Tenant Cluster on Proxmox VE using Cluster A
7575
| nodePools[0].storage | string | `"local"` | Proxmox VE storage name for full clone |
7676
| nodePools[0].templateId | int | `100` | Proxmox VE template ID to clone |
7777
| nodePools[0].users | list | `[{"name":"clastix","sshAuthorizedKeys":[],"sudo":"ALL=(ALL) NOPASSWD:ALL"}]` | users to create on machines |
78-
| proxmox.secret | object | `{"create":true,"name":"proxmox-secret"}` | Create a secret with the Proxmox VE credentials |
79-
| proxmox.secret.create | bool | `true` | Specifies whether credentials secret should be created from config values |
80-
| proxmox.secret.name | string | `"proxmox-secret"` | The name of an existing credentials secret for Proxmox VE. |
81-
| proxmox.tokenId | string | `"clastix@pam!capi"` | Proxmox VE TokenID for authentication |
82-
| proxmox.tokenSecret | string | `"READCTED"` | Proxmox VE TokenSecret for authentication |
83-
| proxmox.url | string | `"https://proxmox.pve:8006"` | Proxmox VE hostname or IP address |
78+
| proxmox.secret | object | `{"name":"proxmox-secret","namespace":""}` | Proxmox VE credentials |
79+
| proxmox.secret.name | string | `"proxmox-secret"` | The name of an existing credentials secret for Proxmox VE. |
80+
| proxmox.secret.namespace | string | `""` | The namespace of the existing credentials secret for Proxmox VE. When null or empty the release namespace will be used. |
8481

8582
----------------------------------------------
8683
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

charts/capi-kamaji-proxmox/templates/_helpers.tpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,3 @@
88
{{- default .Release.Name .Values.cluster.name | trunc 63 | trimSuffix "-" }}
99
{{- end -}}
1010

11-
{{/* Proxmox VE secret name used by ClusterAPI */}}
12-
{{- define "cluster-api-kamaji-proxmox.proxmox-secret-name" -}}
13-
{{- if .Values.proxmox.secret.create -}}
14-
{{- printf "%s-proxmox-secret" (include "cluster-api-kamaji-proxmox.cluster-name" .) -}}
15-
{{- else -}}
16-
{{- .Values.proxmox.secret.name | default "proxmox-secret" -}}
17-
{{- end -}}
18-
{{- end -}}
19-

charts/capi-kamaji-proxmox/templates/proxmox-cluster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ metadata:
77
namespace: {{ .Release.Namespace }}
88
spec:
99
credentialsRef:
10-
name: {{ include "cluster-api-kamaji-proxmox.proxmox-secret-name" . }}
11-
namespace: {{ .Release.Namespace }}
10+
name: {{ .Values.proxmox.secret.name }}
11+
namespace: {{ .Values.proxmox.secret.namespace | default .Release.Namespace }}
1212
externalManagedControlPlane: true
1313
ipv4Config:
1414
addresses:

charts/capi-kamaji-proxmox/templates/proxmox-secret.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

charts/capi-kamaji-proxmox/values.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
proxmox:
2-
# -- Create a secret with the Proxmox VE credentials
2+
# -- Proxmox VE credentials
33
secret:
4-
# -- Specifies whether credentials secret should be created from config values
5-
create: true
6-
# -- The name of an existing credentials secret for Proxmox VE.
4+
# -- The name of an existing credentials secret for Proxmox VE.
75
name: proxmox-secret
8-
# -- Proxmox VE hostname or IP address
9-
url: https://proxmox.pve:8006
10-
# -- Proxmox VE TokenID for authentication
11-
tokenId: 'clastix@pam!capi'
12-
# -- Proxmox VE TokenSecret for authentication
13-
tokenSecret: READCTED
6+
# -- The namespace of the existing credentials secret for Proxmox VE. When null or empty the release namespace will be used.
7+
namespace: ""
148

159
ipamProvider:
1610
# -- Enable the IPAMProvider usage

0 commit comments

Comments
 (0)