diff options
Diffstat (limited to 'ci/config_tpl/juju2/bundlek8_tpl')
-rw-r--r-- | ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml | 4 | ||||
-rw-r--r-- | ci/config_tpl/juju2/bundlek8_tpl/etcd.yaml | 10 | ||||
-rw-r--r-- | ci/config_tpl/juju2/bundlek8_tpl/kubeapi-load-balancer.yaml | 8 | ||||
-rw-r--r-- | ci/config_tpl/juju2/bundlek8_tpl/relations.yaml | 28 |
4 files changed, 41 insertions, 9 deletions
diff --git a/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml b/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml index 7af74afa..17281be1 100644 --- a/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml +++ b/ci/config_tpl/juju2/bundlek8_tpl/bundle.yaml @@ -16,6 +16,10 @@ {% include 'easyrsa.yaml' %} {% include 'etcd.yaml' %} {% include 'subordinate.yaml' %} +{% if os.kubernetes.loadbalancer %} +{% include 'kubeapi-load-balancer.yaml' %} +{% endif %} + relations: - [ 'ntp:juju-info', 'nodes:juju-info' ] diff --git a/ci/config_tpl/juju2/bundlek8_tpl/etcd.yaml b/ci/config_tpl/juju2/bundlek8_tpl/etcd.yaml index ba99d0e9..eaea9543 100644 --- a/ci/config_tpl/juju2/bundlek8_tpl/etcd.yaml +++ b/ci/config_tpl/juju2/bundlek8_tpl/etcd.yaml @@ -1,6 +1,16 @@ etcd: charm: "./{{ ubuntu.release }}/etcd" +{% if os.kubernetes.loadbalancer %} + num_units: 3 +{% else %} num_units: 1 +{% endif %} to: +{% if os.kubernetes.loadbalancer %} +{% for unit_id in to_select() %} + - "nodes/{{ unit_id }}" +{% endfor %} +{% else %} - "nodes/0" +{% endif %} diff --git a/ci/config_tpl/juju2/bundlek8_tpl/kubeapi-load-balancer.yaml b/ci/config_tpl/juju2/bundlek8_tpl/kubeapi-load-balancer.yaml new file mode 100644 index 00000000..08e7b33a --- /dev/null +++ b/ci/config_tpl/juju2/bundlek8_tpl/kubeapi-load-balancer.yaml @@ -0,0 +1,8 @@ + + kubeapi-load-balancer: + charm: "./{{ ubuntu.release }}/kubeapi-load-balancer" + num_units: 1 + expose: true + to: + - "nodes/0" + diff --git a/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml b/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml index fd56090c..63fefab4 100644 --- a/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml +++ b/ci/config_tpl/juju2/bundlek8_tpl/relations.yaml @@ -1,9 +1,19 @@ - - [ "kubernetes-master:kube-api-endpoint", "kubernetes-worker:kube-api-endpoint" ] - - [ "kubernetes-master:cluster-dns", "kubernetes-worker:kube-dns" ] - - [ "kubernetes-master:certificates", "easyrsa:client" ] - - [ "kubernetes-master:etcd", "etcd:db" ] - - [ "kubernetes-worker:certificates", "easyrsa:client" ] - - [ "flannel:etcd", "etcd:db" ] - - [ "flannel:cni", "kubernetes-master:cni" ] - - [ "flannel:cni", "kubernetes-worker:cni" ] - - [ "etcd:certificates", "easyrsa:client" ] +{% if os.kubernetes.loadbalancer %} + - [ 'kubernetes-master:kube-api-endpoint', 'kubeapi-load-balancer:apiserver' ] +{% else %} + - [ 'kubernetes-master:kube-api-endpoint', 'kubernetes-worker:kube-api-endpoint' ] +{% endif %} + - [ 'kubernetes-master:cluster-dns', 'kubernetes-worker:kube-dns' ] + - [ 'kubernetes-master:certificates', 'easyrsa:client' ] + - [ 'kubernetes-master:etcd', 'etcd:db' ] + - [ 'kubernetes-worker:certificates', 'easyrsa:client' ] + - [ 'flannel:etcd', 'etcd:db' ] + - [ 'flannel:cni', 'kubernetes-master:cni' ] + - [ 'flannel:cni', 'kubernetes-worker:cni' ] + - [ 'etcd:certificates', 'easyrsa:client' ] +{% if os.kubernetes.loadbalancer %} + - [ 'kubernetes-master:loadbalancer', 'kubeapi-load-balancer:loadbalancer' ] + - [ 'kubernetes-worker:kube-api-endpoint', 'kubeapi-load-balancer:website' ] + - [ 'kubeapi-load-balancer:certificates', 'easyrsa:client' ] +{% endif %} + |