Skip to content

Commit

Permalink
Merge pull request purestorage#73 from javefang/xfang-separate-config
Browse files Browse the repository at this point in the history
Separate nodeSelector, tolerations and affinity config for flexDaemon and provisioner
  • Loading branch information
taherv authored Mar 22, 2019
2 parents b7e1f3c + 60810b0 commit fe3ca5f
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 27 deletions.
28 changes: 19 additions & 9 deletions docs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ apiVersion: v1
entries:
pure-k8s-plugin:
- apiVersion: v1
created: 2019-03-15T17:39:29.968372462-07:00
appVersion: 2.3.0
created: 2019-03-21T09:09:10.513737471Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/OpenShift
digest: 3b80b7d5da4014178fb71a5a7650d2934a200c1189856fe64a071d5f277ff03e
icon: https://github.com/purestorage/helm-charts/tree/master/pure-k8s-plugin/pure-storage.png
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.3.1.tgz
version: 2.3.1
- apiVersion: v1
created: 2019-03-21T09:09:10.502041338Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/OpenShift
digest: 30a1498d2c9af4609d05ceb29016b239ee2437a94c94a87eaea604d0c484441e
icon: https://github.com/purestorage/helm-charts/tree/master/pure-k8s-plugin/pure-storage.png
Expand All @@ -11,59 +21,59 @@ entries:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.3.0.tgz
version: 2.3.0
- apiVersion: v1
created: 2019-03-15T17:39:29.967288973-07:00
created: 2019-03-21T09:09:10.490697065Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: 81673ebfa1a4380f841d6a705b5dd7c2fab300bfae6007983e58393f7407ac9b
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.2.1.tgz
version: 2.2.1
- apiVersion: v1
created: 2019-03-15T17:39:29.966055511-07:00
created: 2019-03-21T09:09:10.489124469Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: 23b5296d049f5b2a92b1b2ee9165a0c41178cea88f3bfb6eb560462ae1b5a728
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.2.0.tgz
version: 2.2.0
- apiVersion: v1
created: 2019-03-15T17:39:29.964678927-07:00
created: 2019-03-21T09:09:10.487597858Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: 939ae58208c7fbd5794a25ab14a715ecff60c79e98616e0954f7e8c16d0ed7dc
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.1.2.tgz
version: 2.1.2
- apiVersion: v1
created: 2019-03-15T17:39:29.963109083-07:00
created: 2019-03-21T09:09:10.477603863Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: cad41a8b5278f57c8d953768d9ad28df461af92183f6404d661e33973017a928
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.1.1.tgz
version: 2.1.1
- apiVersion: v1
created: 2019-03-15T17:39:29.961508625-07:00
created: 2019-03-21T09:09:10.469080989Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: bbccdbdb9426e9f801ae743b64ab9393416f9c097d5bf1d461c76484379faddd
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.1.0.tgz
version: 2.1.0
- apiVersion: v1
created: 2019-03-15T17:39:29.959970989-07:00
created: 2019-03-21T09:09:10.462403831Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: 05eed477a922dfcd35b3905fc0dcd50aa448fe7123bb6a5517dd9ab709dc906e
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.0.1.tgz
version: 2.0.1
- apiVersion: v1
created: 2019-03-15T17:39:29.958349091-07:00
created: 2019-03-21T09:09:10.452795613Z
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/Openshift
digest: 1cd0d82bf6e38183f70bd4160ddb74be76be355935ad6c41fdc1ef2403686f72
name: pure-k8s-plugin
urls:
- https://purestorage.github.io/helm-charts/pure-k8s-plugin-2.0.0.tgz
version: 2.0.0
generated: 2019-03-15T17:39:29.956523362-07:00
generated: 2019-03-21T09:09:10.450420499Z
Binary file added docs/pure-k8s-plugin-2.3.1.tgz
Binary file not shown.
5 changes: 3 additions & 2 deletions pure-k8s-plugin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apiVersion: v1
description: A Helm chart for Pure Storage persistent storage driver for Kubernetes/OpenShift
name: pure-k8s-plugin
version: 2.3.0
icon: https://github.com/purestorage/helm-charts/tree/master/pure-k8s-plugin/pure-storage.png
version: 2.3.1
appVersion: 2.3.0
icon: https://github.com/purestorage/helm-charts/tree/master/pure-k8s-plugin/pure-storage.png
23 changes: 20 additions & 3 deletions pure-k8s-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ The following table lists the configurable parameters and their default values.
| `orchestrator.name` | Orchestrator type, such as openshift, k8s | `k8s` |
| `flexPath` | Full path of directory to install flex plugin, works with image.tag >= 2.0.1 | `/usr/libexec/kubernetes/kubelet-plugins/volume/exec` |
| *`arrays` | Array list of all the backend FlashArrays and FlashBlades | must be set by user, see an example below |
| `nodeSelector` | [NodeSelectors](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) Select node-labels to schedule flex-plugin. See [this](https://docs.openshift.com/container-platform/3.11/admin_guide/managing_projects.html#using-node-selectors) for setting node selectors on Openshift. | `{}` |
| `tolerations` | [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/#concepts) | `[]` |
| `affinity` | [Affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | `{}` |
| `nodeSelector` | *Deprecated* Use `flexDaemon.nodeSelector` and `provisioner.nodeSelector` instead. | `{}` |
| `tolerations` | *Deprecated* Use `flexDaemon.tolerations` and `provisioner.tolerations` instead | `[]` |
| `affinity` | *Deprecated* Use `flexDaemon.affinity` and `provisioner.affinity` instead | `{}` |
| `flexDaemon.nodeSelector` | [NodeSelectors](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) Select node-labels to schedule flex-plugin. See [this](https://docs.openshift.com/container-platform/3.11/admin_guide/managing_projects.html#using-node-selectors) for setting node selectors on Openshift. | `{}` |
| `flexDaemon.tolerations` | [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/#concepts) | `[]` |
| `flexDaemon.affinity` | [Affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | `{}` |
| `provisioner.nodeSelector` | [NodeSelectors](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) Select node-labels to schedule provisioner. See [this](https://docs.openshift.com/container-platform/3.11/admin_guide/managing_projects.html#using-node-selectors) for setting node selectors on Openshift. | `{}` |
| `provisioner.tolerations` | [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/#concepts) | `[]` |
| `provisioner.affinity` | [Affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | `{}` |

*Examples:
```yaml
Expand All @@ -74,6 +80,17 @@ arrays:
rack: "6a"
```
## Assigning Pods to Nodes
It is possible to make flex-daemon and provisioner to run on specific nodes
using `nodeSelector`, `toleration` and `affinity`. You can set these config
separately for flex-daemon and provisioner (e.g. `flexDaemon.nodeSelector`).
The unprefixed parameters have been deprecated but will still be used as a
fallback if the prefixed parameters are not set. (e.g. if `nodeSelector` is
set but `provisioner.nodeSelector` is not, provisioner will use the value of
`nodeSelector` as a fallback) This makes sure the behaviour is backward
compatible.

## Install the plugin in a separate namespace(i.e. project)
For security reason, it's strongly recommended to install the plugin in a separate namespace/project. Make sure the namespace is existing, otherwise create it before installing the plugin.

Expand Down
6 changes: 3 additions & 3 deletions pure-k8s-plugin/templates/pure-flex-daemon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ spec:
- name: kubelet-plugins
hostPath:
path: {{ template "pure_k8s_plugin.flexpath" .}}
{{- with .Values.nodeSelector }}
{{- with .Values.flexDaemon.nodeSelector | default .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.flexDaemon.affinity | default .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.flexDaemon.tolerations | default .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions pure-k8s-plugin/templates/pure-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ spec:
- name: config
configMap:
name: pure-provisioner-config
{{- with .Values.nodeSelector }}
{{- with .Values.provisioner.nodeSelector | default .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.provisioner.affinity | default .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.provisioner.tolerations | default .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
50 changes: 43 additions & 7 deletions pure-k8s-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,55 @@ arrays:
# These values map directly to yaml in the deployment spec, see the kubernetes docs for info
nodeSelector: {}
# disktype: ssd

# These values map directly to yaml in the deployment spec, see the kubernetes docs for info
tolerations: []
# - operator: Exists

# These values map directly to yaml in the deployment spec, see the kubernetes docs for info
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: e2e-az-NorthSouth
# operator: In
# - key: e2e-az-NorthSouth
# operator: In
# values:
# - e2e-az-North
# - e2e-az-North
# - e2e-az-South

flexDaemon:
# These values map directly to yaml in the daemonset spec, see the kubernetes docs for info
nodeSelector: {}
# disktype: ssd
# These values map directly to yaml in the daemonset spec, see the kubernetes docs for info
tolerations: []
# - operator: Exists
# These values map directly to yaml in the daemonset spec, see the kubernetes docs for info
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: e2e-az-NorthSouth
# operator: In
# values:
# - e2e-az-North
# - e2e-az-South

provisioner:
# These values map directly to yaml in the deployment spec, see the kubernetes docs for info
nodeSelector: {}
# disktype: ssd
# These values map directly to yaml in the deployment spec, see the kubernetes docs for info
tolerations: []
# - operator: Exists
# These values map directly to yaml in the deployment spec, see the kubernetes docs for info
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: e2e-az-NorthSouth
# operator: In
# values:
# - e2e-az-North
# - e2e-az-South

0 comments on commit fe3ca5f

Please sign in to comment.