kube-prometheus: Update kops docs
This commit is contained in:
@@ -163,6 +163,14 @@ bootkube:
|
|||||||
(import "kube-prometheus/kube-prometheus-bootkube.libsonnet")
|
(import "kube-prometheus/kube-prometheus-bootkube.libsonnet")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
kops:
|
||||||
|
|
||||||
|
[embedmd]:# (examples/jsonnet-snippets/kops.jsonnet)
|
||||||
|
```jsonnet
|
||||||
|
(import 'kube-prometheus/kube-prometheus.libsonnet') +
|
||||||
|
(import 'kube-prometheus/kube-prometheus-kops.libsonnet')
|
||||||
|
```
|
||||||
|
|
||||||
Another mixin that may be useful for exploring the stack is to expose the UIs of Prometheus, Alertmanager and Grafana on NodePorts:
|
Another mixin that may be useful for exploring the stack is to expose the UIs of Prometheus, Alertmanager and Grafana on NodePorts:
|
||||||
|
|
||||||
[embedmd]:# (examples/jsonnet-snippets/node-ports.jsonnet)
|
[embedmd]:# (examples/jsonnet-snippets/node-ports.jsonnet)
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
# Adding kube-prometheus to [KOPS](https://github.com/kubernetes/kops) on AWS 1.5.x
|
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
A running Kubernetes cluster created with [KOPS](https://github.com/kubernetes/kops).
|
|
||||||
|
|
||||||
These instructions have currently been tested with **topology=public** on AWS with KOPS 1.7.1 and Kubernetes 1.7.x
|
|
||||||
|
|
||||||
Following the instructions in the [README](https://github.com/coreos/prometheus-operator/blob/master/contrib/kube-prometheus/README.md):
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone -b master https://github.com/coreos/prometheus-operator.git prometheus-operator-temp;
|
|
||||||
cd prometheus-operator-temp/contrib/kube-prometheus
|
|
||||||
./hack/cluster-monitoring/self-hosted-deploy
|
|
||||||
cd -
|
|
||||||
rm -rf prometheus-operator-temp
|
|
||||||
```
|
|
2
examples/jsonnet-snippets/kops.jsonnet
Normal file
2
examples/jsonnet-snippets/kops.jsonnet
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
(import 'kube-prometheus/kube-prometheus.libsonnet') +
|
||||||
|
(import 'kube-prometheus/kube-prometheus-kops.libsonnet')
|
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
prometheus+:: {
|
||||||
|
serviceMonitorKubelet+:
|
||||||
|
{
|
||||||
|
spec+: {
|
||||||
|
endpoints: [
|
||||||
|
{
|
||||||
|
port: 'http-metrics',
|
||||||
|
scheme: 'http',
|
||||||
|
interval: '30s',
|
||||||
|
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
port: 'http-metrics',
|
||||||
|
scheme: 'http',
|
||||||
|
path: '/metrics/cadvisor',
|
||||||
|
interval: '30s',
|
||||||
|
honorLabels: true,
|
||||||
|
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
23
jsonnet/kube-prometheus/kube-prometheus-kops.libsonnet
Normal file
23
jsonnet/kube-prometheus/kube-prometheus-kops.libsonnet
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
|
||||||
|
local service = k.core.v1.service;
|
||||||
|
local servicePort = k.core.v1.service.mixin.spec.portsType;
|
||||||
|
|
||||||
|
{
|
||||||
|
prometheus+:: {
|
||||||
|
kubeControllerManagerPrometheusDiscoveryService:
|
||||||
|
service.new('kube-controller-manager-prometheus-discovery', { 'k8s-app': 'kube-controller-manager' }, servicePort.newNamed('http-metrics', 10252, 10252)) +
|
||||||
|
service.mixin.metadata.withNamespace('kube-system') +
|
||||||
|
service.mixin.metadata.withLabels({ 'k8s-app': 'kube-controller-manager' }) +
|
||||||
|
service.mixin.spec.withClusterIp('None'),
|
||||||
|
kubeSchedulerPrometheusDiscoveryService:
|
||||||
|
service.new('kube-scheduler-prometheus-discovery', { 'k8s-app': 'kube-scheduler' }, servicePort.newNamed('http-metrics', 10251, 10251)) +
|
||||||
|
service.mixin.metadata.withNamespace('kube-system') +
|
||||||
|
service.mixin.metadata.withLabels({ 'k8s-app': 'kube-scheduler' }) +
|
||||||
|
service.mixin.spec.withClusterIp('None'),
|
||||||
|
kubeDnsPrometheusDiscoveryService:
|
||||||
|
service.new('kube-dns-prometheus-discovery', { 'k8s-app': 'kube-dns' }, [servicePort.newNamed('http-metrics-skydns', 10055, 10055), servicePort.newNamed('http-metrics-dnsmasq', 10054, 10054)]) +
|
||||||
|
service.mixin.metadata.withNamespace('kube-system') +
|
||||||
|
service.mixin.metadata.withLabels({ 'k8s-app': 'kube-dns' }) +
|
||||||
|
service.mixin.spec.withClusterIp('None'),
|
||||||
|
},
|
||||||
|
}
|
Reference in New Issue
Block a user