Improve Chart API (#119)

Because we are already in the context of spire-agent the API looks more
logical to not have another 'agent' part in the name.

Furthermore to make it more clear the oidc provider only requires the
name of the socket as opposed to the entire path like in the other
charts I made that more explicit in the name of the value.

---------

Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
Marco Franssen
2023-03-14 09:55:24 -07:00
committed by GitHub
parent 03db6bb5fe
commit 5fdd35b426
10 changed files with 15 additions and 11 deletions
@@ -15,7 +15,7 @@ A Helm chart to install the SPIFFE OIDC discovery provider.
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| affinity | object | `{}` | | | affinity | object | `{}` | |
| agentSocket | string | `"spire-agent.sock"` | | | agentSocketName | string | `"spire-agent.sock"` | |
| autoscaling.enabled | bool | `false` | | | autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `5` | | | autoscaling.maxReplicas | int | `5` | |
| autoscaling.minReplicas | int | `1` | | | autoscaling.minReplicas | int | `1` | |
@@ -83,3 +83,7 @@ Create the name of the service account to use
{{- printf "%s/%s" .image.registry .image.repository -}} {{- printf "%s/%s" .image.registry .image.repository -}}
{{- end -}} {{- end -}}
{{- end }} {{- end }}
{{- define "spiffe-oidc-discovery-provider.workload-api-socket-path" -}}
{{- printf "/spiffe-workload-api/%s" .Values.agentSocketName }}
{{- end }}
@@ -30,7 +30,7 @@ data:
{{- end }} {{- end }}
workload_api { workload_api {
socket_path = "/spiffe-workload-api/{{ .Values.agentSocket }}" socket_path = {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | quote }}
trust_domain = "{{ .Values.trustDomain }}" trust_domain = "{{ .Values.trustDomain }}"
} }
@@ -48,7 +48,7 @@ spec:
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: spiffe-workload-api - name: spiffe-workload-api
mountPath: /spiffe-workload-api mountPath: {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | dir }}
readOnly: true readOnly: true
- name: spire-oidc-sockets - name: spire-oidc-sockets
mountPath: /run/spire/oidc-sockets mountPath: /run/spire/oidc-sockets
@@ -2,7 +2,7 @@
# This is a YAML-formatted file. # This is a YAML-formatted file.
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
agentSocket: spire-agent.sock agentSocketName: spire-agent.sock
replicaCount: 1 replicaCount: 1
+1 -1
View File
@@ -14,7 +14,6 @@ A Helm chart to install the SPIRE agent.
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| agentSocketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | |
| bundleConfigMap | string | `"spire-bundle"` | | | bundleConfigMap | string | `"spire-bundle"` | |
| clusterName | string | `"example-cluster"` | | | clusterName | string | `"example-cluster"` | |
| extraContainers | list | `[]` | | | extraContainers | list | `[]` | |
@@ -43,6 +42,7 @@ A Helm chart to install the SPIRE agent.
| serviceAccount.annotations | object | `{}` | | | serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | | | serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | | | serviceAccount.name | string | `""` | |
| socketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | |
| telemetry.prometheus.enabled | bool | `false` | | | telemetry.prometheus.enabled | bool | `false` | |
| telemetry.prometheus.port | int | `9988` | | | telemetry.prometheus.port | int | `9988` | |
| trustDomain | string | `"example.org"` | | | trustDomain | string | `"example.org"` | |
@@ -100,6 +100,6 @@ Create the name of the service account to use
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "spire-agent.agent-socket-path" -}} {{- define "spire-agent.socket-path" -}}
{{- print .Values.agentSocketPath }} {{- print .Values.socketPath }}
{{- end }} {{- end }}
@@ -10,7 +10,7 @@ data:
log_level = {{ .Values.logLevel | quote }} log_level = {{ .Values.logLevel | quote }}
server_address = {{ include "spire-agent.server-address" . | trim | quote }} server_address = {{ include "spire-agent.server-address" . | trim | quote }}
server_port = {{ .Values.server.port | quote }} server_port = {{ .Values.server.port | quote }}
socket_path = {{ include "spire-agent.agent-socket-path" . | quote }} socket_path = {{ include "spire-agent.socket-path" . | quote }}
trust_bundle_path = "/run/spire/bundle/bundle.crt" trust_bundle_path = "/run/spire/bundle/bundle.crt"
trust_domain = {{ .Values.trustDomain | quote }} trust_domain = {{ .Values.trustDomain | quote }}
} }
@@ -66,7 +66,7 @@ spec:
mountPath: /run/spire/bundle mountPath: /run/spire/bundle
readOnly: true readOnly: true
- name: spire-agent-socket-dir - name: spire-agent-socket-dir
mountPath: {{ include "spire-agent.agent-socket-path" . | dir }} mountPath: {{ include "spire-agent.socket-path" . | dir }}
readOnly: false readOnly: false
- name: spire-token - name: spire-token
mountPath: /var/run/secrets/tokens mountPath: /var/run/secrets/tokens
@@ -110,7 +110,7 @@ spec:
audience: spire-server audience: spire-server
- name: spire-agent-socket-dir - name: spire-agent-socket-dir
hostPath: hostPath:
path: {{ include "spire-agent.agent-socket-path" . | dir }} path: {{ include "spire-agent.socket-path" . | dir }}
type: DirectoryOrCreate type: DirectoryOrCreate
{{- if gt (len .Values.extraVolumes) 0 }} {{- if gt (len .Values.extraVolumes) 0 }}
{{- toYaml .Values.extraVolumes | nindent 8 }} {{- toYaml .Values.extraVolumes | nindent 8 }}
+1 -1
View File
@@ -87,7 +87,7 @@ telemetry:
enabled: false enabled: false
port: 9988 port: 9988
agentSocketPath: /run/spire/agent-sockets/spire-agent.sock socketPath: /run/spire/agent-sockets/spire-agent.sock
# -- Priority class assigned to daemonset pods # -- Priority class assigned to daemonset pods
priorityClassName: "" priorityClassName: ""