mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Enable Google Cloud Monitoring and Google Cloud Logging instead of
Influxdb for Google Compute Engine deployments.
This commit is contained in:
@@ -19,17 +19,14 @@ spec:
|
||||
- image: gcr.io/google_containers/heapster:v0.11.0
|
||||
name: heapster
|
||||
env:
|
||||
- name: "INFLUXDB_HOST"
|
||||
value: "http://monitoring-influxdb"
|
||||
- name: "SINK"
|
||||
value: "influxdb"
|
||||
volumeMounts:
|
||||
- name: FLAGS
|
||||
value: "--poll_duration=2m --stats_resolution=1m --sink=gcm --sink=gcl"
|
||||
volumeMounts:
|
||||
- name: ssl-certs
|
||||
mountPath: /etc/ssl/certs
|
||||
readOnly: true
|
||||
volumes:
|
||||
volumes:
|
||||
- name: ssl-certs
|
||||
source:
|
||||
hostDir:
|
||||
path: /etc/ssl/certs
|
||||
hostPath:
|
||||
path: /etc/ssl/certs
|
||||
|
@@ -1,10 +0,0 @@
|
||||
apiVersion: v1beta1
|
||||
kind: Service
|
||||
id: monitoring-grafana
|
||||
port: 80
|
||||
containerPort: 8080
|
||||
labels:
|
||||
name: grafana
|
||||
kubernetes.io/cluster-service: "true"
|
||||
selector:
|
||||
name: influxGrafana
|
@@ -1,36 +0,0 @@
|
||||
apiVersion: v1beta1
|
||||
id: monitoring-heapster-controller
|
||||
kind: ReplicationController
|
||||
desiredState:
|
||||
replicas: 1
|
||||
replicaSelector:
|
||||
name: heapster
|
||||
podTemplate:
|
||||
desiredState:
|
||||
manifest:
|
||||
version: v1beta1
|
||||
id: monitoring-heapster
|
||||
containers:
|
||||
- name: heapster
|
||||
image: gcr.io/google_containers/heapster:v0.11.0
|
||||
env:
|
||||
- name: "INFLUXDB_HOST"
|
||||
value: "monitoring-influxdb"
|
||||
- name: "SINK"
|
||||
value: "influxdb"
|
||||
volumeMounts:
|
||||
- name: ssl-certs
|
||||
mountPath: /etc/ssl/certs
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: ssl-certs
|
||||
source:
|
||||
hostDir:
|
||||
path: /etc/ssl/certs
|
||||
labels:
|
||||
name: heapster
|
||||
uses: monitoring-influxdb
|
||||
kubernetes.io/cluster-service: "true"
|
||||
labels:
|
||||
name: heapster
|
||||
kubernetes.io/cluster-service: "true"
|
@@ -1,10 +0,0 @@
|
||||
apiVersion: v1beta1
|
||||
kind: Service
|
||||
id: monitoring-heapster
|
||||
port: 80
|
||||
containerPort: 8082
|
||||
labels:
|
||||
name: heapster
|
||||
kubernetes.io/cluster-service: "true"
|
||||
selector:
|
||||
name: heapster
|
@@ -1,35 +0,0 @@
|
||||
apiVersion: v1beta1
|
||||
kind: ReplicationController
|
||||
id: monitoring-influx-grafana-controller
|
||||
desiredState:
|
||||
replicas: 1
|
||||
replicaSelector:
|
||||
name: influxGrafana
|
||||
podTemplate:
|
||||
labels:
|
||||
name: influxGrafana
|
||||
kubernetes.io/cluster-service: "true"
|
||||
desiredState:
|
||||
manifest:
|
||||
version: v1beta1
|
||||
id: monitoring-influx-grafana
|
||||
containers:
|
||||
- name: influxdb
|
||||
image: gcr.io/google_containers/heapster_influxdb:v0.3
|
||||
ports:
|
||||
- containerPort: 8083
|
||||
hostPort: 8083
|
||||
- containerPort: 8086
|
||||
hostPort: 8086
|
||||
- name: grafana
|
||||
image: gcr.io/google_containers/heapster_grafana:v0.7
|
||||
env:
|
||||
- name: "INFLUXDB_EXTERNAL_URL"
|
||||
value: '/api/v1beta1/proxy/services/monitoring-grafana/db/'
|
||||
- name: "INFLUXDB_HOST"
|
||||
value: 'monitoring-influxdb'
|
||||
- name: "INFLUXDB_PORT"
|
||||
value: '80'
|
||||
labels:
|
||||
name: influxGrafana
|
||||
kubernetes.io/cluster-service: "true"
|
@@ -1,9 +0,0 @@
|
||||
apiVersion: v1beta1
|
||||
kind: Service
|
||||
id: monitoring-influxdb
|
||||
port: 80
|
||||
containerPort: 8086
|
||||
labels:
|
||||
name: influxdb
|
||||
selector:
|
||||
name: influxGrafana
|
@@ -6,11 +6,9 @@ metadata:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
name: monitoring-grafana
|
||||
spec:
|
||||
ports:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
||||
selector:
|
||||
name: influxGrafana
|
||||
kubernetes.io/cluster-service: "true"
|
||||
|
||||
|
@@ -0,0 +1,32 @@
|
||||
apiVersion: v1beta3
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
labels:
|
||||
name: heapster
|
||||
kubernetes.io/cluster-service: "true"
|
||||
name: monitoring-heapster-controller
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
name: heapster
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: heapster
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster:v0.11.0
|
||||
name: heapster
|
||||
env:
|
||||
- name: FLAGS
|
||||
value: "--poll_duration=2m --stats_resolution=1m --sink influxdb:http://monitoring-influxdb.default.kubernetes.local:8086"
|
||||
volumeMounts:
|
||||
- name: ssl-certs
|
||||
mountPath: /etc/ssl/certs
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: ssl-certs
|
||||
hostPath:
|
||||
path: "/etc/ssl/certs"
|
||||
|
@@ -18,17 +18,18 @@ spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster_influxdb:v0.3
|
||||
name: influxdb
|
||||
ports:
|
||||
ports:
|
||||
- containerPort: 8083
|
||||
hostPort: 8083
|
||||
- containerPort: 8086
|
||||
hostPort: 8086
|
||||
- name: grafana
|
||||
image: gcr.io/google_containers/heapster_grafana:v0.7
|
||||
- image: gcr.io/google_containers/heapster_grafana:v0.7
|
||||
name: grafana
|
||||
env:
|
||||
- name: "INFLUXDB_EXTERNAL_URL"
|
||||
value: '/api/v1beta1/proxy/services/monitoring-grafana/db/'
|
||||
- name: "INFLUXDB_HOST"
|
||||
value: 'monitoring-influxdb'
|
||||
- name: "INFLUXDB_PORT"
|
||||
value: '80'
|
||||
- name: INFLUXDB_EXTERNAL_URL
|
||||
value: /api/v1beta1/proxy/services/monitoring-grafana/db/
|
||||
- name: INFLUXDB_HOST
|
||||
value: monitoring-influxdb
|
||||
- name: INFLUXDB_PORT
|
||||
value: "80"
|
||||
|
@@ -3,12 +3,16 @@ kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
name: influxGrafana
|
||||
kubernetes.io/cluster-service: "true"
|
||||
name: monitoring-influxdb
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
ports:
|
||||
- name: http
|
||||
port: 8083
|
||||
targetPort: 8083
|
||||
- name: api
|
||||
port: 8086
|
||||
targetPort: 8086
|
||||
selector:
|
||||
name: influxGrafana
|
||||
|
||||
|
@@ -1,16 +0,0 @@
|
||||
apiVersion: v1beta3
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
name: heapster
|
||||
kubernetes.io/cluster-service: "true"
|
||||
name: monitoring-heapster
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8082
|
||||
selector:
|
||||
name: heapster
|
||||
kubernetes.io/cluster-service: "true"
|
||||
|
||||
|
@@ -1,14 +0,0 @@
|
||||
apiVersion: v1beta3
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
name: influxGrafana
|
||||
name: monitoring-influxdb-ui
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8083
|
||||
selector:
|
||||
name: influxGrafana
|
||||
|
||||
|
@@ -50,8 +50,11 @@ ENABLE_DOCKER_REGISTRY_CACHE=true
|
||||
# Optional: Install node monitoring.
|
||||
ENABLE_NODE_MONITORING="${KUBE_ENABLE_NODE_MONITORING:-true}"
|
||||
|
||||
# Optional: When set to true, heapster, Influxdb and Grafana will be setup as part of the cluster bring up.
|
||||
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-true}"
|
||||
# Optional: Cluster monitoring to setup as part of the cluster bring up:
|
||||
# none - No cluster monitoring setup
|
||||
# influxdb - Heapster, InfluxDB, and Grafana
|
||||
# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging
|
||||
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-google}"
|
||||
|
||||
# Optional: Enable node logging.
|
||||
ENABLE_NODE_LOGGING="${KUBE_ENABLE_NODE_LOGGING:-true}"
|
||||
|
@@ -49,8 +49,11 @@ ENABLE_DOCKER_REGISTRY_CACHE=true
|
||||
# Optional: Install node monitoring.
|
||||
ENABLE_NODE_MONITORING="${KUBE_ENABLE_NODE_MONITORING:-true}"
|
||||
|
||||
# Optional: When set to true, heapster will be setup as part of the cluster bring up.
|
||||
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-true}"
|
||||
# Optional: Cluster monitoring to setup as part of the cluster bring up:
|
||||
# none - No cluster monitoring setup
|
||||
# influxdb - Heapster, InfluxDB, and Grafana
|
||||
# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging
|
||||
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-influxdb}"
|
||||
|
||||
# Optional: Enable node logging.
|
||||
ENABLE_NODE_LOGGING="${KUBE_ENABLE_NODE_LOGGING:-true}"
|
||||
|
@@ -33,7 +33,7 @@ SERVER_BINARY_TAR_URL: $(yaml-quote ${SERVER_BINARY_TAR_URL})
|
||||
SALT_TAR_URL: $(yaml-quote ${SALT_TAR_URL})
|
||||
PORTAL_NET: $(yaml-quote ${PORTAL_NET})
|
||||
ALLOCATE_NODE_CIDRS: $(yaml-quote ${ALLOCATE_NODE_CIDRS:-false})
|
||||
ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-false})
|
||||
ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-none})
|
||||
ENABLE_NODE_MONITORING: $(yaml-quote ${ENABLE_NODE_MONITORING:-false})
|
||||
ENABLE_CLUSTER_LOGGING: $(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false})
|
||||
ENABLE_NODE_LOGGING: $(yaml-quote ${ENABLE_NODE_LOGGING:-false})
|
||||
@@ -59,7 +59,7 @@ INSTANCE_PREFIX=$(yaml-quote ${INSTANCE_PREFIX})
|
||||
NODE_INSTANCE_PREFIX=$(yaml-quote ${NODE_INSTANCE_PREFIX})
|
||||
SERVER_BINARY_TAR_URL=$(yaml-quote ${SERVER_BINARY_TAR_URL})
|
||||
PORTAL_NET=$(yaml-quote ${PORTAL_NET})
|
||||
ENABLE_CLUSTER_MONITORING=$(yaml-quote ${ENABLE_CLUSTER_MONITORING:-false})
|
||||
ENABLE_CLUSTER_MONITORING=$(yaml-quote ${ENABLE_CLUSTER_MONITORING:-none})
|
||||
ENABLE_NODE_MONITORING=$(yaml-quote ${ENABLE_NODE_MONITORING:-false})
|
||||
ENABLE_CLUSTER_LOGGING=$(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false})
|
||||
ENABLE_NODE_LOGGING=$(yaml-quote ${ENABLE_NODE_LOGGING:-false})
|
||||
|
@@ -31,7 +31,7 @@ SERVER_BINARY_TAR_URL: $(yaml-quote ${SERVER_BINARY_TAR_URL})
|
||||
SALT_TAR_URL: $(yaml-quote ${SALT_TAR_URL})
|
||||
PORTAL_NET: $(yaml-quote ${PORTAL_NET})
|
||||
ALLOCATE_NODE_CIDRS: $(yaml-quote ${ALLOCATE_NODE_CIDRS:-false})
|
||||
ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-false})
|
||||
ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-none})
|
||||
ENABLE_NODE_MONITORING: $(yaml-quote ${ENABLE_NODE_MONITORING:-false})
|
||||
ENABLE_CLUSTER_LOGGING: $(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false})
|
||||
ENABLE_NODE_LOGGING: $(yaml-quote ${ENABLE_NODE_LOGGING:-false})
|
||||
|
@@ -1,8 +1,19 @@
|
||||
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'true' %}
|
||||
/etc/kubernetes/addons/cluster-monitoring:
|
||||
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'influxdb' %}
|
||||
/etc/kubernetes/addons/cluster-monitoring/influxdb:
|
||||
file.recurse:
|
||||
- source: salt://kube-addons/cluster-monitoring
|
||||
- include_pat: E@^.+\.yaml$
|
||||
- source: salt://kube-addons/cluster-monitoring/influxdb
|
||||
- include_pat: E@(^.+\.yaml$|^.+\.json$)
|
||||
- user: root
|
||||
- group: root
|
||||
- dir_mode: 755
|
||||
- file_mode: 644
|
||||
{% endif %}
|
||||
|
||||
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'google' %}
|
||||
/etc/kubernetes/addons/cluster-monitoring/google:
|
||||
file.recurse:
|
||||
- source: salt://kube-addons/cluster-monitoring/google
|
||||
- include_pat: E@(^.+\.yaml$|^.+\.json$)
|
||||
- user: root
|
||||
- group: root
|
||||
- dir_mode: 755
|
||||
|
@@ -110,7 +110,7 @@ while read line; do
|
||||
create-kubeconfig-secret "${token}" "${username}"
|
||||
done < /srv/kubernetes/known_tokens.csv
|
||||
|
||||
for obj in $(find /etc/kubernetes/addons -name \*.yaml); do
|
||||
for obj in $(find /etc/kubernetes/addons \( -name \*.yaml -o -name \*.json \)); do
|
||||
start_addon ${obj} 100 10 &
|
||||
echo "++ addon ${obj} starting in pid $! ++"
|
||||
done
|
||||
|
Reference in New Issue
Block a user