From 38859bafeaebf22a7f9f5a8fe358a8adf8438e28 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Wed, 29 Jul 2020 22:27:57 +0300 Subject: [PATCH] Use volumeSpec always - Deploy the latest storage-provisioner Change-Id: Ic004cacfe4a51072b58b05489cff25511206adcd --- .../mysqlcluster/mysqlcluster.yml.j2 | 2 - playbooks/functional/run.yaml | 3 ++ playbooks/functional/storage-provisioner.yaml | 54 +++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100755 playbooks/functional/storage-provisioner.yaml diff --git a/openstack_operator/templates/mysqlcluster/mysqlcluster.yml.j2 b/openstack_operator/templates/mysqlcluster/mysqlcluster.yml.j2 index b6fa4ad0..9eb98dd0 100644 --- a/openstack_operator/templates/mysqlcluster/mysqlcluster.yml.j2 +++ b/openstack_operator/templates/mysqlcluster/mysqlcluster.yml.j2 @@ -40,7 +40,6 @@ spec: tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master - {% if "volumeSpec" in spec %} volumeSpec: persistentVolumeClaim: accessModes: @@ -48,4 +47,3 @@ spec: resources: requests: storage: {{ spec.size | default("10Gi", true) }} - {% endif %} diff --git a/playbooks/functional/run.yaml b/playbooks/functional/run.yaml index 8897acff..44651204 100755 --- a/playbooks/functional/run.yaml +++ b/playbooks/functional/run.yaml @@ -34,6 +34,9 @@ OS_PASSWORD: secretadmin OS_REGION_NAME: RegionOne EOF + # NOTE(alex): To resolve the minikube issue + # https://github.com/kubernetes/minikube/issues/7218 + - include_tasks: storage-provisioner.yaml - name: Copy mysql operator into devstack working directory git: repo: https://github.com/presslabs/mysql-operator diff --git a/playbooks/functional/storage-provisioner.yaml b/playbooks/functional/storage-provisioner.yaml new file mode 100755 index 00000000..77d46148 --- /dev/null +++ b/playbooks/functional/storage-provisioner.yaml @@ -0,0 +1,54 @@ +--- +# Copyright (c) 2020 VEXXHOST, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Configure the clusterrole for storage-provisioner + shell: | + kubectl patch clusterrole -n kube-system system:persistent-volume-provisioner --type='json' \ + -p='[{"op": "add", "path": "/rules/0", "value": {"apiGroups": [""], "resources":["endpoints"], "verbs":["get", "list", "create", "update"]}}]' + +- name: Remove the default storage-provisioner + shell: | + kubectl delete po -n kube-system storage-provisioner + +- name: Deploy the latest storage-provisioner + shell: | + cat <