@when('etcd.available', 'tls_client.server.certificate.saved', 'authentication.setup')
@when_not('kubernetes-master.components.started')
def start_master(etcd):
    'Run the Kubernetes master components.'
    hookenv.status_set('maintenance', 'Configuring the Kubernetes master services.')
    freeze_service_cidr()
    if (not etcd.get_connection_string()):
        return
    handle_etcd_relation(etcd)
    configure_master_services()
    hookenv.status_set('maintenance', 'Starting the Kubernetes master services.')
    services = ['kube-apiserver', 'kube-controller-manager', 'kube-scheduler']
    for service in services:
        host.service_restart(('snap.%s.daemon' % service))
    hookenv.open_port(6443)
    set_state('kubernetes-master.components.started')
Run the Kubernetes master components.
@when('etcd.available', 'tls_client.server.certificate.saved', 'authentication.setup')
@when_not('kubernetes-master.components.started')
def start_master(etcd):
    
    hookenv.status_set('maintenance', 'Configuring the Kubernetes master services.')
    freeze_service_cidr()
    if (not etcd.get_connection_string()):
        return
    handle_etcd_relation(etcd)
    configure_master_services()
    hookenv.status_set('maintenance', 'Starting the Kubernetes master services.')
    services = ['kube-apiserver', 'kube-controller-manager', 'kube-scheduler']
    for service in services:
        host.service_restart(('snap.%s.daemon' % service))
    hookenv.open_port(6443)
    set_state('kubernetes-master.components.started')