Change socket mounts for more control (readonly)

pods like oidc mount more then one of these sockets, now we can control readonly vs non readonly better

Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
Marco Franssen
2023-02-18 13:04:01 +01:00
committed by Marco Franssen
parent f2d7aa1f62
commit 4d3fb47839
9 changed files with 16 additions and 20 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
1. Get the currently registered SPIFFE entries from the server: 1. Get the currently registered SPIFFE entries from the server:
kubectl exec -n {{ .Release.Namespace }} {{ include "spire.fullname" . }}-server-0 -c spire-server -- \ kubectl exec -n {{ .Release.Namespace }} {{ include "spire.fullname" . }}-server-0 -c spire-server -- \
bin/spire-server entry show -socketPath {{ include "spire.sockets" . }}/registration.sock bin/spire-server entry show -socketPath /run/spire/server-sockets/registration.sock
-4
View File
@@ -120,7 +120,3 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }} {{- default "default" .Values.serviceAccount.name }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "spire.sockets" -}}
{{- "/run/spire/sockets" -}}
{{- end -}}
+1 -1
View File
@@ -10,7 +10,7 @@ data:
log_level = "{{ .Values.spire.agent.logLevel }}" log_level = "{{ .Values.spire.agent.logLevel }}"
server_address = "{{ include "spire.fullname" . }}-server" server_address = "{{ include "spire.fullname" . }}-server"
server_port = "{{ .Values.server.service.port }}" server_port = "{{ .Values.server.service.port }}"
socket_path = "/run/spire/sockets/agent.sock" socket_path = "/run/spire/agent-sockets/agent.sock"
trust_bundle_path = "/run/spire/bundle/bundle.crt" trust_bundle_path = "/run/spire/bundle/bundle.crt"
trust_domain = {{ .Values.spire.trustDomain | quote }} trust_domain = {{ .Values.spire.trustDomain | quote }}
} }
+4 -4
View File
@@ -38,8 +38,8 @@ spec:
- name: spire-bundle - name: spire-bundle
mountPath: /run/spire/bundle mountPath: /run/spire/bundle
readOnly: true readOnly: true
- name: spire-agent-socket - name: spire-agent-sockets
mountPath: /run/spire/sockets mountPath: /run/spire/agent-sockets
readOnly: false readOnly: false
- name: spire-token - name: spire-token
mountPath: /var/run/secrets/tokens mountPath: /var/run/secrets/tokens
@@ -62,9 +62,9 @@ spec:
- name: spire-bundle - name: spire-bundle
configMap: configMap:
name: {{ include "spire.fullname" . }}-bundle name: {{ include "spire.fullname" . }}-bundle
- name: spire-agent-socket - name: spire-agent-sockets
hostPath: hostPath:
path: /run/spire/sockets path: /run/spire/agent-sockets
type: DirectoryOrCreate type: DirectoryOrCreate
- name: spire-token - name: spire-token
projected: projected:
+5 -5
View File
@@ -46,9 +46,9 @@ spec:
- containerPort: 443 - containerPort: 443
name: https name: https
volumeMounts: volumeMounts:
- name: spire-agent-socket - name: spire-oidc-sockets
mountPath: {{ include "spire.sockets" . }} mountPath: /run/spire/oidc-sockets
readOnly: true readOnly: false
- name: spire-oidc-config - name: spire-oidc-config
mountPath: /run/spire/oidc/config/ mountPath: /run/spire/oidc/config/
readOnly: true readOnly: true
@@ -64,9 +64,9 @@ spec:
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
volumes: volumes:
- name: spire-agent-socket - name: spire-oidc-sockets
hostPath: hostPath:
path: /run/spire/sockets path: /run/spire/oidc-sockets
type: DirectoryOrCreate type: DirectoryOrCreate
- name: spire-oidc-config - name: spire-oidc-config
configMap: configMap:
@@ -18,7 +18,7 @@ data:
email = "{{ .Values.oidc.acme.emailAddress }}" email = "{{ .Values.oidc.acme.emailAddress }}"
} }
workload_api { workload_api {
socket_path = "{{ include "spire.sockets" . }}/agent.sock" socket_path = "/run/spire/agent-sockets/agent.sock"
trust_domain = "{{ .Values.spire.trustDomain }}" trust_domain = "{{ .Values.spire.trustDomain }}"
} }
{{ end }} {{ end }}
+1 -1
View File
@@ -8,7 +8,7 @@ data:
server { server {
bind_address = "0.0.0.0" bind_address = "0.0.0.0"
bind_port = "8081" bind_port = "8081"
socket_path = "{{ include "spire.sockets" . }}/registration.sock" socket_path = "/run/spire/server-sockets/registration.sock"
trust_domain = {{ .Values.spire.trustDomain | quote }} trust_domain = {{ .Values.spire.trustDomain | quote }}
data_dir = "/run/spire/data" data_dir = "/run/spire/data"
log_level = "{{ .Values.spire.server.logLevel }}" log_level = "{{ .Values.spire.server.logLevel }}"
@@ -47,7 +47,7 @@ spec:
protocol: TCP protocol: TCP
volumeMounts: volumeMounts:
- name: spire-server-socket - name: spire-server-socket
mountPath: {{ include "spire.sockets" . }} mountPath: /run/spire/server-sockets
readOnly: false readOnly: false
- name: spire-config - name: spire-config
mountPath: /run/spire/config mountPath: /run/spire/config
@@ -86,7 +86,7 @@ spec:
name: registrar-port name: registrar-port
volumeMounts: volumeMounts:
- name: spire-server-socket - name: spire-server-socket
mountPath: {{ include "spire.sockets" . }} mountPath: /run/spire/server-sockets
readOnly: true readOnly: true
- name: spire-workload-registrar-config - name: spire-workload-registrar-config
mountPath: /run/spire/k8s-workload-registrar/config mountPath: /run/spire/k8s-workload-registrar/config
@@ -9,6 +9,6 @@ data:
mode = "reconcile" mode = "reconcile"
trust_domain = {{ .Values.spire.trustDomain | quote }} trust_domain = {{ .Values.spire.trustDomain | quote }}
cluster = {{ .Values.spire.clusterName | quote }} cluster = {{ .Values.spire.clusterName | quote }}
server_address = "unix://{{ include "spire.sockets" . }}/registration.sock" server_address = "unix:///run/spire/server-sockets/registration.sock"
leader_election = true leader_election = true
metrics_addr = "0.0.0.0:18080" metrics_addr = "0.0.0.0:18080"