From 831f63d486ccb08f92a71434b3541a622f1788b4 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Tue, 10 Jan 2017 19:03:57 +0000 Subject: [PATCH] Update Cinder PR to enable Ceph Backend --- cinder/templates/deployment-scheduler.yaml | 88 ++++++++++++++++++++++ cinder/templates/etc/_cinder.conf.tpl | 8 ++ cinder/values.yaml | 11 ++- 3 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 cinder/templates/deployment-scheduler.yaml diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml new file mode 100644 index 0000000000..fabcf3361a --- /dev/null +++ b/cinder/templates/deployment-scheduler.yaml @@ -0,0 +1,88 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: cinder-scheduler +spec: + replicas: {{ .Values.replicas.scheduler }} + revisionHistoryLimit: {{ .Values.upgrades.revision_history }} + strategy: + type: {{ .Values.upgrades.pod_replacement_strategy }} + {{ if eq .Values.upgrades.pod_replacement_strategy "RollingUpdate" }} + rollingUpdate: + maxUnavailable: {{ .Values.upgrades.rolling_update.max_unavailable }} + maxSurge: {{ .Values.upgrades.rolling_update.max_surge }} + {{ end }} + template: + metadata: + labels: + app: cinder-scheduler + annotations: + configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} + configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} + pod.beta.kubernetes.io/init-containers: '[ + { + "name": "init", + "image": {{ .Values.images.dep_check | quote }}, + "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, + "env": [ + { + "name": "NAMESPACE", + "value": "{{ .Release.Namespace }}" + }, + { + "name": "DEPENDENCY_SERVICE", + "value": "{{ include "joinListWithColon" .Values.dependencies.scheduler.service }}" + }, + { + "name": "DEPENDENCY_JOBS", + "value": "{{ include "joinListWithColon" .Values.dependencies.scheduler.jobs }}" + }, + { + "name": "COMMAND", + "value": "echo done" + } + ] + } + ]' + spec: + nodeSelector: + {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + containers: + - name: cinder-scheduler + image: {{ .Values.images.scheduler }} + imagePullPolicy: {{ .Values.images.pull_policy }} + command: + - cinder-scheduler + - --config-dir + - /etc/cinder/conf + volumeMounts: + - name: pod-etc-cinder + mountPath: /etc/cinder + - name: pod-var-cache-cinder + mountPath: /var/cache/cinder + - name: cinderconf + mountPath: /etc/cinder/conf/cinder.conf + subPath: cinder.conf + readOnly: true + - name: cinderpaste + mountPath: /etc/cinder/api-paste.ini + subPath: api-paste.ini + readOnly: true + - name: cinderpolicy + mountPath: /etc/cinder/policy.json + subPath: policy.json + readOnly: true + volumes: + - name: pod-etc-cinder + emptyDir: {} + - name: pod-var-cache-cinder + emptyDir: {} + - name: cinderconf + configMap: + name: cinder-etc + - name: cinderpaste + configMap: + name: cinder-etc + - name: cinderpolicy + configMap: + name: cinder-etc diff --git a/cinder/templates/etc/_cinder.conf.tpl b/cinder/templates/etc/_cinder.conf.tpl index 9ffe740629..a576fe1fa0 100644 --- a/cinder/templates/etc/_cinder.conf.tpl +++ b/cinder/templates/etc/_cinder.conf.tpl @@ -20,6 +20,10 @@ enabled_backends = {{ include "joinListWithColon" .Values.backends.enabled }} auth_strategy = keystone os_region_name = {{ .Values.keystone.cinder_region_name }} +# ensures that our volume worker service-list doesn't +# explode with dead agents from terminated containers +# by pinning the agent identifier +host=cinder-volume-worker [database] connection = mysql+pymysql://{{ .Values.database.cinder_user }}:{{ .Values.database.cinder_password }}@{{ .Values.database.address }}:{{ .Values.database.port }}/{{ .Values.database.cinder_database_name }} @@ -51,6 +55,10 @@ rbd_flatten_volume_from_snapshot = false rbd_max_clone_depth = 5 rbd_store_chunk_size = 4 rados_connect_timeout = -1 +{{- if .Values.backends.rbd1.secret }} rbd_user = {{ .Values.backends.rbd1.user }} +{{- else }} +rbd_secret_uuid = {{- include "secrets/ceph-client-key" . -}} +{{- end }} rbd_secret_uuid = {{ .Values.backends.rbd1.secret }} report_discard_supported = True diff --git a/cinder/values.yaml b/cinder/values.yaml index 2da493a3db..5ea0cb62a9 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -6,6 +6,7 @@ replicas: api: 1 volume: 1 + scheduler: 1 labels: node_selector_key: openstack-control-plane @@ -19,6 +20,7 @@ images: ks_service: quay.io/stackanetes/stackanetes-kolla-toolbox:newton ks_endpoints: quay.io/stackanetes/stackanetes-kolla-toolbox:newton api: quay.io/stackanetes/stackanetes-cinder-api:newton + scheduler: quay.io/stackanetes/stackanetes-cinder-scheduler:newton volume: quay.io/stackanetes/stackanetes-cinder-volume:newton pull_policy: "IfNotPresent" @@ -66,7 +68,6 @@ ceph: enabled: true monitors: [] cinder_user: "admin" - cinder_pool: "volumes" # a null value for the keyring will # attempt to use the key from # common/secrets/ceph-client-key @@ -76,8 +77,8 @@ backends: enabled: - rbd1 rbd1: - secret: "" - user: "cinder" + secret: null + user: "admin" pool: "volumes" glance: @@ -132,6 +133,10 @@ dependencies: service: - keystone-api - cinder-api + scheduler: + service: + - keystone-api + - cinder-api # We use a different layout of the endpoints here to account for versioning # this swaps the service name and type, and should be rolled out to other