Skip to content

Commit

Permalink
Merge pull request #76 from opensds/development
Browse files Browse the repository at this point in the history
Merge Development into Master branch for publishing Bali Milestone-3
  • Loading branch information
leonwanghui authored Nov 12, 2018
2 parents fc55d52 + bf26372 commit c78da87
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 26 deletions.
4 changes: 2 additions & 2 deletions ansible/group_vars/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ nbp_remote_url: https://github.com/opensds/nbp.git
###########

# If user specifies intalling from release,then he can choose the specific version
opensds_release: v0.3.1 # The version should be at least v0.2.1
nbp_release: v0.3.1 # The version should be at least v0.2.1
opensds_release: v0.3.2 # The version should be at least v0.2.1
nbp_release: v0.3.2 # The version should be at least v0.2.1

# These fields are NOT suggested to be modified
opensds_download_url: https://github.com/opensds/opensds/releases/download/{{ opensds_release }}/opensds-hotpot-{{ opensds_release }}-linux-amd64.tar.gz
Expand Down
43 changes: 40 additions & 3 deletions charts/csiplugin/templates/csi-attacher-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
name: csi-attacher-opensdsplugin
spec:
serviceName: "csi-attacher-opensdsplugin"
replicas: 1
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
Expand All @@ -30,7 +30,7 @@ spec:
serviceAccount: csi-attacher
containers:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v0.2.0
image: quay.io/k8scsi/csi-attacher:v0.4.0
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand All @@ -48,6 +48,8 @@ spec:
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
- "--opensdsAuthStrategy=$(OPENSDS_AUTH_STRATEGY)"
- "-v8"
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
Expand All @@ -56,6 +58,41 @@ spec:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsendpoint
- name: OPENSDS_AUTH_STRATEGY
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsauthstrategy
- name: OS_AUTH_URL
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osauthurl
- name: OS_USERNAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osusername
- name: OS_PASSWORD
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ospassword
- name: OS_TENANT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ostenantname
- name: OS_PROJECT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osprojectname
- name: OS_USER_DOMAIN_ID
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
Expand All @@ -74,4 +111,4 @@ spec:
- name: ceph-dir
hostPath:
path: /etc/ceph/
type: Directory
type: DirectoryOrCreate
9 changes: 8 additions & 1 deletion charts/csiplugin/templates/csi-configmap-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ apiVersion: v1
metadata:
name: csi-configmap-opensdsplugin
data:
opensdsendpoint: {{ .Values.opensdsEndpoint }}
opensdsendpoint: {{ .Values.data.opensdsEndpoint }}
opensdsauthstrategy: {{ .Values.data.opensdsAuthStrategy }}
osauthurl: {{ .Values.data.osAuthURL }}
osusername: {{ .Values.data.osUsername }}
ospassword: {{ .Values.data.osPassword }}
ostenantname: {{ .Values.data.osTenantName }}
osprojectname: {{ .Values.data.osProjectName }}
osuserdomainid: {{ .Values.data.osUserDomainId }}
49 changes: 47 additions & 2 deletions charts/csiplugin/templates/csi-nodeplugin-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ spec:
hostNetwork: true
containers:
- name: driver-registrar
image: quay.io/k8scsi/driver-registrar:v0.2.0
image: quay.io/k8scsi/driver-registrar:v0.4.0
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/csi-opensdsplugin/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-opensdsplugin
- name: registration-dir
mountPath: /registration
- name: opensds
securityContext:
privileged: true
Expand All @@ -42,6 +46,8 @@ spec:
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
- "--opensdsAuthStrategy=$(OPENSDS_AUTH_STRATEGY)"
- "-v8"
env:
- name: CSI_ENDPOINT
value: unix://var/lib/kubelet/plugins/csi-opensdsplugin/csi.sock
Expand All @@ -50,6 +56,41 @@ spec:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsendpoint
- name: OPENSDS_AUTH_STRATEGY
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsauthstrategy
- name: OS_AUTH_URL
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osauthurl
- name: OS_USERNAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osusername
- name: OS_PASSWORD
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ospassword
- name: OS_TENANT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ostenantname
- name: OS_PROJECT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osprojectname
- name: OS_USER_DOMAIN_ID
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
Expand All @@ -59,7 +100,7 @@ spec:
mountPropagation: "Bidirectional"
- name: pods-probe-dir
mountPath: /dev
mountPropagation: "Bidirectional"
mountPropagation: "HostToContainer"
- name: iscsi-dir
mountPath: /etc/iscsi/
- name: ceph-dir
Expand All @@ -84,4 +125,8 @@ spec:
- name: ceph-dir
hostPath:
path: /etc/ceph/
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins
type: Directory
43 changes: 41 additions & 2 deletions charts/csiplugin/templates/csi-provisioner-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
name: csi-provisioner-opensdsplugin
spec:
serviceName: "csi-provisioner-opensdsplugin"
replicas: 1
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
Expand All @@ -30,10 +30,12 @@ spec:
serviceAccount: csi-provisioner
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v0.2.0
# This should be replaced by an official k8s-csi provisioner image when it is released.
image: quay.io/k8scsi/csi-provisioner:v0.4.0
args:
- "--provisioner=csi-opensdsplugin"
- "--csi-address=$(ADDRESS)"
- "--connection-timeout=15s"
env:
- name: ADDRESS
value: /csi/csi.sock
Expand All @@ -46,6 +48,8 @@ spec:
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
- "--opensdsAuthStrategy=$(OPENSDS_AUTH_STRATEGY)"
- "-v8"
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
Expand All @@ -54,6 +58,41 @@ spec:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsendpoint
- name: OPENSDS_AUTH_STRATEGY
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsauthstrategy
- name: OS_AUTH_URL
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osauthurl
- name: OS_USERNAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osusername
- name: OS_PASSWORD
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ospassword
- name: OS_TENANT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ostenantname
- name: OS_PROJECT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osprojectname
- name: OS_USER_DOMAIN_ID
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
Expand Down
14 changes: 12 additions & 2 deletions charts/csiplugin/templates/csi-provisioner-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@ rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]


- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "create", "update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["create","get", "list", "watch","update", "delete"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status"]
verbs: ["update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create","get", "list", "watch","update", "delete"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
102 changes: 102 additions & 0 deletions charts/csiplugin/templates/csi-snapshotter-opensdsplugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# This YAML file contains snapshotter & csi driver API objects,
# which are necessary to run external csi snapshotter for opensds.

kind: Service
apiVersion: v1
metadata:
name: csi-snapshotter-opensdsplugin
labels:
app: csi-snapshotter-opensdsplugin
spec:
selector:
app: csi-snapshotter-opensdsplugin
ports:
- name: dummy
port: 12345

---
kind: StatefulSet
apiVersion: apps/v1beta1
metadata:
name: csi-snapshotter-opensdsplugin
spec:
serviceName: "csi-snapshotter-opensdsplugin"
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: csi-snapshotter-opensdsplugin
spec:
serviceAccount: csi-snapshotter
containers:
- name: csi-snapshotter
# This should be replaced by an official k8s-csi snapshotter image when it is released.
image: quay.io/k8scsi/csi-snapshotter:v0.4.0
args:
- "--snapshotter=csi-opensdsplugin"
- "--csi-address=$(ADDRESS)"
- "--connection-timeout=15s"
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: opensds
image: {{ .Values.image }}
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
- "--opensdsAuthStrategy=$(OPENSDS_AUTH_STRATEGY)"
- "-v8"
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
- name: OPENSDS_ENDPOINT
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsendpoint
- name: OPENSDS_AUTH_STRATEGY
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: opensdsauthstrategy
- name: OS_AUTH_URL
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osauthurl
- name: OS_USERNAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osusername
- name: OS_PASSWORD
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ospassword
- name: OS_TENANT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: ostenantname
- name: OS_PROJECT_NAME
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osprojectname
- name: OS_USER_DOMAIN_ID
valueFrom:
configMapKeyRef:
name: csi-configmap-opensdsplugin
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
mountPath: /csi
volumes:
- name: socket-dir
emptyDir:
Loading

0 comments on commit c78da87

Please sign in to comment.