mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
2.7 KiB
2.7 KiB
Example Deployment
-
Make sure you've built the included Dockerfile with
TAG=latest make container. The image should be tagged asregistry.k8s.io/prometheus-adapter/staging-prometheus-adapter:latest. -
kubectl create namespace monitoringto ensure that the namespace that we're installing the custom metrics adapter in exists. -
This can be deployed via
kubectl create -f manifests/or viakustomizea. if usingkubectl create -f manifests/modify the Deployment as necessary to point to your Prometheus server, and the ConfigMap to contain your desired metrics discovery configuration. b. if usingkustomizereference the kustomization file located:http://github.com/kubernetes-sigs/prometheus-adapter/deploy?ref=release-X.XXexample kustomization.yaml:--- apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - github.com/kubernetes-sigs/prometheus-adapter/deploy?ref=release-X.XX patches: - path: deployment-patch.yaml target: kind: Deployment version: v1 name: prometheus-adapter namespace: monitoring - path: configmap-patch.yaml target: kind: ConfigMap version: v1 name: adapter-config namespace: monitoringkind: Deployment apiVersion: apps/v1 metadata: name: prometheus-adapter # deployment name to patch namespace: monitoring spec: template: spec: containers: - name: prometheus-adapter # name of container args: - --cert-dir=/var/run/serving-cert - --config=/etc/adapter/config.yaml - --metrics-relist-interval=1m - --prometheus-url=http://prometheus.monitoring.svc.cluster.local:9090/ # prometheus URL - --secure-port=6443 - --tls-cipher-suites=TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHAkind: ConfigMap apiVersion: v1 metadata: labels: app.kubernetes.io/component: metrics-adapter app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/version: 0.12.0 name: adapter-config namespace: monitoring data: config.yaml: |- # your rules would go here