Dashboard added to Deployment

Added a new role for deploying the Kubernetes Dashboard with Kargo.
This commit is contained in:
Vincent Schwarzer 2017-02-27 14:34:58 +01:00
parent 9b3aa3451e
commit 3ead64e325
4 changed files with 102 additions and 0 deletions

View file

@ -0,0 +1,2 @@
---
dashboard_namespace: kube-system

View file

@ -0,0 +1,18 @@
---
- name: Kubernetes Dashboard | Lay Down Dasboard Template
template: src={{item.file}} dest={{kube_config_dir}}/{{item.file}}
with_items:
- {file: kubernetes-dashboard.yml, type: deployment, name: kubernetes-dashboard}
register: manifests
when: inventory_hostname == groups['kube-master'][0]
- name: Kubernetes Dashboard | Start Dashboard Resource
kube:
name: "{{item.item.name}}"
namespace: "{{dashboard_namespace}}"
kubectl: "{{bin_dir}}/kubectl"
resource: "{{item.item.type}}"
filename: "{{kube_config_dir}}/{{item.item.file}}"
state: "{{item.changed | ternary('latest','present') }}"
with_items: "{{ manifests.results }}"
when: inventory_hostname == groups['kube-master'][0]

View file

@ -0,0 +1,80 @@
# Copyright 2015 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: Deployment
apiVersion: extensions/v1beta1
metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: kubernetes-dashboard
template:
metadata:
labels:
app: kubernetes-dashboard
# Comment the following annotation if Dashboard must not be deployed on master
annotations:
scheduler.alpha.kubernetes.io/tolerations: |
[
{
"key": "dedicated",
"operator": "Equal",
"value": "master",
"effect": "NoSchedule"
}
]
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1
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://my-address:port
livenessProbe:
httpGet:
path: /
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
---
kind: Service
apiVersion: v1
metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
type: NodePort
ports:
- port: 80
targetPort: 9090
selector:
app: kubernetes-dashboard

View file

@ -15,3 +15,5 @@ dependencies:
- role: kubernetes-apps/helm
when: helm_enabled
tags: [ apps, helm ]
- role: kubernetes-apps/dashboard
tags: [ apps, dashboard ]