-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmohawk-template.yaml
144 lines (144 loc) · 4.16 KB
/
mohawk-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
kind: Template
apiVersion: v1
metadata:
name: mohawk
annotations:
"openshift.io/display-name": Mohawk Metrics
description: |
A simple metrics solution for an OpenShift cluster. Expects to be installed in the 'kube-system' namespace.
iconClass: icon-cogs
tags: "metrics,monitoring,mohawk,heapster"
labels:
metrics-infra: mohawk
parameters:
- description: External URL for the mohawk route
name: ROUTE_URL
value: ""
- description: Internal URL for the master, for authentication retrieval
name: MASTER_URL
value: https://kubernetes.default.svc
- description: Internal URL for the mohawk server
name: MOHWAK_URL
value: https://mohawk.kube-system.svc.cluster.local
- description: Internal hostname for the mongo database server
name: MONGO_HOSTNAME
value: mongo.kube-system.svc.cluster.local
- description: Specify mohawk backend; e.g. "memory" or "mongo"
name: MOHAWK_STORAGE
value: "memory"
- description: "How often metrics should be gathered. Defaults value of '15s' for 15 seconds"
name: METRIC_RESOLUTION
value: "30s"
- description: How long in seconds we should wait until Heapster starts up before attempting a restart
name: STARTUP_TIMEOUT
value: "500"
- description: The namespace to instantiate heapster under. Defaults to 'kube-system'.
name: NAMESPACE
value: kube-system
objects:
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: mohawk
namespace: "${NAMESPACE}"
spec:
host: "${ROUTE_URL}"
to:
name: mohawk
tls:
termination: Reencrypt
- apiVersion: v1
kind: ServiceAccount
metadata:
name: mohawk
namespace: "${NAMESPACE}"
labels:
metrics-infra: support
secrets:
- name: mohawk-secrets
- apiVersion: v1
kind: ClusterRoleBinding
metadata:
name: mohawk-cluster-reader
roleRef:
name: cluster-reader
subjects:
- kind: ServiceAccount
name: mohawk
namespace: "${NAMESPACE}"
- apiVersion: v1
kind: Service
metadata:
name: mohawk
namespace: "${NAMESPACE}"
labels:
metrics-infra: mohawk
name: mohawk
annotations:
"service.alpha.openshift.io/serving-cert-secret-name": mohawk-secrets
spec:
selector:
name: mohawk
ports:
- port: 443
protocol: TCP
targetPort: mohawk-https
- apiVersion: v1
kind: ReplicationController
metadata:
name: mohawk
namespace: "${NAMESPACE}"
labels:
metrics-infra: mohawk
name: mohawk
spec:
selector:
name: mohawk
replicas: 1
template:
version: v1
metadata:
labels:
metrics-infra: mohawk
name: mohawk
spec:
containers:
- image: "docker.io/yaacov/mohawk:latest"
name: mohawk
ports:
- name: mohawk-https
containerPort: 8443
env:
- name: HAWKULAR_FILE_PEM
value: /secrets/tls.crt
- name: HAWKULAR_FILE_KEY
value: /secrets/tls.key
- name: HAWKULAR_PORT
value: "8443"
- name: MOHAWK_STORAGE
value: ${MOHAWK_STORAGE}
- name: HAWKULAR_FLAGS
value: "--gzip --tls"
- name: HAWKULAR_DB_DIR
value: "./server"
- name: HAWKULAR_DB_URL
value: ${MONGO_HOSTNAME}
volumeMounts:
- name: mohawk-secrets
mountPath: "/secrets"
- image: "openshift/origin-metrics-heapster:latest"
name: heapster
command:
- "heapster-wrapper.sh"
- "--wrapper.endpoint_check=${MOHWAK_URL}/hawkular/metrics/status"
- "--source=kubernetes.summary_api:${MASTER_URL}?useServiceAccount=true&kubeletHttps=true&kubeletPort=10250"
- "--sink=hawkular:${MOHWAK_URL}?tenant=_system&labelToTenant=namespace_name&labelNodeId=nodename&caCert=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt&filter=label(container_name:^system.slice.*|^user.slice)"
- "--metric_resolution=${METRIC_RESOLUTION}"
env:
- name: STARTUP_TIMEOUT
value: ${STARTUP_TIMEOUT}
volumes:
- name: mohawk-secrets
secret:
secretName: mohawk-secrets
serviceAccount: mohawk