Skip to content

Commit

Permalink
Add snapshot controller to helm (openebs#1646)
Browse files Browse the repository at this point in the history
* sample yaml to creaet snap and clone for percona pvc

Signed-off-by: kmova <kiran.mova@openebs.io>

* rename snapshot controller to operator

Signed-off-by: kmova <kiran.mova@openebs.io>

* add snapshot operator yaml files

Signed-off-by: kmova <kiran.mova@openebs.io>

* Incorporate review comments and update version tags

Signed-off-by: kmova <kiran.mova@openebs.io>

* Update the tags to 0.6.0-RC4

Signed-off-by: kmova <kiran.mova@openebs.io>

* Update readme with 0.6.0-RC4

Signed-off-by: kmova <kiran.mova@openebs.io>

* Update with 0.6.0-RC5 tags

Signed-off-by: kmova <kiran.mova@openebs.io>

* Update with 0.6

Signed-off-by: kmova <kiran.mova@openebs.io>
  • Loading branch information
kmova authored and Karthik Satchitanand committed Jul 20, 2018
1 parent 605468e commit 32c7bad
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 32 deletions.
4 changes: 2 additions & 2 deletions k8s/charts/openebs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
version: 0.5.5
version: 0.6.0
name: openebs
appVersion: 0.5.4
appVersion: 0.6.0
description: Containerized Storage for Containers
icon: https://raw.githubusercontent.com/openebs/chitrakala/master/OpenEBS%20logo/openebs%20logos-03.png
home: http://www.openebs.io/
Expand Down
37 changes: 22 additions & 15 deletions k8s/charts/openebs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,28 @@ helm del --purge <openebs-chart-name>

## Configuration

The following tables lists the configurable parameters of the OpenEBS chart and their default values.

| Parameter | Description | Default |
| ------------------------------------ | --------------------------------------------- | --------------------------------- |
| `rbac.create` | Enable RBAC Resources | `true` |
| `image.pullPolicy` | Container pull policy | `IfNotPresent` |
| `apiserver.image` | Docker Image for API Server | `openebs/m-apiserver` |
| `apiserver.imageTag` | Docker Image Tag for API Server | `0.5.4` |
| `apiserver.replicas` | Number of API Server Replicas | `1` |
| `provisioner.image` | Docker Image for Provisioner | `openebs/openebs-k8s-provisioner` |
| `provisioner.imageTag` | Docker Image Tag for Provisioner | `0.5.4` |
| `provisioner.replicas` | Number of Provisioner Replicas | `1` |
| `jiva.image` | Docker Image for Jiva | `openebs/jiva` |
| `jiva.imageTag` | Docker Image Tag for Jiva | `0.5.4` |
| `jiva.replicas` | Number of Jiva Replicas | `3` |
The following table lists the configurable parameters of OpenEBS chart and their default values.

| Parameter | Description | Default |
| ---------------------------------------| --------------------------------------------- | --------------------------------- |
| `rbac.create` | Enable RBAC Resources | `true` |
| `image.pullPolicy` | Container pull policy | `IfNotPresent` |
| `apiserver.image` | Docker Image for API Server | `openebs/m-apiserver` |
| `apiserver.imageTag` | Docker Image Tag for API Server | `0.6.0` |
| `apiserver.replicas` | Number of API Server Replicas | `1` |
| `provisioner.image` | Docker Image for Provisioner | `openebs/openebs-k8s-provisioner` |
| `provisioner.imageTag` | Docker Image Tag for Provisioner | `0.6.0` |
| `provisioner.replicas` | Number of Provisioner Replicas | `1` |
| `snapshotOperator.provisioner.image` | Docker Image for Snapshot Provisioner | `openebs/snapshot-provisioner` |
| `snapshotOperator.provisioner.imageTag`| Docker Image Tag for Snapshot Provisioner | `0.6.0` |
| `snapshotOperator.controller.image` | Docker Image for Snapshot Controller | `openebs/snapshot-controller` |
| `snapshotOperator.controller.imageTag` | Docker Image Tag for Snapshot Controller | `0.6.0` |
| `snapshotOperator.replicas` | Number of Snapshot Operator Replicas | `1` |
| `jiva.image` | Docker Image for Jiva | `openebs/jiva` |
| `jiva.imageTag` | Docker Image Tag for Jiva | `0.6.0` |
| `jiva.replicas` | Number of Jiva Replicas | `3` |
| `jiva.replicaNodeSelector.enabled` | Enable scheduling replicas with node selector | `false` |
| `jiva.replicaNodeSelector.value` | node labels assigned to replica pods | `nodetype=storage` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand Down
8 changes: 7 additions & 1 deletion k8s/charts/openebs/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@ metadata:
rules:
- apiGroups: ["*"]
resources: ["nodes","nodes/proxy"]
verbs: ["get", "list", "watch"]
verbs: ["get","list","watch","create","update"]
- apiGroups: ["*"]
resources: ["namespaces", "services", "pods", "deployments", "events", "endpoints"]
verbs: ["*"]
- apiGroups: ["*"]
resources: ["persistentvolumes","persistentvolumeclaims"]
verbs: ["*"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: [ "get", "list", "create" ]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["*"]
- apiGroups: ["*"]
resources: ["storagepools"]
verbs: ["get", "list"]
- apiGroups: ["volumesnapshot.external-storage.k8s.io"]
resources: ["volumesnapshots","volumesnapshotdatas"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
{{- end }}
4 changes: 4 additions & 0 deletions k8s/charts/openebs/templates/deployment-maya-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
value: "{{ .Values.policies.monitoring.image }}:{{ .Values.policies.monitoring.imageTag }}"
- name: OPENEBS_IO_JIVA_REPLICA_COUNT
value: "{{ .Values.jiva.replicas }}"
{{- if .Values.jiva.replicaNodeSelector.enabled }}
- name: DEFAULT_REPLICA_NODE_SELECTOR
value: "{{ .Values.jiva.replicaNodeSelector.value }}"
{{- end }}
{{- if .Values.apiserver.nodeSelector }}
nodeSelector:
{{ toYaml .Values.apiserver.nodeSelector | indent 8 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: {{ template "openebs.fullname" . }}-snapshot-operator
labels:
app: {{ template "openebs.name" . }}
chart: {{ template "openebs.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: snapshot-operator
spec:
replicas: {{ .Values.snapshotOperator.replicas }}
strategy:
type: {{ .Values.snapshotOperator.upgradeStrategy }}
template:
metadata:
labels:
app: {{ template "openebs.name" . }}
release: {{ .Release.Name }}
component: snapshot-operator
spec:
serviceAccountName: {{ template "openebs.serviceAccountName" . }}
containers:
- name: {{ template "openebs.name" . }}-snapshot-controller
image: "{{ .Values.snapshotOperator.controller.image }}:{{ .Values.snapshotOperator.controller.imageTag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
# OPENEBS_IO_K8S_MASTER enables openebs snapshot controller to connect to K8s
# based on this address. This is ignored if empty.
# This is supported for openebs snapshot controller version 0.6-RC1 onwards
#- name: OPENEBS_IO_K8S_MASTER
# value: "http://10.128.0.12:8080"
# OPENEBS_IO_KUBE_CONFIG enables openebs snapshot controller to connect to K8s
# based on this config. This is ignored if empty.
# This is supported for openebs snapshot controller version 0.6-RC1 onwards
#- name: OPENEBS_IO_KUBE_CONFIG
# value: "/home/ubuntu/.kube/config"
# OPENEBS_NAMESPACE is the namespace that this snapshot controller will
# lookup to find maya api service
- name: OPENEBS_NAMESPACE
value: "{{ .Release.Namespace }}"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
# OPENEBS_MAYA_SERVICE_NAME provides the maya-apiserver K8s service name,
# that snapshot controller should forward the volume snapshot requests.
# If not present, "maya-apiserver-service" will be used for lookup.
# This is supported for openebs snapshot controller version 0.6-RC1 onwards
- name: OPENEBS_MAYA_SERVICE_NAME
value: "{{ template "openebs.fullname" . }}-apiservice"
- name: {{ template "openebs.name" . }}-snapshot-provisioner
image: "{{ .Values.snapshotOperator.provisioner.image }}:{{ .Values.snapshotOperator.provisioner.imageTag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
# OPENEBS_IO_K8S_MASTER enables openebs snapshot provisioner to connect to K8s
# based on this address. This is ignored if empty.
# This is supported for openebs snapshot provisioner version 0.6-RC1 onwards
#- name: OPENEBS_IO_K8S_MASTER
# value: "http://10.128.0.12:8080"
# OPENEBS_IO_KUBE_CONFIG enables openebs snapshot provisioner to connect to K8s
# based on this config. This is ignored if empty.
# This is supported for openebs snapshot provisioner version 0.6-RC1 onwards
#- name: OPENEBS_IO_KUBE_CONFIG
# value: "/home/ubuntu/.kube/config"
# OPENEBS_NAMESPACE is the namespace that this snapshot provisioner will
# lookup to find maya api service
- name: OPENEBS_NAMESPACE
value: "{{ .Release.Namespace }}"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
# OPENEBS_MAYA_SERVICE_NAME provides the maya-apiserver K8s service name,
# that snapshot provisioner should forward the volume snapshot PV requests.
# If not present, "maya-apiserver-service" will be used for lookup.
# This is supported for openebs snapshot provisioner version 0.6-RC1 onwards
- name: OPENEBS_MAYA_SERVICE_NAME
value: "{{ template "openebs.fullname" . }}-apiservice"
{{- if .Values.snapshotOperator.nodeSelector }}
nodeSelector:
{{ toYaml .Values.snapshotOperator.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.snapshotOperator.tolerations }}
tolerations:
{{ toYaml .Values.snapshotOperator.tolerations | indent 8 }}
{{- end }}
{{- if .Values.snapshotOperator.affinity }}
tolerations:
{{ toYaml .Values.snapshotOperator.affinity | indent 8 }}
{{- end }}
11 changes: 11 additions & 0 deletions k8s/charts/openebs/templates/sc-snapshot-promoter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Define a storage classes supported by OpenEBS
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-snapshot-promoter
labels:
app: {{ template "openebs.name" . }}
chart: {{ template "openebs.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
provisioner: volumesnapshot.external-storage.k8s.io/snapshot-promoter
30 changes: 26 additions & 4 deletions k8s/charts/openebs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ image:

apiserver:
image: "openebs/m-apiserver"
imageTag: "0.5.4"
imageTag: "0.6.0"
replicas: 1
ports:
externalPort: 5656
Expand All @@ -24,18 +24,40 @@ apiserver:
tolerations: {}
affinity: {}


provisioner:
image: "openebs/openebs-k8s-provisioner"
imageTag: "0.5.4"
imageTag: "0.6.0"
replicas: 1
nodeSelector: {}
tolerations: {}
affinity: {}

snapshotOperator:
controller:
image: "openebs/snapshot-controller"
imageTag: "0.6.0"
provisioner:
image: "openebs/snapshot-provisioner"
imageTag: "0.6.0"
replicas: 1
upgradeStrategy: "Recreate"
nodeSelector: {}
tolerations: {}
affinity: {}

jiva:
image: "openebs/jiva"
imageTag: "0.5.4"
imageTag: "0.6.0"
replicas: 3
replicaNodeSelector:
#Enable this option and specify the node label that will be used to
#select the nodes where replica pods are scheduled. To use this feature,
#the nodes should already be labeled with the key=value. For example:
# `kubectl label nodes <node-name> nodetype=storage
enabled: false
value: "nodetype=storage"


grafana:
image: "grafana/grafana"
Expand All @@ -57,4 +79,4 @@ policies:
monitoring:
enabled: true
image: "openebs/m-exporter"
imageTag: "0.5.4"
imageTag: "0.6.0"
7 changes: 7 additions & 0 deletions k8s/demo/percona/percona-openebs-deployment-create-snap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: volumesnapshot.external-storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: snapshot-demo
namespace: default
spec:
persistentVolumeClaimName: demo-vol1-claim
13 changes: 13 additions & 0 deletions k8s/demo/percona/percona-openebs-deployment-promote-snap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demo-snap-vol-claim
namespace: default
annotations:
snapshot.alpha.kubernetes.io/snapshot: snapshot-demo
spec:
storageClassName: openebs-snapshot-promoter
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
20 changes: 10 additions & 10 deletions k8s/openebs-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
containers:
- name: maya-apiserver
imagePullPolicy: Always
image: openebs/m-apiserver:0.6.0-RC2
image: openebs/m-apiserver:0.6.0
ports:
- containerPort: 5656
env:
Expand All @@ -94,11 +94,11 @@ spec:
#- name: OPENEBS_IO_K8S_MASTER
# value: "http://172.28.128.3:8080"
- name: OPENEBS_IO_JIVA_CONTROLLER_IMAGE
value: "openebs/jiva:0.6.0-RC2"
value: "openebs/jiva:0.6.0"
- name: OPENEBS_IO_JIVA_REPLICA_IMAGE
value: "openebs/jiva:0.6.0-RC2"
value: "openebs/jiva:0.6.0"
- name: OPENEBS_IO_VOLUME_MONITOR_IMAGE
value: "openebs/m-exporter:0.6.0-RC2"
value: "openebs/m-exporter:0.6.0"
- name: OPENEBS_IO_JIVA_REPLICA_COUNT
value: "3"
# DEFAULT_CONTROLLER_NODE_SELECTOR allows your to specify the nodes
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
containers:
- name: openebs-provisioner
imagePullPolicy: Always
image: openebs/openebs-k8s-provisioner:0.6.0-RC2
image: openebs/openebs-k8s-provisioner:0.6.0
env:
# OPENEBS_IO_K8S_MASTER enables openebs provisioner to connect to K8s
# based on this address. This is ignored if empty.
Expand Down Expand Up @@ -188,7 +188,7 @@ spec:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: openebs-snapshot-controller
name: openebs-snapshot-operator
namespace: openebs
spec:
replicas: 1
Expand All @@ -197,20 +197,20 @@ spec:
template:
metadata:
labels:
app: openebs-snapshot-controller
name: openebs-snapshot-operator
spec:
serviceAccountName: openebs-maya-operator
containers:
- name: snapshot-controller
image: openebs/snapshot-controller:0.6.0-RC2
image: openebs/snapshot-controller:0.6.0
imagePullPolicy: Always
env:
- name: OPENEBS_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: snapshot-provisioner
image: openebs/snapshot-provisioner:0.6.0-RC2
image: openebs/snapshot-provisioner:0.6.0
imagePullPolicy: Always
env:
- name: OPENEBS_NAMESPACE
Expand Down Expand Up @@ -278,7 +278,7 @@ parameters:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: snapshot-promoter
name: openebs-snapshot-promoter
provisioner: volumesnapshot.external-storage.k8s.io/snapshot-promoter
---
apiVersion: apiextensions.k8s.io/v1beta1
Expand Down

0 comments on commit 32c7bad

Please sign in to comment.