k8s-csi-s3/deploy/kubernetes/csi-s3.yaml

141 lines
3.8 KiB
YAML
Raw Normal View History

2018-07-14 08:48:22 +00:00
---
apiVersion: v1
kind: ServiceAccount
metadata:
2018-07-29 12:49:35 +00:00
name: csi-s3
2018-07-14 08:48:22 +00:00
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
2018-07-29 12:49:35 +00:00
name: csi-s3
2018-07-14 08:48:22 +00:00
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "update"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
2018-07-29 12:49:35 +00:00
name: csi-s3
2018-07-14 08:48:22 +00:00
subjects:
- kind: ServiceAccount
2018-07-29 12:49:35 +00:00
name: csi-s3
2018-07-14 08:48:22 +00:00
namespace: default
roleRef:
kind: ClusterRole
2018-07-29 12:49:35 +00:00
name: csi-s3
2018-07-14 08:48:22 +00:00
apiGroup: rbac.authorization.k8s.io
---
kind: DaemonSet
apiVersion: apps/v1beta2
metadata:
2018-07-29 12:49:35 +00:00
name: csi-s3
2018-07-14 08:48:22 +00:00
spec:
selector:
matchLabels:
2018-07-29 12:49:35 +00:00
app: csi-s3
2018-07-14 08:48:22 +00:00
template:
metadata:
labels:
2018-07-29 12:49:35 +00:00
app: csi-s3
2018-07-14 08:48:22 +00:00
spec:
2018-07-29 12:49:35 +00:00
serviceAccount: csi-s3
2018-07-14 08:48:22 +00:00
hostNetwork: true
containers:
- name: driver-registrar
image: quay.io/k8scsi/driver-registrar:v0.2.0
args:
- "--v=4"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: plugin-dir
mountPath: /csi
2018-07-29 12:49:35 +00:00
- name: csi-s3
2018-07-14 08:48:22 +00:00
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
2018-07-29 12:49:35 +00:00
image: ctrox/csi-s3:0.2.0
2018-07-14 08:48:22 +00:00
args:
- "--endpoint=$(CSI_ENDPOINT)"
- "--nodeid=$(NODE_ID)"
- "--access-key-id=$(ACCESS_KEY_ID)"
- "--secret-access-key=$(SECRET_ACCESS_KEY)"
- "--s3-endpoint=$(S3_ENDPOINT)"
- "--region=$(REGION)"
2018-07-16 20:27:45 +00:00
- "--encryption-key=$(ENCRYPTION_KEY)"
2018-07-14 08:48:22 +00:00
- "--v=4"
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: csi-s3-secret
key: accessKeyID
- name: SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: csi-s3-secret
key: secretAccessKey
- name: S3_ENDPOINT
valueFrom:
secretKeyRef:
name: csi-s3-secret
key: endpoint
- name: REGION
valueFrom:
secretKeyRef:
name: csi-s3-secret
key: region
2018-07-16 20:27:45 +00:00
- name: ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: csi-s3-secret
key: encryptionKey
2018-07-14 08:48:22 +00:00
imagePullPolicy: "Always"
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: pods-mount-dir
mountPath: /var/lib/kubelet/pods
mountPropagation: "Bidirectional"
2018-07-26 20:47:36 +00:00
- name: fuse-device
mountPath: /dev/fuse
2018-07-14 08:48:22 +00:00
volumes:
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/ch.ctrox.csi.s3-driver
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet/pods
type: Directory
2018-07-26 20:47:36 +00:00
- name: fuse-device
2018-07-14 08:48:22 +00:00
hostPath:
2018-07-26 20:47:36 +00:00
path: /dev/fuse