Fixes toward working glance chart

* imagePullPolicy requirements for init-containers in 1.5

* dependency tree specified mariadb-init, when there is only a
mariadb-seed job to depend on

* the requirements.yaml should not include any chart in this
repository other then common as that severely complicates
removing charts as all dependent elements are removed with it

* the post.sh.yaml has HOME set to /tmp which will not read
/home/ansible configuration.  It was unclear if this was by
design, but /home/ansible seems like an important part of the
kolla toolbox

* the post.sh.yaml file had quoting typos, but even when they are
fixed the job/glance-post will not run to completion, complaining
of a missing kolla_keystone_service module
This commit is contained in:
Alan Meadows 2016-12-16 15:16:36 -08:00
parent 5f42a81c8a
commit 77894d763b
10 changed files with 55 additions and 30 deletions

View File

@ -3,10 +3,10 @@
B64_DIRS := common/secrets B64_DIRS := common/secrets
B64_EXCLUDE := $(wildcard common/secrets/*.b64) B64_EXCLUDE := $(wildcard common/secrets/*.b64)
CHARTS := ceph mariadb rabbitmq memcached keystone openstack CHARTS := ceph mariadb rabbitmq GLANCE memcached keystone glance openstack
COMMON_TPL := common/templates/_globals.tpl COMMON_TPL := common/templates/_globals.tpl
all: common bootstrap mariadb rabbitmq memcached keystone openstack all: common bootstrap mariadb rabbitmq memcached keystone glance openstack
common: build-common common: build-common
@ -20,6 +20,8 @@ keystone: build-keystone
rabbitmq: build-rabbitmq rabbitmq: build-rabbitmq
glance: build-glance
memcached: build-memcached memcached: build-memcached
openstack: build-openstack openstack: build-openstack

View File

@ -2,18 +2,3 @@ dependencies:
- name: common - name: common
repository: http://localhost:8879/charts repository: http://localhost:8879/charts
version: 0.1.0 version: 0.1.0
- name: mariadb
repository: http://localhost:8879/charts
version: 0.1.0
- name: rabbitmq
repository: http://localhost:8879/charts
version: 0.1.0
- name: memcached
repository: http://localhost:8879/charts
version: 0.1.0
- name: keystone
repository: http://localhost:8879/charts
version: 0.1.0
- name: keystone
repository: http://localhost:8879/charts
version: 0.1.0

View File

@ -2,4 +2,4 @@
{{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }} {{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }}
{{- end -}} {{- end -}}
{{ define "keystone_auth" }}auth: "{'auth_url':'{{ .Values.keystone.auth_url }}', 'username':'{{ .Values.keystone.admin_user }}','password':'{{ .Values.keystone.admin_password }}','project_name':'{{ .Values.keystone.admin_project_name }}','domain_name':'default'}"{{end}} {{ define "keystone_auth" }}{'auth_url':'{{ .Values.keystone.auth_url }}', 'username':'{{ .Values.keystone.admin_user }}','password':'{{ .Values.keystone.admin_password }}','project_name':'{{ .Values.keystone.admin_project_name }}','domain_name':'default'}{{end}}

View File

@ -13,6 +13,7 @@ spec:
{ {
"name": "init", "name": "init",
"image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0",
"imagePullPolicy": "{{ .Values.images.pull_policy }}",
"env": [ "env": [
{ {
"name": "NAMESPACE", "name": "NAMESPACE",
@ -39,7 +40,7 @@ spec:
containers: containers:
- name: glance-api - name: glance-api
image: {{ .Values.images.api }} image: {{ .Values.images.api }}
imagePullPolicy: Always imagePullPolicy: {{ .Values.images.pull_policy }}
command: command:
- bash - bash
- /tmp/start.sh - /tmp/start.sh

View File

@ -10,6 +10,7 @@ spec:
{ {
"name": "init", "name": "init",
"image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0",
"imagePullPolicy": "{{ .Values.images.pull_policy }}",
"env": [ "env": [
{ {
"name": "NAMESPACE", "name": "NAMESPACE",
@ -35,7 +36,7 @@ spec:
containers: containers:
- name: glance-db-sync - name: glance-db-sync
image: {{ .Values.images.db_sync }} image: {{ .Values.images.db_sync }}
imagePullPolicy: Always imagePullPolicy: {{ .Values.images.pull_policy }}
command: command:
- bash - bash
- /tmp/db-sync.sh - /tmp/db-sync.sh

View File

@ -10,6 +10,7 @@ spec:
{ {
"name": "init", "name": "init",
"image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0",
"imagePullPolicy": "{{ .Values.images.pull_policy }}",
"env": [ "env": [
{ {
"name": "NAMESPACE", "name": "NAMESPACE",
@ -35,7 +36,7 @@ spec:
containers: containers:
- name: glance-init - name: glance-init
image: {{ .Values.images.init }} image: {{ .Values.images.init }}
imagePullPolicy: Always imagePullPolicy: {{ .Values.images.pull_policy }}
env: env:
- name: ANSIBLE_LIBRARY - name: ANSIBLE_LIBRARY
value: /usr/share/ansible/ value: /usr/share/ansible/

View File

@ -6,9 +6,41 @@ data:
post.sh: |+ post.sh: |+
#!/bin/bash #!/bin/bash
set -ex set -ex
export HOME=/tmp
ansible localhost -vvv -m kolla_keystone_service -a "service_name=glance service_type=image description='Openstack Image' endpoint_region={{ .Values.keystone.glance_region_name }} url='http://glance-api:{{ .Values.network.port.api }}' interface=admin region_name={{ .Values.keystone.admin_region_name }} auth='{{ include "keystone_auth" . }}'" -e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }" ansible localhost -vvv -m kolla_keystone_service -a 'service_name=glance \
ansible localhost -vvv -m kolla_keystone_service -a "service_name=glance service_type=image description='Openstack Image' endpoint_region={{ .Values.keystone.glance_region_name }} url='http://glance-api:{{ .Values.network.port.api }}' interface=internal region_name={{ .Values.keystone.admin_region_name }} auth='{{ include "keystone_auth" . }}'" -e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }" service_type=image \
ansible localhost -vvv -m kolla_keystone_service -a "service_name=glance service_type=image description='Openstack Image' endpoint_region={{ .Values.keystone.glance_region_name }} url='http://glance-api:{{ .Values.network.port.api }}' interface=public region_name={{ .Values.keystone.admin_region_name }} auth='{{ include "keystone_auth" . }}' " -e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }" description="Openstack Image" \
ansible localhost -vvv -m kolla_keystone_user -a "project=service user={{ .Values.keystone.glance_user }} password={{ .Values.keystone.glance_password }} role=admin region_name={{ .Values.keystone.admin_region_name }} auth='{{ include "keystone_auth" . }}'" -e "{'openstack_glance_auth': {{ include "keystone_auth" .}}}" endpoint_region="{{ .Values.keystone.glance_region_name }}" \
url="http://glance-api:{{ .Values.network.port.api }}" \
interface=admin \
region_name="{{ .Values.keystone.admin_region_name }}" \
auth="{# openstack_glance_auth #}"' \
-e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }"
ansible localhost -vvv -m kolla_keystone_service -a 'service_name=glance \
service_type=image \
description="Openstack Image" \
endpoint_region="{{ .Values.keystone.glance_region_name }}" \
url="http://glance-api:{{ .Values.network.port.api }}" \
interface=internal \
region_name="{{ .Values.keystone.admin_region_name }}" \
auth="{# openstack_glance_auth #}"' \
-e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }"
ansible localhost -vvv -m kolla_keystone_service -a 'service_name=glance \
service_type=image \
description="Openstack Image" \
endpoint_region="{{ .Values.keystone.glance_region_name }}" \
url="http://glance-api:{{ .Values.network.port.api }}" \
interface=public \
region_name="{{ .Values.keystone.admin_region_name }}" \
auth="{# openstack_glance_auth #}"' \
-e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }"
ansible localhost -vvv -m kolla_keystone_user -a "project=service \
user={{ .Values.keystone.glance_user }} \
password={{ .Values.keystone.glance_password }} \
role=admin \
region_name={{ .Values.keystone.admin_region_name }} \
auth="{# openstack_glance_auth #}"' \
-e "{ 'openstack_glance_auth': {{ include "keystone_auth" . }} }"

View File

@ -10,6 +10,7 @@ spec:
{ {
"name": "init", "name": "init",
"image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0",
"imagePullPolicy": "{{ .Values.images.pull_policy }}",
"env": [ "env": [
{ {
"name": "NAMESPACE", "name": "NAMESPACE",
@ -35,7 +36,7 @@ spec:
containers: containers:
- name: glance-post - name: glance-post
image: {{ .Values.images.post }} image: {{ .Values.images.post }}
imagePullPolicy: Always imagePullPolicy: {{ .Values.images.pull_policy }}
command: command:
- bash - bash
- /tmp/post.sh - /tmp/post.sh

View File

@ -13,6 +13,7 @@ spec:
{ {
"name": "init", "name": "init",
"image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0",
"imagePullPolicy": "{{ .Values.images.pull_policy }}",
"env": [ "env": [
{ {
"name": "NAMESPACE", "name": "NAMESPACE",
@ -39,9 +40,9 @@ spec:
containers: containers:
- name: glance-registry - name: glance-registry
image: {{ .Values.images.registry }} image: {{ .Values.images.registry }}
imagePullPolicy: Always imagePullPolicy: {{ .Values.images.pull_policy }}
command: command:
- glance-registr - glance-registry
ports: ports:
- containerPort: {{ .Values.network.port.registry }} - containerPort: {{ .Values.network.port.registry }}
readinessProbe: readinessProbe:

View File

@ -15,6 +15,7 @@ images:
init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
registry: quay.io/stackanetes/stackanetes-glance-registry:newton registry: quay.io/stackanetes/stackanetes-glance-registry:newton
post: quay.io/stackanetes/stackanetes-kolla-toolbox:newton post: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
pull_policy: "IfNotPresent"
keystone: keystone:
auth_uri: "http://keystone-api:5000" auth_uri: "http://keystone-api:5000"
@ -91,7 +92,7 @@ dependencies:
- glance-db-sync - glance-db-sync
- keystone-db-sync - keystone-db-sync
- keystone-init - keystone-init
- mariadb-init - mariadb-seed
service: service:
- mariadb - mariadb
- keystone-api - keystone-api