-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the monitoring of resources on the cluster
- Loading branch information
1 parent
ff65292
commit 474a559
Showing
8 changed files
with
263 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: monitoring-grafana | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
kubernetes.io/name: "Grafana" | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
selector: | ||
k8s-app: influxGrafana | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: v1 | ||
kind: ReplicationController | ||
metadata: | ||
name: monitoring-heapster-v8 | ||
namespace: kube-system | ||
labels: | ||
k8s-app: heapster | ||
version: v8 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
k8s-app: heapster | ||
version: v8 | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: heapster | ||
version: v8 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
containers: | ||
- image: gcr.io/google_containers/heapster:v0.17.0 | ||
name: heapster | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 300Mi | ||
command: | ||
- /heapster | ||
- --source=kubernetes:'' | ||
- --sink=influxdb:http://monitoring-influxdb:8086 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: monitoring-heapster | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
kubernetes.io/name: "Heapster" | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8082 | ||
selector: | ||
k8s-app: heapster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: v1 | ||
kind: ReplicationController | ||
metadata: | ||
name: monitoring-influx-grafana-v1 | ||
namespace: kube-system | ||
labels: | ||
k8s-app: influxGrafana | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
k8s-app: influxGrafana | ||
version: v1 | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: influxGrafana | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
containers: | ||
- image: gcr.io/google_containers/heapster_influxdb:v0.3 | ||
name: influxdb | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 200Mi | ||
ports: | ||
- containerPort: 8083 | ||
hostPort: 8083 | ||
- containerPort: 8086 | ||
hostPort: 8086 | ||
volumeMounts: | ||
- name: influxdb-persistent-storage | ||
mountPath: /data | ||
- image: gcr.io/google_containers/heapster_grafana:v0.7 | ||
name: grafana | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
env: | ||
- name: INFLUXDB_EXTERNAL_URL | ||
value: /api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb:api/db/ | ||
- name: INFLUXDB_HOST | ||
value: monitoring-influxdb | ||
- name: INFLUXDB_PORT | ||
value: "8086" | ||
volumes: | ||
- name: influxdb-persistent-storage | ||
emptyDir: {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: monitoring-influxdb | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
kubernetes.io/name: "InfluxDB" | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8083 | ||
targetPort: 8083 | ||
- name: api | ||
port: 8086 | ||
targetPort: 8086 | ||
selector: | ||
k8s-app: influxGrafana | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
- name: Monitoring | Influxdb | Write controller file | ||
sudo: yes | ||
copy: | ||
src: influxdb-grafana-controller.yaml | ||
dest: "{{ kube_manifest_dir }}/influxdb-grafana-controller.yaml" | ||
register: influxdb_rc_def | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Influxdb | Write service file | ||
sudo: yes | ||
copy: | ||
src: influxdb-service.yaml | ||
dest: "{{ kube_manifest_dir }}/influxdb-service.yaml" | ||
register: influxdb_svc_def | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Grafana | Write service file | ||
sudo: yes | ||
copy: | ||
src: grafana-service.yaml | ||
dest: "{{ kube_manifest_dir }}/grafana-service.yaml" | ||
register: grafana_svc_def | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Heapster | Write controller file | ||
sudo: yes | ||
copy: | ||
src: heapster-controller.yaml | ||
dest: "{{ kube_manifest_dir }}/heapster-controller.yaml" | ||
register: heapster_rc_def | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Heapster | Write service file | ||
sudo: yes | ||
copy: | ||
src: heapster-service.yaml | ||
dest: "{{ kube_manifest_dir }}/heapster-service.yaml" | ||
register: heapster_svc_def | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Influxdb | Create/update replication controller | ||
sudo: yes | ||
kube: | ||
namespace: kube-system | ||
resource: rc | ||
name: monitoring-influx-grafana-v1 | ||
filename: "{{ kube_manifest_dir }}/influxdb-grafana-controller.yaml" | ||
state: "{{ influxdb_rc_def.changed | ternary('latest','present') }}" | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Influxdb | Create/update service | ||
sudo: yes | ||
kube: | ||
namespace: kube-system | ||
resource: svc | ||
name: monitoring-influxdb | ||
filename: "{{ kube_manifest_dir }}/influxdb-service.yaml" | ||
state: "{{ influxdb_svc_def.changed | ternary('latest','present') }}" | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Grafana | Create/update service | ||
sudo: yes | ||
kube: | ||
namespace: kube-system | ||
resource: svc | ||
name: monitoring-grafana | ||
filename: "{{ kube_manifest_dir }}/grafana-service.yaml" | ||
state: "{{ grafana_svc_def.changed | ternary('latest','present') }}" | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Heapster | Create/update replication controller | ||
sudo: yes | ||
kube: | ||
namespace: kube-system | ||
resource: rc | ||
name: monitoring-heapster-v8 | ||
filename: "{{ kube_manifest_dir }}/heapster-controller.yaml" | ||
state: "{{ heapster_rc_def.changed | ternary('latest','present') }}" | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|
||
- name: Monitoring | Heapster | Create/update service | ||
sudo: yes | ||
kube: | ||
namespace: kube-system | ||
resource: svc | ||
name: monitoring-heapster | ||
filename: "{{ kube_manifest_dir }}/heapster-service.yaml" | ||
state: "{{ heapster_svc_def.changed | ternary('latest','present') }}" | ||
when: enable_monitoring | ||
tags: | ||
- addons | ||
- monitoring | ||
|