mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Move heapster data files to cluster/addons.
Also pretty up the JSON (make it real JSON) and streamline the sed in cluster/gce/init.sh.
This commit is contained in:
parent
6df6aab077
commit
9aa48b7628
@ -6,13 +6,15 @@
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "heapster",
|
||||
"containers": [{
|
||||
"name": "heapster",
|
||||
"image": "kubernetes/heapster",
|
||||
}]
|
||||
"containers": [
|
||||
{
|
||||
"name": "heapster",
|
||||
"image": "kubernetes/heapster"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"name": "heapster",
|
||||
"name": "heapster"
|
||||
}
|
||||
}
|
71
cluster/addons/cluster-monitoring/influx-grafana-pod.json
Normal file
71
cluster/addons/cluster-monitoring/influx-grafana-pod.json
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"id": "influx-grafana",
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1beta1",
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "influx-grafana",
|
||||
"containers": [
|
||||
{
|
||||
"name": "influxdb",
|
||||
"image": "kubernetes/heapster_influxdb",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 8083,
|
||||
"hostPort": 8083
|
||||
},
|
||||
{
|
||||
"containerPort": 8086,
|
||||
"hostPort": 8086
|
||||
},
|
||||
{
|
||||
"containerPort": 8090,
|
||||
"hostPort": 8090
|
||||
},
|
||||
{
|
||||
"containerPort": 8099,
|
||||
"hostPort": 8099
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "grafana",
|
||||
"image": "kubernetes/heapster_grafana",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"hostPort": 80
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "HTTP_USER",
|
||||
"value": "{KUBE_USER}"
|
||||
},
|
||||
{
|
||||
"name": "HTTP_PASS",
|
||||
"value": "{KUBE_PASSWORD}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "elasticsearch",
|
||||
"image": "dockerfile/elasticsearch",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 9200,
|
||||
"hostPort": 9200
|
||||
},
|
||||
{
|
||||
"containerPort": 9300
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"name": "influxdb"
|
||||
}
|
||||
}
|
@ -6,5 +6,7 @@
|
||||
"containerPort": 8086,
|
||||
"provider": "kubernetes-default",
|
||||
"component": "influxdb",
|
||||
"selector": { "name": "influxdb" }
|
||||
"selector": {
|
||||
"name": "influxdb"
|
||||
}
|
||||
}
|
@ -746,15 +746,14 @@ function setup-monitoring {
|
||||
get-password
|
||||
ensure-temp-dir
|
||||
|
||||
cp "${KUBE_ROOT}/examples/monitoring/influx-grafana-pod.json" "${KUBE_TEMP}/influx-grafana-pod.0.json"
|
||||
sed "s/HTTP_USER, \"value\": \"[^\"]*\"/HTTP_USER, \"value\": \"$KUBE_USER\"/g" \
|
||||
"${KUBE_TEMP}/influx-grafana-pod.0.json" > "${KUBE_TEMP}/influx-grafana-pod.1.json"
|
||||
sed "s/HTTP_PASS, \"value\": \"[^\"]*\"/HTTP_PASS, \"value\": \"$KUBE_PASSWORD\"/g" \
|
||||
"${KUBE_TEMP}/influx-grafana-pod.1.json" > "${KUBE_TEMP}/influx-grafana-pod.2.json"
|
||||
sed -e "s/{KUBE_USER}/$KUBE_USER/g" \
|
||||
-e "s/{KUBE_PASSWORD}/$KUBE_PASSWORD/g" \
|
||||
"${KUBE_ROOT}/cluster/addons/cluster-monitoring/influx-grafana-pod.json" \
|
||||
> "${KUBE_TEMP}/influx-grafana-pod.json"
|
||||
local kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
|
||||
if "${kubectl}" create -f "${KUBE_TEMP}/influx-grafana-pod.2.json" &> /dev/null \
|
||||
&& "${kubectl}" create -f "${KUBE_ROOT}/examples/monitoring/influx-grafana-service.json" &> /dev/null \
|
||||
&& "${kubectl}" create -f "${KUBE_ROOT}/examples/monitoring/heapster-pod.json" &> /dev/null; then
|
||||
if "${kubectl}" create -f "${KUBE_TEMP}/influx-grafana-pod.json" &> /dev/null \
|
||||
&& "${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/cluster-monitoring/influx-grafana-service.json" &> /dev/null \
|
||||
&& "${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/cluster-monitoring/heapster-pod.json" &> /dev/null; then
|
||||
local dashboard_url="http://$(${kubectl} get -o json pod influx-grafana | grep hostIP | awk '{print $2}' | sed 's/[,|\"]//g')"
|
||||
echo
|
||||
echo "Grafana dashboard will be available at $dashboard_url. Wait for the monitoring dashboard to be online."
|
||||
|
@ -1,34 +0,0 @@
|
||||
{
|
||||
"id": "influx-grafana",
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1beta1",
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "influx-grafana",
|
||||
"containers": [{
|
||||
"name": "influxdb",
|
||||
"image": "kubernetes/heapster_influxdb",
|
||||
"ports": [
|
||||
{"containerPort": 8083, "hostPort": 8083},
|
||||
{"containerPort": 8086, "hostPort": 8086},
|
||||
{"containerPort": 8090, "hostPort": 8090},
|
||||
{"containerPort": 8099, "hostPort": 8099}]
|
||||
}, {
|
||||
"name": "grafana",
|
||||
"image": "kubernetes/heapster_grafana",
|
||||
"ports": [{"containerPort": 80, "hostPort": 80}],
|
||||
"env": [{"name": HTTP_USER, "value": "admin"},
|
||||
{"name": HTTP_PASS, "value": "admin"}],
|
||||
}, {
|
||||
"name": "elasticsearch",
|
||||
"image": "dockerfile/elasticsearch",
|
||||
"ports": [{"containerPort": 9200, "hostPort": 9200},
|
||||
{"containerPort": 9300}],
|
||||
}]
|
||||
},
|
||||
},
|
||||
"labels": {
|
||||
"name": "influxdb",
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
||||
source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh"
|
||||
|
||||
MONITORING="${KUBE_ROOT}/examples/monitoring"
|
||||
MONITORING="${KUBE_ROOT}/cluster/addons/cluster-monitoring"
|
||||
KUBECTL="${KUBE_ROOT}/cluster/kubectl.sh"
|
||||
MONITORING_FIREWALL_RULE="monitoring-test"
|
||||
|
||||
@ -54,7 +54,7 @@ function cleanup {
|
||||
"${KUBECTL}" delete -f "${MONITORING}/influx-grafana-pod.json" || true
|
||||
"${KUBECTL}" delete -f "${MONITORING}/influx-grafana-service.json" || true
|
||||
"${KUBECTL}" delete -f "${MONITORING}/heapster-pod.json" || true
|
||||
|
||||
|
||||
# This only has work to do on gce and gke
|
||||
if [[ "${KUBERNETES_PROVIDER}" == "gce" ]] || [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
||||
detect-project
|
||||
|
Loading…
Reference in New Issue
Block a user