Skip to content
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

Added helm charts. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deploy/helm_charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: A Helm chart for ibmcloud-object-storage plugin
name: ibmcloud-object-storage-plugin
version: 0.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think same charts are available under https://github.com/IBM/FfDL/blob/master/storage-plugin/Chart.yaml
I think better to keep chart at one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely agree. Since there are almost certainly more people who want to deploy the driver with Helm than just FfDL, it should make sense to maintain the helm charts in the driver repository rather than FfDL.

38 changes: 38 additions & 0 deletions deploy/helm_charts/templates/deployer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{ if .Values.cloud }}
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: "ibmcloud-object-storage-deployer"
namespace: kube-system
labels:
app: "ibmcloud-object-storage-deployer"
spec:
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: "ibmcloud-object-storage-deployer"
spec:
tolerations:
- operator: "Exists"
hostNetwork: true
containers:
- name: "ibmcloud-object-storage-deployer-container"
image: "{{ .Values.image.pluginrepository }}:{{ .Values.image.pluginBuild }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- mountPath: /host
name: root-fs
- mountPath: /run/systemd
name: systemd
volumes:
- name: root-fs
hostPath:
path: /
- name: systemd
hostPath:
path: /run/systemd
imagePullSecrets:
- name: regcred
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is regcred for FFDL registry?
I think the steps to create image, push image and create image pull secrets from privet registry should be documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation sounds good. regcred is a Kubernetes pull secret for the registry that you create via

kubectl create secret docker-registry regcred --docker-server=${DOCKER_REPO} --docker-username=${DOCKER_REPO_USER} --docker-password=${DOCKER_REPO_PASS} --docker-email=unknown@docker.io

{{ end }}
16 changes: 16 additions & 0 deletions deploy/helm_charts/templates/ibmc-s3fs-standard-StorageClass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: ibmc-s3fs-standard
provisioner: ibm.io/ibmc-s3fs
parameters:
ibm.io/chunk-size-mb: "10"
ibm.io/parallel-count: "5"
ibm.io/tls-cipher-suite: "AES"
ibm.io/multireq-max: "20"
ibm.io/stat-cache-size: "100000"
ibm.io/debug-level: "warn"
ibm.io/curl-debug: "false"
ibm.io/kernel-cache: "true"
ibm.io/s3fs-fuse-retry-count: "5"
63 changes: 63 additions & 0 deletions deploy/helm_charts/templates/provisioner-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ServiceAccount for ibmcloud-object-storage-plugin
apiVersion: v1
kind: ServiceAccount
metadata:
name: ibmcloud-object-storage-plugin
namespace: kube-system
---
#ClusterRole with minimum permissions required for ibmcloud-object-storage-plugin
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: ibmcloud-object-storage-plugin
rules:
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create"]
---
#ClusterRole for giving read secrets permission to ibmcloud-object-storage-plugin
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: ibmcloud-object-storage-secret-reader
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
---
#ClusterRoleBinding for binding ClusterRole "ibmcloud-object-storage-plugin"
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: ibmcloud-object-storage-plugin
subjects:
- kind: ServiceAccount
name: ibmcloud-object-storage-plugin
namespace: kube-system
roleRef:
kind: ClusterRole
name: ibmcloud-object-storage-plugin
apiGroup: rbac.authorization.k8s.io
---
#ClusterRoleBinding for binding ClusterRole "ibmcloud-object-storage-secret-reader"
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: ibmcloud-object-storage-secret-reader
subjects:
- kind: ServiceAccount
name: ibmcloud-object-storage-plugin
namespace: kube-system
roleRef:
kind: ClusterRole
name: ibmcloud-object-storage-secret-reader
apiGroup: rbac.authorization.k8s.io
29 changes: 29 additions & 0 deletions deploy/helm_charts/templates/provisioner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ibmcloud-object-storage-plugin deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
namespace: kube-system
labels:
app: {{ .Chart.Name }}
spec:
strategy:
type: RollingUpdate
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ .Chart.Name }}
spec:
tolerations:
- operator: "Exists"
serviceAccountName: ibmcloud-object-storage-plugin
containers:
- name: {{ .Chart.Name }}-container
image: "{{ .Values.image.repository }}:{{ .Values.image.Build }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-provisioner=ibm.io/ibmc-s3fs"
env:
- name: DEBUG_TRACE
value: 'false'
17 changes: 17 additions & 0 deletions deploy/helm_charts/templates/volume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ if .Values.dind }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-volume-1
namespace: {{.Values.namespace}}
labels:
type: local
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt"
persistentVolumeReclaimPolicy: Delete
{{ end }}
10 changes: 10 additions & 0 deletions deploy/helm_charts/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
replicaCount: 1
image:
repository: ffdl/ibmcloud-object-storage-plugin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the registry belongs to ffdl project. Is ffdl updating the image regularly?
I think better need to document the steps to create image and push to registry and then how to use the chart to deploy plug-in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FfDL image is only updated sporadically - one reason for migrating the helm charts. It probably makes sense to maintain images as part of this project [which is, of course, not up to me to decide].

pluginrepository: ffdl/ibmcloud-object-storage-deployer
Build: v0.1
pluginBuild: v0.1
pullPolicy: IfNotPresent
dind: false
cloud: true
namespace: default