diff --git a/chart/templates/clusterrole.yaml b/chart/templates/clusterrole.yaml index a61c4329..9093a46c 100644 --- a/chart/templates/clusterrole.yaml +++ b/chart/templates/clusterrole.yaml @@ -23,42 +23,8 @@ rules: - "" resources: - configmaps - - services - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: + - namespaces - pods - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - secrets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - secrets - services verbs: diff --git a/chart/templates/configmap.yaml b/chart/templates/configmap.yaml new file mode 100644 index 00000000..81afe835 --- /dev/null +++ b/chart/templates/configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: {{ .Release.Namespace }} + name: operator-config + labels: +{{ include "openstack-operator.labels" . | indent 4 }} +data: +{{- with .Values.configMap }} + operator-config.yaml: | +{{ toYaml . | indent 4 }} +{{- end }} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 6aa18065..d2bd2d20 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -21,6 +21,11 @@ spec: - name: operator image: vexxhost/openstack-operator:latest command: ["/usr/local/bin/kopf"] + env: + - name: OPERATOR_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace {{- with .Values.secretName }} envFrom: - secretRef: @@ -29,11 +34,7 @@ spec: args: - run - -m - - openstack_operator.heat - - -m - - openstack_operator.horizon - - -m - - openstack_operator.keystone + - openstack_operator.operator - -m - openstack_operator.mcrouter - -m diff --git a/chart/test-values.yaml b/chart/test-values.yaml index 6916598d..2e3632b4 100644 --- a/chart/test-values.yaml +++ b/chart/test-values.yaml @@ -1,2 +1,10 @@ --- secretName: devstack +configMap: + horizon: + ingress: + host: "horizon.vexxhost.com" + keystone: + configDir: /etc/keystone + heat: + configDir: /etc/heat \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index f6a6e7f7..6f04346a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,3 +1,4 @@ crd: monitoring: true dns: true +configMap: {} diff --git a/devstack/lib/common b/devstack/lib/common index 89ab2185..3d695a8d 100644 --- a/devstack/lib/common +++ b/devstack/lib/common @@ -34,16 +34,27 @@ function kubernetes_rollout_status { kubectl rollout status deploy/$deployment } +function kubernetes_rollout_restart { + local deployment="$1" + + for i in {1..30}; do + kubectl get deploy/$deployment && break || sleep 1; + done + + kubectl rollout restart deploy/$deployment +} + function proxy_pass_to_kubernetes { local url=$1 local svc=$2 + local conf=$3 local ip=$(get_kubernetes_service_ip $svc) - local apache_conf=$(apache_site_config_for $svc) + local apache_conf=$(apache_site_config_for $conf) echo "ProxyPass \"${url}\" \"http://${ip}/\"" | sudo tee -a $apache_conf - enable_apache_site $svc + enable_apache_site $conf restart_apache_server } @@ -78,4 +89,4 @@ spec: url: $3 EOF } -export -f _get_or_create_endpoint_with_interface \ No newline at end of file +export -f _get_or_create_endpoint_with_interface diff --git a/devstack/lib/keystone b/devstack/lib/keystone index 5c2a9a29..f4fa2bc6 100644 --- a/devstack/lib/keystone +++ b/devstack/lib/keystone @@ -54,18 +54,9 @@ export -f init_keystone # start_keystone() - Start running processes function start_keystone { - # install keystone - cat <