-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes 1.16 + ephemeral inline volumes #97
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The deployment for Kubernetes 1.16 enables ephemeral inline volumes via | ||
its CSIDriverInfo and thus is incompatible with Kubernetes < 1.16 | ||
because the `VolumeLifecycleModes` field is rejected by those release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../util/deploy-hostpath.sh |
55 changes: 55 additions & 0 deletions
55
deploy/kubernetes-1.16/hostpath/csi-hostpath-attacher.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-hostpath-attacher | ||
labels: | ||
app: csi-hostpath-attacher | ||
spec: | ||
selector: | ||
app: csi-hostpath-attacher | ||
ports: | ||
- name: dummy | ||
port: 12345 | ||
|
||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-hostpath-attacher | ||
spec: | ||
serviceName: "csi-hostpath-attacher" | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: csi-hostpath-attacher | ||
template: | ||
metadata: | ||
labels: | ||
app: csi-hostpath-attacher | ||
spec: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- csi-hostpathplugin | ||
topologyKey: kubernetes.io/hostname | ||
serviceAccountName: csi-attacher | ||
containers: | ||
- name: csi-attacher | ||
image: quay.io/k8scsi/csi-attacher:v1.2.0 | ||
args: | ||
- --v=5 | ||
- --csi-address=/csi/csi.sock | ||
volumeMounts: | ||
- mountPath: /csi | ||
name: socket-dir | ||
|
||
volumes: | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins/csi-hostpath | ||
type: DirectoryOrCreate | ||
name: socket-dir |
12 changes: 12 additions & 0 deletions
12
deploy/kubernetes-1.16/hostpath/csi-hostpath-driverinfo.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: storage.k8s.io/v1beta1 | ||
kind: CSIDriver | ||
metadata: | ||
name: hostpath.csi.k8s.io | ||
spec: | ||
# Supports persistent and ephemeral inline volumes. | ||
volumeLifecycleModes: | ||
- Persistent | ||
- Ephemeral | ||
# To determine at runtime which mode a volume uses, pod info and its | ||
# "csi.storage.k8s.io/ephemeral" entry are needed. | ||
podInfoOnMount: true |
138 changes: 138 additions & 0 deletions
138
deploy/kubernetes-1.16/hostpath/csi-hostpath-plugin.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# Service defined here, plus serviceName below in StatefulSet, | ||
# are needed only because of condition explained in | ||
# https://github.com/kubernetes/kubernetes/issues/69608 | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-hostpathplugin | ||
labels: | ||
app: csi-hostpathplugin | ||
spec: | ||
selector: | ||
app: csi-hostpathplugin | ||
ports: | ||
- name: dummy | ||
port: 12345 | ||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-hostpathplugin | ||
spec: | ||
serviceName: "csi-hostpathplugin" | ||
# One replica only: | ||
# Host path driver only works when everything runs | ||
# on a single node. We achieve that by starting it once and then | ||
# co-locate all other pods via inter-pod affinity | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: csi-hostpathplugin | ||
template: | ||
metadata: | ||
labels: | ||
app: csi-hostpathplugin | ||
spec: | ||
hostNetwork: true | ||
containers: | ||
- name: node-driver-registrar | ||
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0 | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: ["/bin/sh", "-c", "rm -rf /registration/csi-hostpath /registration/csi-hostpath-reg.sock"] | ||
args: | ||
- --v=5 | ||
- --csi-address=/csi/csi.sock | ||
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi-hostpath/csi.sock | ||
securityContext: | ||
privileged: true | ||
env: | ||
- name: KUBE_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: spec.nodeName | ||
volumeMounts: | ||
- mountPath: /csi | ||
name: socket-dir | ||
- mountPath: /registration | ||
name: registration-dir | ||
- mountPath: /csi-data-dir | ||
name: csi-data-dir | ||
|
||
- name: hostpath | ||
image: quay.io/k8scsi/hostpathplugin:v1.2.0-rc8 | ||
args: | ||
- "--drivername=hostpath.csi.k8s.io" | ||
- "--v=5" | ||
- "--endpoint=$(CSI_ENDPOINT)" | ||
- "--nodeid=$(KUBE_NODE_NAME)" | ||
env: | ||
- name: CSI_ENDPOINT | ||
value: unix:///csi/csi.sock | ||
- name: KUBE_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: spec.nodeName | ||
securityContext: | ||
privileged: true | ||
ports: | ||
- containerPort: 9898 | ||
name: healthz | ||
protocol: TCP | ||
livenessProbe: | ||
failureThreshold: 5 | ||
httpGet: | ||
path: /healthz | ||
port: healthz | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 3 | ||
periodSeconds: 2 | ||
volumeMounts: | ||
- mountPath: /csi | ||
name: socket-dir | ||
- mountPath: /var/lib/kubelet/pods | ||
mountPropagation: Bidirectional | ||
name: mountpoint-dir | ||
- mountPath: /var/lib/kubelet/plugins | ||
mountPropagation: Bidirectional | ||
name: plugins-dir | ||
- mountPath: /csi-data-dir | ||
name: csi-data-dir | ||
|
||
- name: liveness-probe | ||
volumeMounts: | ||
- mountPath: /csi | ||
name: socket-dir | ||
image: quay.io/k8scsi/livenessprobe:v1.1.0 | ||
args: | ||
- --csi-address=/csi/csi.sock | ||
- --connection-timeout=3s | ||
- --health-port=9898 | ||
|
||
volumes: | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins/csi-hostpath | ||
type: DirectoryOrCreate | ||
name: socket-dir | ||
- hostPath: | ||
path: /var/lib/kubelet/pods | ||
type: DirectoryOrCreate | ||
name: mountpoint-dir | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins_registry | ||
type: Directory | ||
name: registration-dir | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins | ||
type: Directory | ||
name: plugins-dir | ||
- hostPath: | ||
# 'path' is where PV data is persisted on host. | ||
# using /tmp is also possible while the PVs will not available after plugin container recreation or host reboot | ||
path: /var/lib/csi-hostpath-data/ | ||
type: DirectoryOrCreate | ||
name: csi-data-dir |
56 changes: 56 additions & 0 deletions
56
deploy/kubernetes-1.16/hostpath/csi-hostpath-provisioner.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-hostpath-provisioner | ||
labels: | ||
app: csi-hostpath-provisioner | ||
spec: | ||
selector: | ||
app: csi-hostpath-provisioner | ||
ports: | ||
- name: dummy | ||
port: 12345 | ||
|
||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-hostpath-provisioner | ||
spec: | ||
serviceName: "csi-hostpath-provisioner" | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: csi-hostpath-provisioner | ||
template: | ||
metadata: | ||
labels: | ||
app: csi-hostpath-provisioner | ||
spec: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- csi-hostpathplugin | ||
topologyKey: kubernetes.io/hostname | ||
serviceAccountName: csi-provisioner | ||
containers: | ||
- name: csi-provisioner | ||
image: quay.io/k8scsi/csi-provisioner:v1.3.0 | ||
args: | ||
- -v=5 | ||
- --csi-address=/csi/csi.sock | ||
- --connection-timeout=15s | ||
- --feature-gates=Topology=true | ||
volumeMounts: | ||
- mountPath: /csi | ||
name: socket-dir | ||
volumes: | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins/csi-hostpath | ||
type: DirectoryOrCreate | ||
name: socket-dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-hostpath-resizer | ||
labels: | ||
app: csi-hostpath-resizer | ||
spec: | ||
selector: | ||
app: csi-hostpath-resizer | ||
ports: | ||
- name: dummy | ||
port: 12345 | ||
|
||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-hostpath-resizer | ||
spec: | ||
serviceName: "csi-hostpath-resizer" | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: csi-hostpath-resizer | ||
template: | ||
metadata: | ||
labels: | ||
app: csi-hostpath-resizer | ||
spec: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- csi-hostpathplugin | ||
topologyKey: kubernetes.io/hostname | ||
serviceAccountName: csi-resizer | ||
containers: | ||
- name: csi-resizer | ||
image: quay.io/k8scsi/csi-resizer:v0.2.0 | ||
args: | ||
- -v=5 | ||
- -csi-address=/csi/csi.sock | ||
volumeMounts: | ||
- mountPath: /csi | ||
name: socket-dir | ||
volumes: | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins/csi-hostpath | ||
type: DirectoryOrCreate | ||
name: socket-dir |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency on Kubernetes is mentioned below. What matters here is the driver release which has the support. I don't think we ever released 1.0.1, did we?
1.2.0 will be the first "real" release with any kind of ephemeral support.