diff --git a/README.md b/README.md index 04c7eb86af018c3a79d46f1e6d0bd8f299105a9b..b8f69a8b71e4d9b7ec5189cf616479d89a1ac47f 100644 --- a/README.md +++ b/README.md @@ -367,6 +367,14 @@ kubespray: (import 'kube-prometheus/kube-prometheus-kubespray.libsonnet') ``` +kube-aws: + +[embedmd]:# (examples/jsonnet-snippets/kube-aws.jsonnet) +```jsonnet +(import 'kube-prometheus/kube-prometheus.libsonnet') + +(import 'kube-prometheus/kube-prometheus-kube-aws.libsonnet') +``` + ### Internal Registry Some Kubernetes installations source all their images from an internal registry. kube-prometheus supports this use case and helps the user synchronize every image it uses to the internal registry and generate manifests pointing at the internal registry. diff --git a/examples/jsonnet-snippets/kube-aws.jsonnet b/examples/jsonnet-snippets/kube-aws.jsonnet new file mode 100644 index 0000000000000000000000000000000000000000..b0842eb24e1dde19565afd6ae88ff52dab819b26 --- /dev/null +++ b/examples/jsonnet-snippets/kube-aws.jsonnet @@ -0,0 +1,2 @@ +(import 'kube-prometheus/kube-prometheus.libsonnet') + +(import 'kube-prometheus/kube-prometheus-kube-aws.libsonnet') diff --git a/jsonnet/kube-prometheus/kube-prometheus-kube-aws.libsonnet b/jsonnet/kube-prometheus/kube-prometheus-kube-aws.libsonnet new file mode 100644 index 0000000000000000000000000000000000000000..8a69d2156010f5070049ed7bd1d1d984affc19c3 --- /dev/null +++ b/jsonnet/kube-prometheus/kube-prometheus-kube-aws.libsonnet @@ -0,0 +1,18 @@ +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'), + }, +}