7c15e2728a
1. improved k8s/etcd cluster configuration 2. service/endpoint management 3. init.d scripts 4. gateway (haproxy) nodes with confd 5. code refactoring Change-Id: I0e641108e580bb470494a972013bda465d831bd6
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
Namespaces:
|
|
=: io.murano.apps.docker.kubernetes
|
|
std: io.murano
|
|
res: io.murano.resources
|
|
sys: io.murano.system
|
|
|
|
Name: KubernetesMasterNode
|
|
|
|
Extends: KubernetesNode
|
|
|
|
Methods:
|
|
initialize:
|
|
Body:
|
|
- $._environment: $.find(std:Environment).require()
|
|
|
|
|
|
deployInstance:
|
|
Body:
|
|
- If: not $.getAttr(deployed, false)
|
|
Then:
|
|
- $._environment.reporter.report($this, 'Creating Kubernetes Master')
|
|
- $.super($.deployInstance())
|
|
- $.setAttr(deployed, true)
|
|
|
|
|
|
setupEtcd:
|
|
Body:
|
|
- If: not $.getAttr(etcdConfigured, false)
|
|
Then:
|
|
- $._environment.reporter.report($, 'Configuring etcd master node')
|
|
- $resources: new(sys:Resources)
|
|
- $template: $resources.yaml('MasterEtcdSetup.template').bind(dict(
|
|
name => $.instance.name,
|
|
ip => $.getIp()
|
|
))
|
|
- $.instance.agent.call($template, $resources)
|
|
- $.setAttr(etcdConfigured, true)
|
|
|
|
|
|
setupNode:
|
|
Body:
|
|
- $resources: new(sys:Resources)
|
|
- $._environment.reporter.report($this, 'Setup Flannel network on master node')
|
|
- $template: $resources.yaml('SetupFlannelMaster.template')
|
|
- $.instance.agent.call($template, $resources)
|
|
|
|
- $._environment.reporter.report($this, 'Setup Kubernetes API host')
|
|
- $resources: new(sys:Resources)
|
|
- $template: $resources.yaml('KubeMasterSetup.template').bind(dict(
|
|
name => $.instance.name,
|
|
ip => $.getIp()
|
|
))
|
|
- $.instance.agent.call($template, $resources)
|