Merge "[k8s] Add Dashboard UI v1.4 addon to K8s Cluster"
This commit is contained in:
commit
7c09cfc263
@ -55,6 +55,10 @@ Properties:
|
||||
Contract: $.bool().notNull()
|
||||
Default: true
|
||||
|
||||
enableDashboard:
|
||||
Contract: $.bool().notNull()
|
||||
Default: true
|
||||
|
||||
dockerRegistry:
|
||||
Contract: $.string()
|
||||
|
||||
@ -152,11 +156,22 @@ Methods:
|
||||
Then:
|
||||
$._deployDns()
|
||||
|
||||
- If: $.enableDashboard
|
||||
Then:
|
||||
- $._deployDashboard()
|
||||
- If: $.gatewayCount > 0
|
||||
Then:
|
||||
- $msg: $.gatewayNodes.take($.gatewayCount).select('http://{0}:{1}'.format($.getIp(true), 9090)).join(', ')
|
||||
- $._environment.reporter.report($this, 'Dashboard UI is available at {0}'.format($msg))
|
||||
Else:
|
||||
- $._environment.reporter.report($this, 'Dashboard UI is installed but is not accessible from outside')
|
||||
|
||||
- $._environment.stack.push()
|
||||
- $._updateServicePublicIps()
|
||||
- $.setAttr(lastNodeCount, $.nodeCount)
|
||||
- $.setAttr(lastGatewayCount, $.gatewayCount)
|
||||
- $._environment.reporter.report($this, 'Kubernetes cluster is up and running')
|
||||
|
||||
- $.setAttr(serviceEndpoints, $.serviceEndpoints)
|
||||
|
||||
|
||||
@ -165,6 +180,23 @@ Methods:
|
||||
Return: $.masterNode.getIp()
|
||||
|
||||
|
||||
_deployDashboard:
|
||||
Body:
|
||||
- If: not $.getAttr(uiDeployed, false)
|
||||
Then:
|
||||
- $securityGroupIngress:
|
||||
- ToPort: 9090
|
||||
FromPort: 9090
|
||||
IpProtocol: tcp
|
||||
External: $.masterNode.instance.assignFloatingIp
|
||||
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
|
||||
|
||||
- $resources: new(sys:Resources)
|
||||
- $template: $resources.yaml('DeployDashboard.template').bind(dict(ip => $.getIp()))
|
||||
- $.masterNode.instance.agent.call($template, $resources)
|
||||
- $.setAttr(uiDeployed, true)
|
||||
|
||||
|
||||
_deployDns:
|
||||
Body:
|
||||
- If: not $.getAttr(dnsDeployed, false)
|
||||
|
@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
|
||||
FormatVersion: 2.0.0
|
||||
Version: 1.0.0
|
||||
Name: Deploy Dashboard
|
||||
|
||||
Parameters:
|
||||
ip: $ip
|
||||
|
||||
Body: |
|
||||
return deploy('{0}'.format(args.ip)).stdout
|
||||
|
||||
Scripts:
|
||||
deploy:
|
||||
Type: Application
|
||||
Version: 1.0.0
|
||||
EntryPoint: deployDashboard.sh
|
||||
Files:
|
||||
- addons/kube-dashboard-addon.yaml
|
||||
Options:
|
||||
captureStdout: true
|
||||
captureStderr: true
|
@ -0,0 +1,70 @@
|
||||
# Copyright 2016 Google Inc. All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Configuration to deploy release version of the Dashboard UI.
|
||||
#
|
||||
# Example usage: kubectl create -f <this_file>
|
||||
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
labels:
|
||||
app: kubernetes-dashboard
|
||||
name: kubernetes-dashboard
|
||||
namespace: kube-system
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 9090
|
||||
targetPort: 9090
|
||||
selector:
|
||||
app: kubernetes-dashboard
|
||||
|
||||
---
|
||||
|
||||
kind: Deployment
|
||||
apiVersion: extensions/v1beta1
|
||||
metadata:
|
||||
labels:
|
||||
app: kubernetes-dashboard
|
||||
name: kubernetes-dashboard
|
||||
namespace: kube-system
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: kubernetes-dashboard
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: kubernetes-dashboard
|
||||
spec:
|
||||
containers:
|
||||
- name: kubernetes-dashboard
|
||||
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.4.0
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 9090
|
||||
protocol: TCP
|
||||
args:
|
||||
# Uncomment the following line to manually specify Kubernetes API server Host
|
||||
# If not specified, Dashboard will attempt to auto discover the API server and connect
|
||||
# to it. Uncomment only if the default does not work.
|
||||
- --apiserver-host=http://%%MASTER_IP%%:8080
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 9090
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 30
|
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# $1 - IP
|
||||
|
||||
sed -i.bak "s/%%MASTER_IP%%/$1/g" addons/kube-dashboard-addon.yaml
|
||||
|
||||
cp -f addons/kube-dashboard-addon.yaml /etc/kubernetes/addons
|
||||
|
||||
/opt/bin/kubectl create -f /etc/kubernetes/addons/kube-dashboard-addon.yaml >> /tmp/murano-kube.log
|
@ -5,6 +5,22 @@ defaults
|
||||
contimeout 5000
|
||||
clitimeout 50000
|
||||
srvtimeout 50000
|
||||
|
||||
#Template for kubernetes-dashboard addon
|
||||
{{$svc := "/registry/services/endpoints/kube-system/kubernetes-dashboard"}}
|
||||
{{if exists $svc}}
|
||||
{{$uiEndpoint := get $svc}}
|
||||
{{$uiSpec := get "/registry/services/specs/kube-system/kubernetes-dashboard"}}
|
||||
{{$uiEndpointJson := json $uiEndpoint.Value}}{{$uiSpecJson := json $uiSpec.Value}}
|
||||
{{range $port := $uiSpecJson.spec.ports}}
|
||||
listen kubernetes-dashboard-{{$port.port}} 0.0.0.0:{{$port.port}}
|
||||
mode tcp
|
||||
balance leastconn
|
||||
{{range $subset := $uiEndpointJson.subsets}}{{range $index, $endpoint := $subset.addresses}}
|
||||
server srv{{$index}} {{$endpoint.ip}}:{{$port.targetPort}}
|
||||
{{end}}{{end}}{{end}}{{end}}
|
||||
|
||||
#Template for the rest of services located in default namespace
|
||||
{{range $svc := ls "/registry/services/endpoints/default"}}
|
||||
{{$se := printf "/registry/services/endpoints/default/%s" $svc }}
|
||||
{{$ss := printf "/registry/services/specs/default/%s" $svc }}
|
||||
|
@ -67,6 +67,7 @@ Application:
|
||||
dockerMirror: $.kubeNetConfiguration.dockerMirror
|
||||
gcloudKey: $.kubeNetConfiguration.gcloudKey
|
||||
enableKubeDns: $.kubeNetConfiguration.enableKubeDns
|
||||
enableDashboard: $.kubeNetConfiguration.enableDashboard
|
||||
|
||||
Forms:
|
||||
- nodesConfiguration:
|
||||
@ -180,6 +181,13 @@ Forms:
|
||||
description: >-
|
||||
Check, if you are going to use KubeDNS feature in your cluster
|
||||
required: false
|
||||
- name: enableDashboard
|
||||
type: boolean
|
||||
initial: true
|
||||
label: Enable Kubernetes Dashboard addon
|
||||
description: >-
|
||||
Check, if you are going to use Kubernetes Dashboard in your cluster
|
||||
required: false
|
||||
- name: dockerRegistry
|
||||
type: string
|
||||
label: Custom Docker registry URL
|
||||
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
features:
|
||||
- Now Kubernetes Cluster murano application provides ability to install
|
||||
Kubernetes Dashbord addon v1.4 during cluster deployment.
|
||||
Dashboard (the web-based user interface of Kubernetes) allows user
|
||||
to deploy containerized applications to a Kubernetes cluster, troubleshoot
|
||||
them, and manage the cluster and its resources itself.
|
||||
User can find dashbord endpoint in deployment logs.
|
Loading…
Reference in New Issue
Block a user