Skip to content

Commit

Permalink
Add option for custom certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian-ZH committed Nov 27, 2023
1 parent 7dc75c8 commit 83d9295
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 15 deletions.
Binary file modified assets/metal3/metal3-0.1.0.tgz
Binary file not shown.
Binary file modified assets/metal3/metal3-0.2.0.tgz
Binary file not shown.
7 changes: 6 additions & 1 deletion charts/metal3/0.1.0/charts/ironic/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ data:
{{ end }}
IRONIC_API_BASE_URL: {{ $protocol }}://{{ $ironicApiHost }}
IRONIC_API_HOST: {{ $ironicApiHost }}
IRONIC_EXTERNAL_HTTP_URL: {{ $protocol }}://{{ .Values.global.ironicIP }}:6180
IRONIC_API_HTTPD_SERVER_NAME: {{ $ironicApiHost }}
IRONIC_BOOT_BASE_URL: {{ $protocol }}://{{ $ironicBootHost }}
IRONIC_ENDPOINT: {{ $protocol }}://{{ $ironicApiHost }}/v1/
Expand All @@ -59,8 +58,14 @@ data:
IRONIC_REVERSE_PROXY_SETUP: "false"
IRONIC_USE_MARIADB: "true"
LISTEN_ALL_INTERFACES: "true"
{{- if ( .Values.global.enable_tls ) }}
RESTART_CONTAINER_CERTIFICATE_UPDATED: "true"
IRONIC_KERNEL_PARAMS: console=ttyS0 suse.cafile={{ $protocol }}://{{ $ironicBootHost }}/tstcerts/ca.crt
IPA_INSECURE: "0"
{{- else }}
RESTART_CONTAINER_CERTIFICATE_UPDATED: "false"
IRONIC_KERNEL_PARAMS: console=ttyS0
IPA_INSECURE: "1"
{{- end }}
DATABASE_HOST: {{ .Values.global.database_clusterIP }}
#DATABASE_HOST: "127.0.0.1"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.global.enable_tls }}
{{- if and (.Values.global.enable_ironic) (.Values.global.enable_tls) -}}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/metal3/0.2.0/charts/ironic/templates/issuers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.global.enable_tls }}
{{- if and (.Values.global.enable_ironic) (.Values.global.enable_tls) -}}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
Expand Down
16 changes: 16 additions & 0 deletions charts/metal3/0.2.0/charts/ironic/templates/secret-tls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if and .Values.global.enable_ironic .Values.global.enable_tls
(ne .Values.tlscerts.crt "")
(ne .Values.tlscerts.key "")
(ne .Values.tlscerts.cacert "") -}}
apiVersion: v1
kind: Secret
metadata:
name: ironic-cacert
labels:
{{- include "ironic.labels" . | nindent 4 }}
type: Opaque
data:
tls.crt: {{ .Values.tlscerts.crt | toString | b64enc }}
tls.key: {{ .Values.tlscerts.key | toString | b64enc }}
ca.crt: {{ .Values.tlscerts.cacert | toString | b64enc }}
{{- end }}
5 changes: 4 additions & 1 deletion charts/metal3/0.2.0/charts/ironic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ baremetaloperator:
debug:
ironicRamdiskSshKey: ""

tlscerts: {}
tlscerts:
cacert: ""
key: ""
crt: ""

persistence:
ironic:
Expand Down
6 changes: 4 additions & 2 deletions charts/metal3/0.2.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ global:
# IP on which the Ironic services will be exposed
ironicIP: ""

vmediaTLSPort: 6185

# whether to enable media server.
enable_metal3_media_server: false

Expand All @@ -24,8 +22,12 @@ global:
# enabled.
enable_ironic: true

# whether to enable tls
enable_tls: true

# Will be used when tls is enabled
vmediaTLSPort: 6185

# IP address of the router associated with the specified DHCP
# address range
dnsmasqDefaultRouter: ""
Expand Down
8 changes: 4 additions & 4 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ entries:
metal3:
- apiVersion: v2
appVersion: 1.16.0
created: "2023-11-23T14:21:28.421429+02:00"
created: "2023-11-24T12:46:10.349158+02:00"
dependencies:
- alias: metal3-baremetal-operator
name: baremetal-operator
Expand All @@ -86,7 +86,7 @@ entries:
repository: file://./charts/media
version: 0.2.0
description: A Helm chart that installs all of the dependencies needed for Metal3
digest: 5f0538f591d1f1c1832baf56c877f6dccb14a5e5272ecb211166900c17df0ca1
digest: e7e1c405fc02b796f5619d4ff36944f402bea1b5e7e52f90b788939c0981707a
icon: https://github.com/cncf/artwork/raw/master/projects/metal3/icon/color/metal3-icon-color.svg
name: metal3
type: application
Expand All @@ -95,7 +95,7 @@ entries:
version: 0.2.0
- apiVersion: v2
appVersion: 1.16.0
created: "2023-10-17T12:18:02.553438+03:00"
created: "2023-11-27T16:17:13.332203+02:00"
dependencies:
- alias: metal3-baremetal-operator
name: baremetal-operator
Expand Down Expand Up @@ -135,7 +135,7 @@ entries:
repository: file://./charts/powerdns
version: 0.1.0
description: A Helm chart that installs all of the dependencies needed for Metal3
digest: 2795a01e9f4a943eebd692ae6ea580620b023ffbf1591a261dd257f6fe7983e6
digest: 5180dab1485fcb185bf71118d52191d9b67cca19bdf3f10afd5c7e7af691ad13
icon: https://github.com/cncf/artwork/raw/master/projects/metal3/icon/color/metal3-icon-color.svg
name: metal3
type: application
Expand Down
2 changes: 1 addition & 1 deletion packages/ironic/charts/templates/certificates.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.global.enable_tls }}
{{- if and (.Values.global.enable_ironic) (.Values.global.enable_tls) -}}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down
2 changes: 1 addition & 1 deletion packages/ironic/charts/templates/issuers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.global.enable_tls }}
{{- if and (.Values.global.enable_ironic) (.Values.global.enable_tls) -}}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
Expand Down
16 changes: 16 additions & 0 deletions packages/ironic/charts/templates/secret-tls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if and .Values.global.enable_ironic .Values.global.enable_tls
(ne .Values.tlscerts.crt "")
(ne .Values.tlscerts.key "")
(ne .Values.tlscerts.cacert "") -}}
apiVersion: v1
kind: Secret
metadata:
name: ironic-cacert
labels:
{{- include "ironic.labels" . | nindent 4 }}
type: Opaque
data:
tls.crt: {{ .Values.tlscerts.crt | toString | b64enc }}
tls.key: {{ .Values.tlscerts.key | toString | b64enc }}
ca.crt: {{ .Values.tlscerts.cacert | toString | b64enc }}
{{- end }}
5 changes: 4 additions & 1 deletion packages/ironic/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ baremetaloperator:
debug:
ironicRamdiskSshKey: ""

tlscerts: {}
tlscerts:
cacert: ""
key: ""
crt: ""

persistence:
ironic:
Expand Down
6 changes: 4 additions & 2 deletions packages/metal3/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ global:
# IP on which the Ironic services will be exposed
ironicIP: ""

vmediaTLSPort: 6185

# whether to enable media server.
enable_metal3_media_server: false

Expand All @@ -24,8 +22,12 @@ global:
# enabled.
enable_ironic: true

# whether to enable tls
enable_tls: true

# Will be used when tls is enabled
vmediaTLSPort: 6185

# IP address of the router associated with the specified DHCP
# address range
dnsmasqDefaultRouter: ""
Expand Down

0 comments on commit 83d9295

Please sign in to comment.