Skip to content

Instantly share code, notes, and snippets.

@tonnyadhi
Last active November 11, 2022 08:41
Show Gist options
  • Save tonnyadhi/c2d980de96ae71c2d3be67ba31e88a6e to your computer and use it in GitHub Desktop.
Save tonnyadhi/c2d980de96ae71c2d3be67ba31e88a6e to your computer and use it in GitHub Desktop.
Local Storage Provisioner EKS K8S - XFS Filesystem
---
# Source: provisioner/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: local-static-provisioner
namespace: kube-system
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-provisioner
---
# Source: provisioner/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: local-static-provisioner-config
namespace: kube-system
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-provisioner
data:
storageClassMap: |
nvme-ssd:
hostDir: /dev/disk/kubernetes
mountDir: /dev/disk/kubernetes
fsType: xfs
namePattern: "*"
blockCleanerCommand:
- "/scripts/shred.sh"
- "1"
volumeMode: Filesystem
---
# Source: provisioner/templates/storageclass.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nvme-ssd
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-provisioner
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
parameters:
fsType: xfs
---
# Source: provisioner/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: local-static-provisioner-node-clusterrole
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-provisioner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["watch"]
- apiGroups: ["", "events.k8s.io"]
resources: ["events"]
verbs: ["create", "update", "patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get"]
---
# Source: provisioner/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: local-static-provisioner-node-binding
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-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_linux.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: local-static-provisioner
namespace: kube-system
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-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
annotations:
checksum/config: 9020bc1a8cc0d5f9d8448c43038ddd5c545eb18c2bb01d6fb8136ffe2fd78e09
spec:
serviceAccountName: local-static-provisioner
nodeSelector:
kubernetes.io/os: linux
tolerations:
- key: "redpanda"
value: "redpandaNode"
effect: "NoSchedule"
- key: "materialize"
value: "materializeNode"
effect: "NoSchedule"
containers:
- name: provisioner
image: k8s.gcr.io/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: k8s.gcr.io/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: nvme-ssd
mountPath: /dev/disk/kubernetes
mountPropagation: HostToContainer
volumes:
- name: provisioner-config
configMap:
name: local-static-provisioner-config
- name: provisioner-dev
hostPath:
path: /dev
- name: nvme-ssd
hostPath:
path: /dev/disk/kubernetes
---
# Source: provisioner/templates/daemonset_windows.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: local-static-provisioner-win
namespace: kube-system
labels:
helm.sh/chart: provisioner-2.6.0-alpha.1
app.kubernetes.io/name: provisioner
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: local-static-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
annotations:
checksum/config: 9020bc1a8cc0d5f9d8448c43038ddd5c545eb18c2bb01d6fb8136ffe2fd78e09
spec:
serviceAccountName: local-static-provisioner
nodeSelector:
kubernetes.io/os: windows
tolerations:
# an empty key operator Exists matches all keys, values and effects
# which meants that this will tolerate everything
- operator: "Exists"
containers:
- name: provisioner
image: k8s.gcr.io/sig-storage/local-volume-provisioner:v2.4.0
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: JOB_CONTAINER_IMAGE
value: k8s.gcr.io/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: nvme-ssd
mountPath: /dev/disk/kubernetes
mountPropagation: HostToContainer
- name: csi-proxy-volume-v1
mountPath: \\.\pipe\csi-proxy-volume-v1
- name: csi-proxy-filesystem-v1
mountPath: \\.\pipe\csi-proxy-filesystem-v1
# these csi-proxy paths are still included for compatibility, they're used
# only if the node has still the beta version of the CSI proxy
- name: csi-proxy-volume-v1beta2
mountPath: \\.\pipe\csi-proxy-volume-v1beta2
- name: csi-proxy-filesystem-v1beta2
mountPath: \\.\pipe\csi-proxy-filesystem-v1beta2
volumes:
- name: csi-proxy-volume-v1
hostPath:
path: \\.\pipe\csi-proxy-volume-v1
type: ""
- name: csi-proxy-filesystem-v1
hostPath:
path: \\.\pipe\csi-proxy-filesystem-v1
type: ""
# these csi-proxy paths are still included for compatibility, they're used
# only if the node has still the beta version of the CSI proxy
- name: csi-proxy-volume-v1beta2
hostPath:
path: \\.\pipe\csi-proxy-volume-v1beta2
type: ""
- name: csi-proxy-filesystem-v1beta2
hostPath:
path: \\.\pipe\csi-proxy-filesystem-v1beta2
type: ""
- name: provisioner-config
configMap:
name: local-static-provisioner-config
- name: provisioner-dev
hostPath:
path: "C:\\dev"
# If nothing exists at the given path, an empty directory will be
# created there as needed with permission set to 0755,
# having the same group and ownership with Kubelet.
type: DirectoryOrCreate
- name: nvme-ssd
hostPath:
path: /dev/disk/kubernetes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment