Incorporated changes based on feedback of the pull request.

This commit is contained in:
Vincent Schwarzer 2017-03-01 14:11:17 +01:00
parent 3ead64e325
commit 70f92c7332
7 changed files with 25 additions and 6 deletions

View file

@ -141,3 +141,6 @@ efk_enabled: false
# Helm deployment
helm_enabled: false
# Dashboard deployment
dashboard_enabled: false

View file

@ -91,6 +91,9 @@ fluentd_image_tag: "{{ fluentd_version }}"
kibana_version: "v4.6.1"
kibana_image_repo: "gcr.io/google_containers/kibana"
kibana_image_tag: "{{ kibana_version }}"
dashboard_version: "v1.5.1"
dashboard_image_repo: "gcr.io/google_containers/kubernetes-dashboard-amd64"
dashboard_image_tag: "{{ dashboard_version }}"
helm_version: "v2.2.2"
helm_image_repo: "lachlanevenson/k8s-helm"
@ -238,6 +241,11 @@ downloads:
repo: "{{ tiller_image_repo }}"
tag: "{{ tiller_image_tag }}"
sha256: "{{ tiller_digest_checksum|default(None) }}"
dashboard:
container: true
repo: "{{ dashboard_image_repo }}"
tag: "{{ dashboard_image_tag }}"
sha256: "{{ dashboard_digest_checksum|default(None) }}"
download:
container: "{{ file.container|default('false') }}"

View file

@ -1,2 +1,3 @@
---
dashboard_namespace: kube-system
dashboard_port: 80

View file

@ -0,0 +1,4 @@
---
dependencies:
- role: download
file: "{{ downloads.dashboard }}"

View file

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

View file

@ -22,7 +22,7 @@ metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
namespace: "{{dashboard_namespace}}"
spec:
replicas: 1
revisionHistoryLimit: 10
@ -47,7 +47,7 @@ spec:
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1
image: "{{ dashboard_image_repo }}:{{ dashboard_image_tag }}"
imagePullPolicy: Always
ports:
- containerPort: 9090
@ -74,7 +74,7 @@ metadata:
spec:
type: NodePort
ports:
- port: 80
- port: {{ dashboard_port}}
targetPort: 9090
selector:
app: kubernetes-dashboard

View file

@ -16,4 +16,5 @@ dependencies:
when: helm_enabled
tags: [ apps, helm ]
- role: kubernetes-apps/dashboard
when: dashboard_enabled
tags: [ apps, dashboard ]