146 lines
3.9 KiB
YAML
146 lines
3.9 KiB
YAML
|
{{ if .vars.local_storage_class }}
|
|||
|
---
|
|||
|
# Source: provisioner/templates/serviceaccount.yaml
|
|||
|
apiVersion: v1
|
|||
|
kind: ServiceAccount
|
|||
|
metadata:
|
|||
|
name: local-static-provisioner
|
|||
|
namespace: kube-system
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
---
|
|||
|
# Source: provisioner/templates/configmap.yaml
|
|||
|
apiVersion: v1
|
|||
|
kind: ConfigMap
|
|||
|
metadata:
|
|||
|
name: local-static-provisioner-config
|
|||
|
namespace: kube-system
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
data:
|
|||
|
storageClassMap: |
|
|||
|
"{{ .vars.local_storage_class }}":
|
|||
|
hostDir: /mnt/storage
|
|||
|
mountDir: /mnt/storage
|
|||
|
blockCleanerCommand:
|
|||
|
- "/scripts/quick_reset.sh"
|
|||
|
# - "/scripts/blkdiscard.sh"
|
|||
|
# [ "/scripts/shred.sh", "2" ]
|
|||
|
volumeMode: Filesystem
|
|||
|
---
|
|||
|
apiVersion: storage.k8s.io/v1
|
|||
|
kind: StorageClass
|
|||
|
metadata:
|
|||
|
name: "{{ .vars.local_storage_class }}"
|
|||
|
provisioner: kubernetes.io/no-provisioner
|
|||
|
volumeBindingMode: WaitForFirstConsumer
|
|||
|
# Supported policies: Delete, Retain
|
|||
|
reclaimPolicy: Delete
|
|||
|
---
|
|||
|
# Source: provisioner/templates/rbac.yaml
|
|||
|
apiVersion: rbac.authorization.k8s.io/v1
|
|||
|
kind: ClusterRole
|
|||
|
metadata:
|
|||
|
name: local-static-provisioner-node-clusterrole
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
rules:
|
|||
|
- apiGroups: [""]
|
|||
|
resources: ["nodes"]
|
|||
|
verbs: ["get"]
|
|||
|
---
|
|||
|
# Source: provisioner/templates/rbac.yaml
|
|||
|
apiVersion: rbac.authorization.k8s.io/v1
|
|||
|
kind: ClusterRoleBinding
|
|||
|
metadata:
|
|||
|
name: local-static-provisioner-pv-binding
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
subjects:
|
|||
|
- kind: ServiceAccount
|
|||
|
name: local-static-provisioner
|
|||
|
namespace: kube-system
|
|||
|
roleRef:
|
|||
|
kind: ClusterRole
|
|||
|
name: system:persistent-volume-provisioner
|
|||
|
apiGroup: rbac.authorization.k8s.io
|
|||
|
---
|
|||
|
# Source: provisioner/templates/rbac.yaml
|
|||
|
apiVersion: rbac.authorization.k8s.io/v1
|
|||
|
kind: ClusterRoleBinding
|
|||
|
metadata:
|
|||
|
name: local-static-provisioner-node-binding
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
subjects:
|
|||
|
- kind: ServiceAccount
|
|||
|
name: local-static-provisioner
|
|||
|
namespace: kube-system
|
|||
|
roleRef:
|
|||
|
kind: ClusterRole
|
|||
|
name: local-static-provisioner-node-clusterrole
|
|||
|
apiGroup: rbac.authorization.k8s.io
|
|||
|
---
|
|||
|
# Source: provisioner/templates/daemonset.yaml
|
|||
|
apiVersion: apps/v1
|
|||
|
kind: DaemonSet
|
|||
|
metadata:
|
|||
|
name: local-static-provisioner
|
|||
|
namespace: kube-system
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
spec:
|
|||
|
selector:
|
|||
|
matchLabels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
app.kubernetes.io/instance: local-static-provisioner
|
|||
|
template:
|
|||
|
metadata:
|
|||
|
labels:
|
|||
|
app.kubernetes.io/name: provisioner
|
|||
|
app.kubernetes.io/instance: local-static-provisioner
|
|||
|
spec:
|
|||
|
serviceAccountName: local-static-provisioner
|
|||
|
# TODO remove after transition
|
|||
|
nodeSelector:
|
|||
|
local-pv: "true"
|
|||
|
containers:
|
|||
|
- name: provisioner
|
|||
|
image: {{.vars.k8s_registry}}/sig-storage/local-volume-provisioner:v2.4.0
|
|||
|
securityContext:
|
|||
|
privileged: true
|
|||
|
env:
|
|||
|
- name: MY_NODE_NAME
|
|||
|
valueFrom:
|
|||
|
fieldRef:
|
|||
|
fieldPath: spec.nodeName
|
|||
|
- name: MY_NAMESPACE
|
|||
|
valueFrom:
|
|||
|
fieldRef:
|
|||
|
fieldPath: metadata.namespace
|
|||
|
- name: JOB_CONTAINER_IMAGE
|
|||
|
value: {{.vars.k8s_registry}}/sig-storage/local-volume-provisioner:v2.4.0
|
|||
|
ports:
|
|||
|
- name: metrics
|
|||
|
containerPort: 8080
|
|||
|
volumeMounts:
|
|||
|
- name: provisioner-config
|
|||
|
mountPath: /etc/provisioner/config
|
|||
|
readOnly: true
|
|||
|
- name: provisioner-dev
|
|||
|
mountPath: /dev
|
|||
|
- name: local-storage
|
|||
|
mountPath: /mnt/storage
|
|||
|
mountPropagation: HostToContainer
|
|||
|
volumes:
|
|||
|
- name: provisioner-config
|
|||
|
configMap:
|
|||
|
name: local-static-provisioner-config
|
|||
|
- name: provisioner-dev
|
|||
|
hostPath:
|
|||
|
path: /dev
|
|||
|
- name: local-storage
|
|||
|
hostPath:
|
|||
|
path: /mnt/storage
|
|||
|
{{ end }}
|