
When Environment get deleted both Docker/k8s host and Docker applications get deleted. So it is possible that host will try to delete container from an Instance that was already destroyed. Attempt to send commands to such instance will hang until timeout because there is no more agent exist on the other side. Change-Id: Ia6e8064ae50c24ce595ed08e446ed45b96b4a330 Closes-Bug: #1504623 Depends-On: I298f3f079a153ef87ed7213b7f1432c9e5e4b4b6
77 lines
2.5 KiB
YAML
77 lines
2.5 KiB
YAML
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
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(instanceDeployed, false)
|
|
Then:
|
|
- $._environment.reporter.report($this, 'Creating Kubernetes Master')
|
|
- $.super($.deployInstance())
|
|
- $.setAttr(instanceDeployed, 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:
|
|
- If: not $.getAttr(nodeConfigured, false)
|
|
Then:
|
|
- $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)
|
|
- $.setAttr(nodeConfigured, true)
|
|
- $msg: 'Kubernetes API is now available at http://{0}:8080'
|
|
- $ip: coalesce($.instance.floatingIpAddress, $.getIp())
|
|
- $._environment.reporter.report($this, $msg.format($ip))
|
|
|
|
isAvailable:
|
|
Body:
|
|
Return: $.instance.isDeployed()
|
|
|