Add ability to specify target-manifest for Armada

Change-Id: Ica00512062fb19ae395544c254de517fe0161e12
This commit is contained in:
Mark Burnett 2018-01-26 10:14:02 -06:00
parent b4449434a5
commit 8c468b359b
6 changed files with 29 additions and 6 deletions

View File

@ -23,6 +23,8 @@ Here is a complete sample document:
data:
hostname: n0
ip: 192.168.77.10
armada:
target_manifest: cluster-bootstrap
labels:
static:
- calico-etcd=enabled
@ -49,6 +51,14 @@ Here is a complete sample document:
mode: 0644
Amrada
------
This section contains particular configuration options for bootstrapping with
Armada. It currently only supports a single option: ``target_manifest``, which
specifies which ``armada/Manifest/v1`` to be used during Genesis.
Bootstrapping Images
--------------------

View File

@ -9,6 +9,8 @@ metadata:
data:
hostname: n0
ip: 192.168.77.10
armada:
target_manifest: cluster-bootstrap
labels:
dynamic:
- calico-etcd=enabled

View File

@ -10,6 +10,8 @@ metadata:
data:
hostname: n0
ip: 192.168.77.10
armada:
target_manifest: cluster-bootstrap
labels:
dynamic:
- calico-etcd=enabled

View File

@ -55,11 +55,9 @@ class Configuration:
return cls(documents=documents, **kwargs)
def __getitem__(self, path):
value = self.get_path(path)
if value:
return value
else:
return jinja2.StrictUndefined('No match found for path %s' % path)
return self.get_path(path,
jinja2.StrictUndefined(
'No match found for path %s' % path))
def get_first(self, *paths):
result = self._get_first(*paths)

View File

@ -57,6 +57,13 @@ data:
type: object
properties:
armada:
type: object
properties:
target_manifest:
type: string
additionalProperties: false
files:
type: array
items:

View File

@ -59,7 +59,11 @@ spec:
while true; do
sleep 10
if armada --debug apply --tiller-host 127.0.0.1 /etc/genesis/armada/assets/manifest.yaml &>> "${ARMADA_LOGFILE}"; then
if armada --debug \
apply \
--target-manifest {{ config.get_path('Genesis:armada.target_manifest', 'cluster-bootstrap') }} \
--tiller-host 127.0.0.1 \
/etc/genesis/armada/assets/manifest.yaml &>> "${ARMADA_LOGFILE}"; then
break
fi
done