Skip to content

Commit

Permalink
Release pixiu localstorage v1.0.3 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
caoyingjunz authored Aug 6, 2023
1 parent 0d72703 commit 971bce9
Show file tree
Hide file tree
Showing 8 changed files with 400 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This driver allows Kubernetes to access LocalStorage on Linux node.
### Installation
- 选择运行 `localstorage``kubernetes` 节点
```shell
kubectl label node <node-name> storage.caoyingjunz.io/node=
kubectl label node <node-name> storage.caoyingjunz.io/node=
```

- 安装 `localstorage` 组件
Expand Down
47 changes: 47 additions & 0 deletions deploy/v1.0.3/ls-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: pixiu-ls-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: pixiu-ls-controller
template:
metadata:
labels:
app: pixiu-ls-controller
spec:
serviceAccountName: csi-ls-node-sa
containers:
- args:
- -v=2
# port's value equals 0 means health check func disabled
- --healthz-port=10258
- --cert-dir=/tmp/cert
- --port=8443
image: pixiuio/localstorage-controller:v1.0.3
imagePullPolicy: Always
name: ls-controller
volumeMounts:
- mountPath: /tmp/cert
name: cert
readOnly: true
livenessProbe:
httpGet:
path: /healthz
port: 10258
failureThreshold: 5
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 5
dnsPolicy: Default
nodeSelector:
kubernetes.io/os: linux
restartPolicy: Always
volumes:
- name: cert
secret:
defaultMode: 420
secretName: pixiu-localstorage-cert
10 changes: 10 additions & 0 deletions deploy/v1.0.3/ls-driverinfo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: localstorage.caoyingjunz.io
spec:
attachRequired: false
volumeLifecycleModes:
- Persistent
fsGroupPolicy: File
164 changes: 164 additions & 0 deletions deploy/v1.0.3/ls-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: pixiu-ls-node
namespace: kube-system
spec:
updateStrategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app: pixiu-ls-node
template:
metadata:
labels:
app: pixiu-ls-node
spec:
# hostNetwork: true
dnsPolicy: Default # available values: Default, ClusterFirstWithHostNet, ClusterFirst
serviceAccountName: csi-ls-node-sa
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: storage.caoyingjunz.io/node
operator: Exists
tolerations:
- operator: "Exists"
containers:
- name: liveness-probe
image: pixiuio/livenessprobe:v2.8.0
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=29653
- --v=2
volumeMounts:
- name: socket-dir
mountPath: /csi
resources:
limits:
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi

- name: node-driver-registrar
image: pixiuio/csi-node-driver-registrar:v2.6.2
args:
- --v=2
- --csi-address=/csi/csi.sock
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
livenessProbe:
exec:
command:
- /csi-node-driver-registrar
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --mode=kubelet-registration-probe
initialDelaySeconds: 30
timeoutSeconds: 15
env:
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/csi-lsplugin/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
resources:
limits:
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi

- name: csi-provisioner
image: jacky06/csi-provisioner:v0.1
args:
- -v=5
- --csi-address=/csi/csi.sock
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
# This is necessary only for systems with SELinux, where
# non-privileged sidecar containers cannot access unix domain socket
# created by privileged CSI driver container.
privileged: true
volumeMounts:
- mountPath: /csi
name: socket-dir

- name: ls-plugin
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: pixiuio/localstorageplugin:v1.0.3
args:
- --endpoint=$(CSI_ENDPOINT)
- --volume-dir=/data
- --create-localstorage
- -v=5
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
ports:
- containerPort: 29653
name: healthz
protocol: TCP
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 30
imagePullPolicy: "Always"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: pods-mount-dir
mountPath: /var/lib/kubelet/pods
mountPropagation: "Bidirectional"
- mountPath: /data
name: volume-dir
resources:
limits:
memory: 300Mi
requests:
cpu: 10m
memory: 20Mi
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-lsplugin
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet/pods
type: Directory
- hostPath:
path: /var/lib/kubelet/plugins_registry
type: Directory
name: registration-dir
- hostPath:
path: /data
type: DirectoryOrCreate
name: volume-dir
70 changes: 70 additions & 0 deletions deploy/v1.0.3/ls-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-ls-node-sa
namespace: kube-system
---

apiVersion: v1
kind: Secret
metadata:
name: pixiu-ls-token
namespace: kube-system
annotations:
kubernetes.io/service-account.name: "csi-ls-node-sa"
type: kubernetes.io/service-account-token
---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ls-external-provisioner-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
- apiGroups: [""]
resources: ["endpoints"]
verbs: [ "get", "list", "watch", "create", "update", "patch" ]
- apiGroups: ["storage.caoyingjunz.io"]
resources: ["localstorages"]
verbs: [ "get", "list", "watch", "create", "update", "patch" ]
---

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ls-csi-provisioner-binding
subjects:
- kind: ServiceAccount
name: csi-ls-node-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: ls-external-provisioner-role
apiGroup: rbac.authorization.k8s.io
10 changes: 10 additions & 0 deletions deploy/v1.0.3/ls-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
data:
ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURwekNDQW8rZ0F3SUJBZ0lVRURBYzkwa1dVUXN5UmJodThlUitzOFlHR3Y4d0RRWUpLb1pJaHZjTkFRRUwKQlFBd0lURWZNQjBHQTFVRUF3d1djR2w0YVhVdGJITXRZMjl1ZEhKdmJHeGxjaUJEUVRBZ0Z3MHlNekEzTVRNeApNekl5TWpaYUdBOHlNVEl6TURZeE9URXpNakl5Tmxvd0xqRXNNQ29HQTFVRUF3d2pjR2w0YVhVdGJITXRZMjl1CmRISnZiR3hsY2k1cmRXSmxMWE41YzNSbGJTNXp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JObUZUTFdnd1FJUEdzdkwvSXlXbSs4UFF2dzZ0Y2VUdVFjCjBQS2k1eld0UGpwVUVpRXZGM3JPaUdqaG15U2VVQUw0Vld0QUQ4ZmgzY0I3Sk9KcEdQNm5uU3BRbE8rMEo5d1IKalhvV2VmM3lCd2RzcGFPM1Yrd3Vrb2c9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
kind: Secret
metadata:
name: pixiu-localstorage-cert
namespace: kube-system
type: kubernetes.io/tls
30 changes: 30 additions & 0 deletions deploy/v1.0.3/ls-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: pixiu-ls-controller
namespace: kube-system
spec:
ports:
- name: tcp-8443
port: 443
protocol: TCP
targetPort: 8443
selector:
app: pixiu-ls-controller
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
name: pixiu-ls-scheduler
namespace: kube-system
spec:
ports:
- name: tcp-8090
nodePort: 30666
port: 8090
protocol: TCP
targetPort: 8090
selector:
app: pixiu-ls-scheduler
type: NodePort
Loading

0 comments on commit 971bce9

Please sign in to comment.