Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a737fec5
Commit
a737fec5
authored
Mar 20, 2017
by
Aleksandra Malinowska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stackdriver monitoring option
parent
e38c575a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
0 deletions
+127
-0
heapster-controller.yaml
...s/cluster-monitoring/stackdriver/heapster-controller.yaml
+96
-0
heapster-service.yaml
...dons/cluster-monitoring/stackdriver/heapster-service.yaml
+15
-0
config-default.sh
cluster/gce/config-default.sh
+1
-0
config-test.sh
cluster/gce/config-test.sh
+1
-0
configure-helper.sh
cluster/gce/container-linux/configure-helper.sh
+1
-0
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+1
-0
init.sls
cluster/saltbase/salt/kube-addons/init.sls
+12
-0
No files found.
cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml
0 → 100644
View file @
a737fec5
{
%
set base_metrics_memory = "140Mi" -%
}
{
%
set base_metrics_cpu = "80m" -%
}
{
%
set metrics_memory_per_node = 4 -%
}
{
%
set metrics_cpu_per_node = 0.5 -%
}
{
%
set num_nodes = pillar.get('num_nodes'
,
-1) -%
}
{
%
set nanny_memory = "90Mi" -%
}
{
%
set nanny_memory_per_node = 200 -%
}
{
%
if num_nodes >= 0 -%
}
{
%
set nanny_memory = (90 * 1024 + num_nodes * nanny_memory_per_node)|string + "Ki" -%
}
{
%
endif -%
}
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
heapster-v1.3.0
namespace
:
kube-system
labels
:
k8s-app
:
heapster
kubernetes.io/cluster-service
:
"
true"
addonmanager.kubernetes.io/mode
:
Reconcile
version
:
v1.3.0
spec
:
replicas
:
1
selector
:
matchLabels
:
k8s-app
:
heapster
version
:
v1.3.0
template
:
metadata
:
labels
:
k8s-app
:
heapster
version
:
v1.3.0
annotations
:
scheduler.alpha.kubernetes.io/critical-pod
:
'
'
spec
:
containers
:
-
image
:
gcr.io/google_containers/heapster-amd64:v1.3.0
name
:
heapster
livenessProbe
:
httpGet
:
path
:
/healthz
port
:
8082
scheme
:
HTTP
initialDelaySeconds
:
180
timeoutSeconds
:
5
command
:
-
/heapster
-
--source=kubernetes.summary_api:''
-
--sink=stackdriver
# TODO
:
add --disable_export when it's merged into Heapster release
volumeMounts
:
-
name
:
ssl-certs
mountPath
:
/etc/ssl/certs
readOnly
:
true
-
name
:
usr-ca-certs
mountPath
:
/usr/share/ca-certificates
readOnly
:
true
-
image
:
gcr.io/google_containers/addon-resizer:1.7
name
:
heapster-nanny
resources
:
limits
:
cpu
:
50m
memory
:
{{
nanny_memory
}}
requests
:
cpu
:
50m
memory
:
{{
nanny_memory
}}
env
:
-
name
:
MY_POD_NAME
valueFrom
:
fieldRef
:
fieldPath
:
metadata.name
-
name
:
MY_POD_NAMESPACE
valueFrom
:
fieldRef
:
fieldPath
:
metadata.namespace
command
:
-
/pod_nanny
-
--cpu={{ base_metrics_cpu }}
-
--extra-cpu={{ metrics_cpu_per_node }}m
-
--memory={{ base_metrics_memory }}
-
--extra-memory={{metrics_memory_per_node}}Mi
-
--threshold=5
-
--deployment=heapster-v1.3.0
-
--container=heapster
-
--poll-period=300000
-
--estimator=exponential
volumes
:
-
name
:
ssl-certs
hostPath
:
path
:
"
/etc/ssl/certs"
-
name
:
usr-ca-certs
hostPath
:
path
:
"
/usr/share/ca-certificates"
tolerations
:
-
key
:
"
CriticalAddonsOnly"
operator
:
"
Exists"
cluster/addons/cluster-monitoring/stackdriver/heapster-service.yaml
0 → 100644
View file @
a737fec5
kind
:
Service
apiVersion
:
v1
metadata
:
name
:
heapster
namespace
:
kube-system
labels
:
kubernetes.io/cluster-service
:
"
true"
addonmanager.kubernetes.io/mode
:
Reconcile
kubernetes.io/name
:
"
Heapster"
spec
:
ports
:
-
port
:
80
targetPort
:
8082
selector
:
k8s-app
:
heapster
cluster/gce/config-default.sh
View file @
a737fec5
...
...
@@ -102,6 +102,7 @@ ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
# none - No cluster monitoring setup
# influxdb - Heapster, InfluxDB, and Grafana
# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging
# stackdriver - Heapster, Google Cloud Monitoring (schema container), and Google Cloud Logging
# googleinfluxdb - Enable influxdb and google (except GCM)
# standalone - Heapster only. Metrics available via Heapster REST API.
ENABLE_CLUSTER_MONITORING
=
"
${
KUBE_ENABLE_CLUSTER_MONITORING
:-
influxdb
}
"
...
...
cluster/gce/config-test.sh
View file @
a737fec5
...
...
@@ -106,6 +106,7 @@ ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
# none - No cluster monitoring setup
# influxdb - Heapster, InfluxDB, and Grafana
# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging
# stackdriver - Heapster, Google Cloud Monitoring (schema container), and Google Cloud Logging
# googleinfluxdb - Enable influxdb and google (except GCM)
# standalone - Heapster only. Metrics available via Heapster REST API.
ENABLE_CLUSTER_MONITORING
=
"
${
KUBE_ENABLE_CLUSTER_MONITORING
:-
influxdb
}
"
...
...
cluster/gce/container-linux/configure-helper.sh
View file @
a737fec5
...
...
@@ -1113,6 +1113,7 @@ function start-kube-addons {
# Set up manifests of other addons.
if
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"influxdb"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"google"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"stackdriver"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"standalone"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"googleinfluxdb"
]]
;
then
local
-r
file_dir
=
"cluster-monitoring/
${
ENABLE_CLUSTER_MONITORING
}
"
...
...
cluster/gce/gci/configure-helper.sh
View file @
a737fec5
...
...
@@ -1322,6 +1322,7 @@ function start-kube-addons {
# Set up manifests of other addons.
if
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"influxdb"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"google"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"stackdriver"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"standalone"
]]
||
\
[[
"
${
ENABLE_CLUSTER_MONITORING
:-}
"
==
"googleinfluxdb"
]]
;
then
local
-r
file_dir
=
"cluster-monitoring/
${
ENABLE_CLUSTER_MONITORING
}
"
...
...
cluster/saltbase/salt/kube-addons/init.sls
View file @
a737fec5
...
...
@@ -47,6 +47,18 @@ addon-dir-create:
- file_mode: 644
{% endif %}
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'stackdriver' %}
/etc/kubernetes/addons/cluster-monitoring/stackdriver:
file.recurse:
- source: salt://kube-addons/cluster-monitoring/stackdriver
- include_pat: E@(^.+\.yaml$|^.+\.json$)
- template: jinja
- user: root
- group: root
- dir_mode: 755
- file_mode: 644
{% endif %}
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'standalone' %}
/etc/kubernetes/addons/cluster-monitoring/standalone:
file.recurse:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment