Add spiffe-csi driver support
Signed-off-by: Batuhan Apaydın <[email protected]> Co-authored-by: Furkan Türkal <[email protected]> Signed-off-by: Batuhan Apaydın <[email protected]> Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
co-authored by
Furkan Türkal
parent
3a39fe5666
commit
e9912ba39a
@@ -28,7 +28,7 @@ description: |
|
|||||||
```
|
```
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
appVersion: "1.0.2"
|
appVersion: "1.4.4"
|
||||||
keywords: ["spiffe", "spire", "spire-server", "spire-agent"]
|
keywords: ["spiffe", "spire", "spire-server", "spire-agent"]
|
||||||
home: https://github.com/philips-labs/helm-charts/charts/spire
|
home: https://github.com/philips-labs/helm-charts/charts/spire
|
||||||
sources:
|
sources:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# spire
|
# spire
|
||||||
|
|
||||||
  
|
  
|
||||||
|
|
||||||
A Helm chart for deploying spire-server and spire-agent.
|
A Helm chart for deploying spire-server and spire-agent.
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ spec:
|
|||||||
- name: spire-bundle
|
- name: spire-bundle
|
||||||
mountPath: /run/spire/bundle
|
mountPath: /run/spire/bundle
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: spire-agent-sockets
|
- name: spire-agent-socket-dir
|
||||||
mountPath: /run/spire/agent-sockets
|
mountPath: /run/spire/agent-sockets
|
||||||
readOnly: false
|
readOnly: false
|
||||||
- name: spire-token
|
- name: spire-token
|
||||||
@@ -55,6 +55,55 @@ spec:
|
|||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 15
|
initialDelaySeconds: 15
|
||||||
periodSeconds: 60
|
periodSeconds: 60
|
||||||
|
# This is the container which runs the SPIFFE CSI driver.
|
||||||
|
- name: spiffe-csi-driver
|
||||||
|
image: ghcr.io/spiffe/spiffe-csi-driver:nightly
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
args: [
|
||||||
|
"-workload-api-socket-dir", "/spire-agent-socket",
|
||||||
|
"-csi-socket-path", "/spiffe-csi/csi.sock",
|
||||||
|
]
|
||||||
|
env:
|
||||||
|
# The CSI driver needs a unique node ID. The node name can be
|
||||||
|
# used for this purpose.
|
||||||
|
- name: MY_NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
volumeMounts:
|
||||||
|
# The volume containing the SPIRE agent socket. The SPIFFE CSI
|
||||||
|
# driver will mount this directory into containers.
|
||||||
|
- mountPath: /spire-agent-socket
|
||||||
|
name: spire-agent-socket-dir
|
||||||
|
readOnly: true
|
||||||
|
# The volume that will contain the CSI driver socket shared
|
||||||
|
# with the kubelet and the driver registrar.
|
||||||
|
- mountPath: /spiffe-csi
|
||||||
|
name: spiffe-csi-socket-dir
|
||||||
|
# The volume containing mount points for containers.
|
||||||
|
- mountPath: /var/lib/kubelet/pods
|
||||||
|
mountPropagation: Bidirectional
|
||||||
|
name: mountpoint-dir
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# This container runs the CSI Node Driver Registrar which takes care
|
||||||
|
# of all the little details required to register a CSI driver with
|
||||||
|
# the kubelet.
|
||||||
|
- name: node-driver-registrar
|
||||||
|
image: quay.io/k8scsi/csi-node-driver-registrar:v2.0.1
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
args: [
|
||||||
|
"-csi-address", "/spiffe-csi/csi.sock",
|
||||||
|
"-kubelet-registration-path", "/var/lib/kubelet/plugins/csi.spiffe.io/csi.sock",
|
||||||
|
]
|
||||||
|
volumeMounts:
|
||||||
|
# The registrar needs access to the SPIFFE CSI driver socket
|
||||||
|
- mountPath: /spiffe-csi
|
||||||
|
name: spiffe-csi-socket-dir
|
||||||
|
# The registrar needs access to the Kubelet plugin registration
|
||||||
|
# directory
|
||||||
|
- name: kubelet-plugin-registration-dir
|
||||||
|
mountPath: /registration
|
||||||
volumes:
|
volumes:
|
||||||
- name: spire-config
|
- name: spire-config
|
||||||
configMap:
|
configMap:
|
||||||
@@ -73,3 +122,23 @@ spec:
|
|||||||
path: spire-agent
|
path: spire-agent
|
||||||
expirationSeconds: 7200
|
expirationSeconds: 7200
|
||||||
audience: spire-server
|
audience: spire-server
|
||||||
|
- name: spire-agent-socket-dir
|
||||||
|
hostPath:
|
||||||
|
path: /run/spire/agent-sockets
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
# This volume is where the socket for kubelet->driver communication lives
|
||||||
|
- name: spiffe-csi-socket-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/plugins/csi.spiffe.io
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
# This volume is where the SPIFFE CSI driver mounts volumes
|
||||||
|
- name: mountpoint-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/pods
|
||||||
|
type: Directory
|
||||||
|
# This volume is where the node-driver-registrar registers the plugin
|
||||||
|
# with kubelet
|
||||||
|
- name: kubelet-plugin-registration-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/plugins_registry
|
||||||
|
type: Directory
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ rules:
|
|||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["pods", "nodes"]
|
resources: ["pods", "nodes"]
|
||||||
verbs: ["get", "list", "watch"]
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["coordination.k8s.io"]
|
||||||
|
resources: ["leases"]
|
||||||
|
verbs: ["create", "update", "delete", "get", "list", "watch"]
|
||||||
|
|
||||||
---
|
---
|
||||||
# Binds above cluster role to spire-server service account
|
# Binds above cluster role to spire-server service account
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: CSIDriver
|
||||||
|
metadata:
|
||||||
|
name: "csi.spiffe.io"
|
||||||
|
spec:
|
||||||
|
# Only ephemeral, inline volumes are supported. There is no need for a
|
||||||
|
# controller to provision and attach volumes.
|
||||||
|
attachRequired: false
|
||||||
|
|
||||||
|
# Request the pod information which the CSI driver uses to verify that an
|
||||||
|
# ephemeral mount was requested.
|
||||||
|
podInfoOnMount: true
|
||||||
|
|
||||||
|
# Don't change ownership on the contents of the mount since the Workload API
|
||||||
|
# Unix Domain Socket is typically open to all (i.e. 0777).
|
||||||
|
fsGroupPolicy: None
|
||||||
|
|
||||||
|
# Declare support for ephemeral volumes only.
|
||||||
|
volumeLifecycleModes:
|
||||||
|
- Ephemeral
|
||||||
Reference in New Issue
Block a user