diff --git a/download.yaml b/download.yaml index 9f943f8efd6c9d6dd007755b5382ef928d6a8c16..5957f639601d3114a142af40bd1c70f9cbb69748 100644 --- a/download.yaml +++ b/download.yaml @@ -1,5 +1,7 @@ resources: - name: "stable/dex" url: "helm://kubernetes-charts.storage.googleapis.com/dex-2.13.0.tgz" + - name: "stable/prometheus-adapter" + url: "helm://kubernetes-charts.storage.googleapis.com/prometheus-adapter-2.5.0.tgz" - name: "harbor/harbor" url: "helm://helm.goharbor.io/harbor-1.4.1.tgz" diff --git a/stable/prometheus-adapter/.helmignore b/stable/prometheus-adapter/.helmignore new file mode 100755 index 0000000000000000000000000000000000000000..f0c13194444163d1cba5c67d9e79231a62bc8f44 --- /dev/null +++ b/stable/prometheus-adapter/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/stable/prometheus-adapter/Chart.yaml b/stable/prometheus-adapter/Chart.yaml new file mode 100755 index 0000000000000000000000000000000000000000..2f52bc4e02e92597ad1e1e83f1a05802a9e52adc --- /dev/null +++ b/stable/prometheus-adapter/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +appVersion: v0.7.0 +description: A Helm chart for k8s prometheus adapter +home: https://github.com/DirectXMan12/k8s-prometheus-adapter +keywords: +- hpa +- metrics +- prometheus +- adapter +maintainers: +- email: mattias.gees@jetstack.io + name: mattiasgees +- name: steven-sheehy +- email: hfernandez@mesosphere.com + name: hectorj2f +name: prometheus-adapter +sources: +- https://github.com/kubernetes/charts +- https://github.com/DirectXMan12/k8s-prometheus-adapter +version: 2.5.0 diff --git a/stable/prometheus-adapter/IRONBANK.md.gotmpl b/stable/prometheus-adapter/IRONBANK.md.gotmpl new file mode 100644 index 0000000000000000000000000000000000000000..4e76bd56094ea5ab041a641e377bab0af41ac552 --- /dev/null +++ b/stable/prometheus-adapter/IRONBANK.md.gotmpl @@ -0,0 +1,37 @@ +{{ template "chart.header" . }} +{{ template "chart.description" . }} + +Chart Version: {{ template "chart.version" . }} + +## Introduction + +This repository tracks the upstream [stable/prometheus-adapter](https://github.com/helm/charts/tree/master/stable/prometheus-adapter) Helm chart. + +A `values-ironbank.yaml` file is included with required parameters for deployment. + +- Uses Ironbank images +- Enables TLS + +Reference the original [README](./README-original.md) for additional instructions. + +## Prerequisites + +* TLS certificates + +``` +kubectl create secret generic -prometheus-adapter \ + --from-from=tls.crt=/path/to/tls.crt \ + --from-file=tls.key=/path/to/tls.key +``` + +> The helm chart uses the `k8s-prometheus-adapter.fullname` helper template for the secretName + +## Installation + +```shell +helm install ./ --name prometheus-adapter -f values-ironbank.yaml +``` + +## Configuration + +{{ template "chart.valuesTable" . }} diff --git a/stable/prometheus-adapter/OWNERS b/stable/prometheus-adapter/OWNERS new file mode 100755 index 0000000000000000000000000000000000000000..0c15fcf3445d09065c85641afc4b0c50069f9423 --- /dev/null +++ b/stable/prometheus-adapter/OWNERS @@ -0,0 +1,8 @@ +approvers: + - mattiasgees + - steven-sheehy + - hectorj2f +reviewers: + - mattiasgees + - steven-sheehy + - hectorj2f diff --git a/stable/prometheus-adapter/README-original.md b/stable/prometheus-adapter/README-original.md new file mode 100755 index 0000000000000000000000000000000000000000..cda90cbf335127953d5fa8453dda1573ea0ee12a --- /dev/null +++ b/stable/prometheus-adapter/README-original.md @@ -0,0 +1,160 @@ +# Prometheus Adapter + +Installs the [Prometheus Adapter](https://github.com/DirectXMan12/k8s-prometheus-adapter) for the Custom Metrics API. Custom metrics are used in Kubernetes by [Horizontal Pod Autoscalers](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) to scale workloads based upon your own metric pulled from an external metrics provider like Prometheus. This chart complements the [metrics-server](https://github.com/helm/charts/tree/master/stable/metrics-server) chart that provides resource only metrics. + +## Prerequisites + +Kubernetes 1.14+ + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install --name my-release stable/prometheus-adapter +``` + +This command deploys the prometheus adapter with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + +## Using the Chart + +To use the chart, ensure the `prometheus.url` and `prometheus.port` are configured with the correct Prometheus service endpoint. If Prometheus is exposed under HTTPS the host's CA Bundle must be exposed to the container using `extraVolumes` and `extraVolumeMounts`. + +Additionally, the chart comes with a set of default rules out of the box but they may pull in too many metrics or not map them correctly for your needs. Therefore, it is recommended to populate `rules.custom` with a list of rules (see the [config document](https://github.com/DirectXMan12/k8s-prometheus-adapter/blob/master/docs/config.md) for the proper format). + +Finally, to configure your Horizontal Pod Autoscaler to use the custom metric, see the custom metrics section of the [HPA walkthrough](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics). + +The Prometheus Adapter can serve three different [metrics APIs](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis): + +### Custom Metrics + +Enabling this option will cause custom metrics to be served at `/apis/custom.metrics.k8s.io/v1beta1`. Enabled by default when `rules.default` is true, but can be customized by populating `rules.custom`: + +``` +rules: + custom: + - seriesQuery: '{__name__=~"^some_metric_count$"}' + resources: + template: <<.Resource>> + name: + matches: "" + as: "my_custom_metric" + metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) +``` + +### External Metrics + +Enabling this option will cause external metrics to be served at `/apis/external.metrics.k8s.io/v1beta1`. Can be enabled by populating `rules.external`: + +``` +rules: + external: + - seriesQuery: '{__name__=~"^some_metric_count$"}' + resources: + template: <<.Resource>> + name: + matches: "" + as: "my_external_metric" + metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) +``` + +### Resource Metrics + +Enabling this option will cause resource metrics to be served at `/apis/metrics.k8s.io/v1beta1`. Resource metrics will allow pod CPU and Memory metrics to be used in [Horizontal Pod Autoscalers](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) as well as the `kubectl top` command. Can be enabled by populating `rules.resource`: + +``` +rules: + resource: + cpu: + containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>) + nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>) + resources: + overrides: + instance: + resource: node + namespace: + resource: namespace + pod: + resource: pod + containerLabel: container + memory: + containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>) + nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>) + resources: + overrides: + instance: + resource: node + namespace: + resource: namespace + pod: + resource: pod + containerLabel: container + window: 3m +``` + +**NOTE:** Setting a value for `rules.resource` will also deploy the resource metrics API service, providing the same functionality as [metrics-server](https://github.com/helm/charts/tree/master/stable/metrics-server). As such it is not possible to deploy them both in the same cluster. + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```console +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the Prometheus Adapter chart and their default values. + +| Parameter | Description | Default | +| ------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------| +| `affinity` | Node affinity | `{}` | +| `image.repository` | Image repository | `directxman12/k8s-prometheus-adapter-amd64` | +| `image.tag` | Image tag | `v0.7.0` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Image pull secrets | `{}` | +| `logLevel` | Log level | `4` | +| `listenPort` | Port that application would listen on in the container | `6443` | +| `metricsRelistInterval` | Interval at which to re-list the set of all available metrics from Prometheus | `1m` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `podLabels` | Labels to add to the pod | `{}` | +| `podAnnotations` | Annotations to add to the pod | `{}` | +| `priorityClassName` | Pod priority | `` | +| `prometheus.url` | Url of where we can find the Prometheus service | `http://prometheus.default.svc` | +| `prometheus.port` | Port of where we can find the Prometheus service, zero to omit this option | `9090` | +| `prometheus.path` | Custom path to append to the prometheus URL | `` | +| `rbac.create` | If true, create & use RBAC resources | `true` | +| `resources` | CPU/Memory resource requests/limits | `{}` | +| `rules.default` | If `true`, enable a set of default rules in the configmap | `true` | +| `rules.custom` | A list of custom configmap rules | `[]` | +| `rules.existing` | The name of an existing configMap with rules. Overrides default, custom and external. | `` | +| `rules.external` | A list of custom rules for external metrics API | `[]` | +| `rules.resource` | `resourceRules` to set in configmap rules | `{}` | +| `service.annotations` | Annotations to add to the service | `{}` | +| `service.port` | Service port to expose | `443` | +| `service.type` | Type of service to create | `ClusterIP` | +| `serviceAccount.create` | If true, create & use Serviceaccount | `true` | +| `serviceAccount.name` | If not set and create is true, a name is generated using the fullname template | `` | +| `tls.enable` | If true, use the provided certificates. If false, generate self-signed certs | `false` | +| `tls.ca` | Public CA file that signed the APIService (ignored if tls.enable=false) | `` | +| `tls.key` | Private key of the APIService (ignored if tls.enable=false) | `` | +| `tls.certificate` | Public key of the APIService (ignored if tls.enable=false) | `` | +| `extraVolumeMounts` | Any extra volumes mounts | `[]` | +| `extraVolumes` | Any extra volumes | `[]` | +| `tolerations` | List of node taints to tolerate | `[]` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```console +$ helm install --name my-release \ + --set logLevel=1 \ + stable/prometheus-adapter +``` + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, + +```console +$ helm install --name my-release -f values.yaml stable/prometheus-adapter +``` diff --git a/stable/prometheus-adapter/README.md b/stable/prometheus-adapter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a981e31639670ab13e33661c55746c78ed43a863 --- /dev/null +++ b/stable/prometheus-adapter/README.md @@ -0,0 +1,74 @@ +prometheus-adapter +================== +A Helm chart for k8s prometheus adapter + +Chart Version: 2.5.0 + +## Introduction + +This repository tracks the upstream [stable/prometheus-adapter](https://github.com/helm/charts/tree/master/stable/prometheus-adapter) Helm chart. + +A `values-ironbank.yaml` file is included with required parameters for deployment. + +- Uses Ironbank images +- Enables TLS + +Reference the original [README](./README-original.md) for additional instructions. + +## Prerequisites + +* TLS certificates + +``` +kubectl create secret generic -prometheus-adapter \ + --from-from=tls.crt=/path/to/tls.crt \ + --from-file=tls.key=/path/to/tls.key +``` + +> The helm chart uses the `k8s-prometheus-adapter.fullname` helper template for the secretName + +## Installation + +```shell +helm install ./ --name prometheus-adapter -f values-ironbank.yaml +``` + +## Configuration + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| extraVolumeMounts | list | `[]` | | +| extraVolumes | list | `[]` | | +| hostNetwork.enabled | bool | `false` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"registry1.dsop.io/ironbank/opensource/coreos/k8s-prometheus-adapter"` | | +| image.tag | string | `"v0.7.0"` | | +| listenPort | int | `6443` | | +| logLevel | int | `4` | | +| metricsRelistInterval | string | `"1m"` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| priorityClassName | string | `""` | | +| prometheus.path | string | `""` | | +| prometheus.port | int | `9090` | | +| prometheus.url | string | `"http://prometheus.default.svc"` | | +| rbac.create | bool | `true` | | +| replicas | int | `1` | | +| resources | object | `{}` | | +| rules.custom | list | `[]` | | +| rules.default | bool | `true` | | +| rules.existing | string | `nil` | | +| rules.external | list | `[]` | | +| rules.resource | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `443` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `nil` | | +| tls.ca | string | `"# Public CA file that signed the APIService"` | | +| tls.certificate | string | `"# Public key of the APIService"` | | +| tls.enable | bool | `true` | | +| tls.key | string | `"# Private key of the APIService"` | | +| tolerations | list | `[]` | | diff --git a/stable/prometheus-adapter/ci/default-values.yaml b/stable/prometheus-adapter/ci/default-values.yaml new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/stable/prometheus-adapter/ci/external-rules-values.yaml b/stable/prometheus-adapter/ci/external-rules-values.yaml new file mode 100755 index 0000000000000000000000000000000000000000..2dafb56211bfb6346b0d15b3ebdec5a0c1df5e29 --- /dev/null +++ b/stable/prometheus-adapter/ci/external-rules-values.yaml @@ -0,0 +1,9 @@ +rules: + external: + - seriesQuery: '{__name__=~"^some_metric_count$"}' + resources: + template: <<.Resource>> + name: + matches: "" + as: "my_custom_metric" + metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) diff --git a/stable/prometheus-adapter/templates/NOTES.txt b/stable/prometheus-adapter/templates/NOTES.txt new file mode 100755 index 0000000000000000000000000000000000000000..b7b9b99322fe17233953cbc29efe8745d2dcc5c1 --- /dev/null +++ b/stable/prometheus-adapter/templates/NOTES.txt @@ -0,0 +1,9 @@ +{{ template "k8s-prometheus-adapter.fullname" . }} has been deployed. +In a few minutes you should be able to list metrics using the following command(s): +{{ if .Values.rules.resource }} + kubectl get --raw /apis/metrics.k8s.io/v1beta1 +{{- end }} + kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 +{{ if .Values.rules.external }} + kubectl get --raw /apis/external.metrics.k8s.io/v1beta1 +{{- end }} diff --git a/stable/prometheus-adapter/templates/_helpers.tpl b/stable/prometheus-adapter/templates/_helpers.tpl new file mode 100755 index 0000000000000000000000000000000000000000..5d0b993c5295aa0e73967c6f82cae038e6f92609 --- /dev/null +++ b/stable/prometheus-adapter/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "k8s-prometheus-adapter.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "k8s-prometheus-adapter.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "k8s-prometheus-adapter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "k8s-prometheus-adapter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "k8s-prometheus-adapter.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-auth-delegator-cluster-role-binding.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-auth-delegator-cluster-role-binding.yaml new file mode 100755 index 0000000000000000000000000000000000000000..44761c4569e9a860668e899a6ee7a4fa9f2143df --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-auth-delegator-cluster-role-binding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}:system:auth-delegator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:auth-delegator +subjects: +- kind: ServiceAccount + name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-auth-reader-role-binding.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-auth-reader-role-binding.yaml new file mode 100755 index 0000000000000000000000000000000000000000..79c0af39f6736db8835c23f61fec1145ca869d8b --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-auth-reader-role-binding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-auth-reader +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: extension-apiserver-authentication-reader +subjects: +- kind: ServiceAccount + name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml new file mode 100755 index 0000000000000000000000000000000000000000..2f828f4a6d1b6f7cbb08326a1bd13481c5aad7ff --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml @@ -0,0 +1,120 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.fullname" . }} +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + app: {{ template "k8s-prometheus-adapter.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- with .Values.podLabels }} + {{- toYaml . | trim | nindent 8 }} + {{- end }} + name: {{ template "k8s-prometheus-adapter.name" . }} + annotations: + checksum/config: {{ include (print $.Template.BasePath "/custom-metrics-configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | trim | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} + {{- if .Values.hostNetwork.enabled }} + hostNetwork: true + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - /adapter + - --secure-port={{ .Values.listenPort }} + {{- if .Values.tls.enable }} + - --tls-cert-file=/var/run/serving-cert/tls.crt + - --tls-private-key-file=/var/run/serving-cert/tls.key + {{- end }} + - --cert-dir=/tmp/cert + - --logtostderr=true + - --prometheus-url={{ .Values.prometheus.url }}{{ if .Values.prometheus.port }}:{{ .Values.prometheus.port }}{{end}}{{ .Values.prometheus.path }} + - --metrics-relist-interval={{ .Values.metricsRelistInterval }} + - --v={{ .Values.logLevel }} + - --config=/etc/adapter/config.yaml + ports: + - containerPort: {{ .Values.listenPort }} + name: https + livenessProbe: + httpGet: + path: /healthz + port: https + scheme: HTTPS + initialDelaySeconds: 30 + readinessProbe: + httpGet: + path: /healthz + port: https + scheme: HTTPS + initialDelaySeconds: 30 + {{- if .Values.resources }} + resources: + {{- toYaml .Values.resources | nindent 10 }} + {{- end }} + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: ["all"] + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 10001 + volumeMounts: + {{- if .Values.extraVolumeMounts }} + {{ toYaml .Values.extraVolumeMounts | trim | nindent 8 }} + {{ end }} + - mountPath: /etc/adapter/ + name: config + readOnly: true + - mountPath: /tmp + name: tmp + {{- if .Values.tls.enable }} + - mountPath: /var/run/serving-cert + name: volume-serving-cert + readOnly: true + {{- end }} + nodeSelector: + {{- toYaml .Values.nodeSelector | nindent 8 }} + affinity: + {{- toYaml .Values.affinity | nindent 8 }} + priorityClassName: {{ .Values.priorityClassName }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + {{- if .Values.image.pullSecrets }} + imagePullSecrets: + {{- range .Values.image.pullSecrets }} + - name: {{ . }} + {{- end }} + {{- end }} + volumes: + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | trim | nindent 6 }} + {{ end }} + - name: config + configMap: + name: {{ .Values.rules.existing | default (include "k8s-prometheus-adapter.fullname" . ) }} + - name: tmp + emptyDir: {} + {{- if .Values.tls.enable }} + - name: volume-serving-cert + secret: + secretName: {{ template "k8s-prometheus-adapter.fullname" . }} + {{- end }} diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-resource-reader-cluster-role-binding.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-resource-reader-cluster-role-binding.yaml new file mode 100755 index 0000000000000000000000000000000000000000..ec7e5e4762976c16b96e7f2cb150c4bbb4e355e5 --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-resource-reader-cluster-role-binding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-resource-reader +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "k8s-prometheus-adapter.name" . }}-resource-reader +subjects: +- kind: ServiceAccount + name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-service-account.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-service-account.yaml new file mode 100755 index 0000000000000000000000000000000000000000..d73deacb78759ff6037727339abddbf9e51213d6 --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-service-account.yaml @@ -0,0 +1,11 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-service.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-service.yaml new file mode 100755 index 0000000000000000000000000000000000000000..83dd70a91ba8cfeb90b4ab5d72963ecd64300ba0 --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.fullname" . }} +spec: + ports: + - port: {{ .Values.service.port }} + protocol: TCP + targetPort: https + selector: + app: {{ template "k8s-prometheus-adapter.name" . }} + release: {{ .Release.Name }} + type: {{ .Values.service.type }} + diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiservice.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiservice.yaml new file mode 100755 index 0000000000000000000000000000000000000000..1eb380d70f9928432442687ee69a51ebc186b7cc --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-apiservice.yaml @@ -0,0 +1,23 @@ +{{- if or .Values.rules.default .Values.rules.custom }} +apiVersion: apiregistration.k8s.io/v1beta1 +kind: APIService +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: v1beta1.custom.metrics.k8s.io +spec: + service: + name: {{ template "k8s-prometheus-adapter.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + {{ if .Values.tls.enable -}} + caBundle: {{ b64enc .Values.tls.ca }} + {{- end }} + group: custom.metrics.k8s.io + version: v1beta1 + insecureSkipTLSVerify: {{ if .Values.tls.enable }}false{{ else }}true{{ end }} + groupPriorityMinimum: 100 + versionPriority: 100 +{{- end }} diff --git a/stable/prometheus-adapter/templates/custom-metrics-cluster-role.yaml b/stable/prometheus-adapter/templates/custom-metrics-cluster-role.yaml new file mode 100755 index 0000000000000000000000000000000000000000..33daf7113bac3de664a036106bbfd9264bd70550 --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-cluster-role.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.rbac.create (or .Values.rules.default .Values.rules.custom) -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-server-resources +rules: +- apiGroups: + - custom.metrics.k8s.io + resources: ["*"] + verbs: ["*"] +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml b/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml new file mode 100755 index 0000000000000000000000000000000000000000..a191e8add3e61f0485d582ecc67844b4f25ba8e0 --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml @@ -0,0 +1,95 @@ +{{- if not .Values.rules.existing -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "k8s-prometheus-adapter.fullname" . }} + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + config.yaml: | +{{- if or .Values.rules.default .Values.rules.custom }} + rules: +{{- if .Values.rules.default }} + - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}' + seriesFilters: [] + resources: + overrides: + namespace: + resource: namespace + pod: + resource: pod + name: + matches: ^container_(.*)_seconds_total$ + as: "" + metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>,container!="POD"}[5m])) + by (<<.GroupBy>>) + - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}' + seriesFilters: + - isNot: ^container_.*_seconds_total$ + resources: + overrides: + namespace: + resource: namespace + pod: + resource: pod + name: + matches: ^container_(.*)_total$ + as: "" + metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>,container!="POD"}[5m])) + by (<<.GroupBy>>) + - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}' + seriesFilters: + - isNot: ^container_.*_total$ + resources: + overrides: + namespace: + resource: namespace + pod: + resource: pod + name: + matches: ^container_(.*)$ + as: "" + metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>,container!="POD"}) by (<<.GroupBy>>) + - seriesQuery: '{namespace!="",__name__!~"^container_.*"}' + seriesFilters: + - isNot: .*_total$ + resources: + template: <<.Resource>> + name: + matches: "" + as: "" + metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) + - seriesQuery: '{namespace!="",__name__!~"^container_.*"}' + seriesFilters: + - isNot: .*_seconds_total + resources: + template: <<.Resource>> + name: + matches: ^(.*)_total$ + as: "" + metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>) + - seriesQuery: '{namespace!="",__name__!~"^container_.*"}' + seriesFilters: [] + resources: + template: <<.Resource>> + name: + matches: ^(.*)_seconds_total$ + as: "" + metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>) +{{- end -}} +{{- if .Values.rules.custom }} +{{ toYaml .Values.rules.custom | indent 4 }} +{{- end -}} +{{- end -}} +{{- if .Values.rules.external }} + externalRules: +{{ toYaml .Values.rules.external | indent 4 }} +{{- end -}} +{{- if .Values.rules.resource }} + resourceRules: +{{ toYaml .Values.rules.resource | indent 6 }} +{{- end -}} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/custom-metrics-resource-reader-cluster-role.yaml b/stable/prometheus-adapter/templates/custom-metrics-resource-reader-cluster-role.yaml new file mode 100755 index 0000000000000000000000000000000000000000..319460a332caa65d224717e744c88deaa642a02a --- /dev/null +++ b/stable/prometheus-adapter/templates/custom-metrics-resource-reader-cluster-role.yaml @@ -0,0 +1,23 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-resource-reader +rules: +- apiGroups: + - "" + resources: + - namespaces + - pods + - services + - configmaps + verbs: + - get + - list + - watch +{{- end -}} diff --git a/stable/prometheus-adapter/templates/external-metrics-apiservice.yaml b/stable/prometheus-adapter/templates/external-metrics-apiservice.yaml new file mode 100755 index 0000000000000000000000000000000000000000..560b2ffcd80613da0cef98549a6c5de73fc00568 --- /dev/null +++ b/stable/prometheus-adapter/templates/external-metrics-apiservice.yaml @@ -0,0 +1,23 @@ +{{- if .Values.rules.external }} +apiVersion: apiregistration.k8s.io/v1beta1 +kind: APIService +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: v1beta1.external.metrics.k8s.io +spec: + service: + name: {{ template "k8s-prometheus-adapter.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + {{ if .Values.tls.enable -}} + caBundle: {{ b64enc .Values.tls.ca }} + {{- end }} + group: external.metrics.k8s.io + version: v1beta1 + insecureSkipTLSVerify: {{ if .Values.tls.enable }}false{{ else }}true{{ end }} + groupPriorityMinimum: 100 + versionPriority: 100 +{{- end -}} diff --git a/stable/prometheus-adapter/templates/external-metrics-cluster-role.yaml b/stable/prometheus-adapter/templates/external-metrics-cluster-role.yaml new file mode 100755 index 0000000000000000000000000000000000000000..4adbd653727de58f02faac0ae0a358370933a965 --- /dev/null +++ b/stable/prometheus-adapter/templates/external-metrics-cluster-role.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.rbac.create .Values.rules.external -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-external-metrics +rules: +- apiGroups: + - "external.metrics.k8s.io" + resources: + - "*" + verbs: + - list + - get + - watch +{{- end -}} diff --git a/stable/prometheus-adapter/templates/hpa-custom-metrics-cluster-role-binding.yaml b/stable/prometheus-adapter/templates/hpa-custom-metrics-cluster-role-binding.yaml new file mode 100755 index 0000000000000000000000000000000000000000..641b9d3a4467d1e379eff9925c00506c25e76931 --- /dev/null +++ b/stable/prometheus-adapter/templates/hpa-custom-metrics-cluster-role-binding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-hpa-controller +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "k8s-prometheus-adapter.name" . }}-server-resources +subjects: +- kind: ServiceAccount + name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/hpa-external-metrics-cluster-role-binding.yaml b/stable/prometheus-adapter/templates/hpa-external-metrics-cluster-role-binding.yaml new file mode 100755 index 0000000000000000000000000000000000000000..0776029af275346cc0c0ff89a06a77cb22f9b5af --- /dev/null +++ b/stable/prometheus-adapter/templates/hpa-external-metrics-cluster-role-binding.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.rbac.create .Values.rules.external -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-hpa-controller-external-metrics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "k8s-prometheus-adapter.name" . }}-external-metrics +subjects: +- kind: ServiceAccount + name: horizontal-pod-autoscaler + namespace: kube-system +{{- end -}} diff --git a/stable/prometheus-adapter/templates/resource-metrics-apiservice.yaml b/stable/prometheus-adapter/templates/resource-metrics-apiservice.yaml new file mode 100755 index 0000000000000000000000000000000000000000..f1a619912f89747d403bc074aa464105c0d558af --- /dev/null +++ b/stable/prometheus-adapter/templates/resource-metrics-apiservice.yaml @@ -0,0 +1,23 @@ +{{- if .Values.rules.resource}} +apiVersion: apiregistration.k8s.io/v1beta1 +kind: APIService +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: v1beta1.metrics.k8s.io +spec: + service: + name: {{ template "k8s-prometheus-adapter.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + {{ if .Values.tls.enable -}} + caBundle: {{ b64enc .Values.tls.ca }} + {{- end }} + group: metrics.k8s.io + version: v1beta1 + insecureSkipTLSVerify: {{ if .Values.tls.enable }}false{{ else }}true{{ end }} + groupPriorityMinimum: 100 + versionPriority: 100 +{{- end -}} diff --git a/stable/prometheus-adapter/templates/resource-metrics-cluster-role-binding.yaml b/stable/prometheus-adapter/templates/resource-metrics-cluster-role-binding.yaml new file mode 100755 index 0000000000000000000000000000000000000000..0534af11e659c394c9b4247443b9d7f6904df12c --- /dev/null +++ b/stable/prometheus-adapter/templates/resource-metrics-cluster-role-binding.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.rbac.create .Values.rules.resource -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-hpa-controller-metrics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "k8s-prometheus-adapter.name" . }}-metrics +subjects: +- kind: ServiceAccount + name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} +{{- end -}} diff --git a/stable/prometheus-adapter/templates/resource-metrics-cluster-role.yaml b/stable/prometheus-adapter/templates/resource-metrics-cluster-role.yaml new file mode 100755 index 0000000000000000000000000000000000000000..01a307d69b5b07c68ad5e23306a070a1d4b69ac4 --- /dev/null +++ b/stable/prometheus-adapter/templates/resource-metrics-cluster-role.yaml @@ -0,0 +1,22 @@ +{{- if and .Values.rbac.create .Values.rules.resource -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.name" . }}-metrics +rules: +- apiGroups: + - "" + resources: + - pods + - nodes + - nodes/stats + verbs: + - get + - list + - watch +{{- end -}} diff --git a/stable/prometheus-adapter/templates/secret.yaml b/stable/prometheus-adapter/templates/secret.yaml new file mode 100755 index 0000000000000000000000000000000000000000..38e7cb624fb1b6b58b9029c3b6eb5eed02eef1ec --- /dev/null +++ b/stable/prometheus-adapter/templates/secret.yaml @@ -0,0 +1,15 @@ +{{- if .Values.tls.enable -}} +apiVersion: v1 +kind: Secret +metadata: + labels: + app: {{ template "k8s-prometheus-adapter.name" . }} + chart: {{ template "k8s-prometheus-adapter.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ template "k8s-prometheus-adapter.fullname" . }} +type: kubernetes.io/tls +data: + tls.crt: {{ b64enc .Values.tls.certificate }} + tls.key: {{ b64enc .Values.tls.key }} +{{- end -}} diff --git a/stable/prometheus-adapter/values-ironbank.yaml b/stable/prometheus-adapter/values-ironbank.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da434bf000ff9433d7a894236feb79d13dc18d49 --- /dev/null +++ b/stable/prometheus-adapter/values-ironbank.yaml @@ -0,0 +1,9 @@ +image: + repository: registry1.dsop.io/ironbank/opensource/coreos/k8s-prometheus-adapter + tag: v0.7.0 + +tls: + enable: true + +hostNetwork: + enabled: false diff --git a/stable/prometheus-adapter/values-original.yaml b/stable/prometheus-adapter/values-original.yaml new file mode 100755 index 0000000000000000000000000000000000000000..4cc5e40692f072d90b78199eef56f9feb1ef7d1d --- /dev/null +++ b/stable/prometheus-adapter/values-original.yaml @@ -0,0 +1,141 @@ +# Default values for k8s-prometheus-adapter.. +affinity: {} + +image: + repository: directxman12/k8s-prometheus-adapter-amd64 + tag: v0.7.0 + pullPolicy: IfNotPresent + +logLevel: 4 + +metricsRelistInterval: 1m + +listenPort: 6443 + +nodeSelector: {} + +priorityClassName: "" + +# Url to access prometheus +prometheus: + url: http://prometheus.default.svc + port: 9090 + path: "" + +replicas: 1 + +rbac: + # Specifies whether RBAC resources should be created + create: true + +serviceAccount: + # Specifies whether a service account should be created + create: true + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: + +resources: {} + # requests: + # cpu: 100m + # memory: 128Mi + # limits: + # cpu: 100m + # memory: 128Mi + +rules: + default: true + custom: [] +# - seriesQuery: '{__name__=~"^some_metric_count$"}' +# resources: +# template: <<.Resource>> +# name: +# matches: "" +# as: "my_custom_metric" +# metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) + # Mounts a configMap with pre-generated rules for use. Overrides the + # default, custom, external and resource entries + existing: + external: [] +# - seriesQuery: '{__name__=~"^some_metric_count$"}' +# resources: +# template: <<.Resource>> +# name: +# matches: "" +# as: "my_external_metric" +# metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) + resource: {} +# cpu: +# containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>) +# nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>) +# resources: +# overrides: +# instance: +# resource: node +# namespace: +# resource: namespace +# pod: +# resource: pod +# containerLabel: container +# memory: +# containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>) +# nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>) +# resources: +# overrides: +# instance: +# resource: node +# namespace: +# resource: namespace +# pod: +# resource: pod +# containerLabel: container +# window: 3m + +service: + annotations: {} + port: 443 + type: ClusterIP + +tls: + enable: false + ca: |- + # Public CA file that signed the APIService + key: |- + # Private key of the APIService + certificate: |- + # Public key of the APIService + +# Any extra volumes +extraVolumes: [] + # - name: example-name + # hostPath: + # path: /path/on/host + # type: DirectoryOrCreate + # - name: ssl-certs + # hostPath: + # path: /etc/ssl/certs/ca-bundle.crt + # type: File + +# Any extra volume mounts +extraVolumeMounts: [] + # - name: example-name + # mountPath: /path/in/container + # - name: ssl-certs + # mountPath: /etc/ssl/certs/ca-certificates.crt + # readOnly: true + +tolerations: [] + +# Labels added to the pod +podLabels: {} + +# Annotations added to the pod +podAnnotations: {} + +hostNetwork: + # Specifies if prometheus-adapter should be started in hostNetwork mode. + # + # You would require this enabled if you use alternate overlay networking for pods and + # API server unable to communicate with metrics-server. As an example, this is required + # if you use Weave network on EKS + enabled: false diff --git a/stable/prometheus-adapter/values.yaml b/stable/prometheus-adapter/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76548a1779ec2f9ff39884a047a3d2a0f24e7a8f --- /dev/null +++ b/stable/prometheus-adapter/values.yaml @@ -0,0 +1,125 @@ +# Default values for k8s-prometheus-adapter.. +affinity: {} +image: + repository: registry1.dsop.io/ironbank/opensource/coreos/k8s-prometheus-adapter + tag: v0.7.0 + pullPolicy: IfNotPresent +logLevel: 4 +metricsRelistInterval: 1m +listenPort: 6443 +nodeSelector: {} +priorityClassName: "" +# Url to access prometheus +prometheus: + url: http://prometheus.default.svc + port: 9090 + path: "" +replicas: 1 +rbac: + # Specifies whether RBAC resources should be created + create: true +serviceAccount: + # Specifies whether a service account should be created + create: true + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: +resources: {} +# requests: +# cpu: 100m +# memory: 128Mi +# limits: +# cpu: 100m +# memory: 128Mi + +rules: + default: true + custom: [] + # - seriesQuery: '{__name__=~"^some_metric_count$"}' + # resources: + # template: <<.Resource>> + # name: + # matches: "" + # as: "my_custom_metric" + # metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) + # Mounts a configMap with pre-generated rules for use. Overrides the + # default, custom, external and resource entries + existing: + external: [] + # - seriesQuery: '{__name__=~"^some_metric_count$"}' + # resources: + # template: <<.Resource>> + # name: + # matches: "" + # as: "my_external_metric" + # metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) + resource: {} +# cpu: +# containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>) +# nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>) +# resources: +# overrides: +# instance: +# resource: node +# namespace: +# resource: namespace +# pod: +# resource: pod +# containerLabel: container +# memory: +# containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>) +# nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>) +# resources: +# overrides: +# instance: +# resource: node +# namespace: +# resource: namespace +# pod: +# resource: pod +# containerLabel: container +# window: 3m + +service: + annotations: {} + port: 443 + type: ClusterIP +tls: + enable: true + ca: |- + # Public CA file that signed the APIService + key: |- + # Private key of the APIService + certificate: |- + # Public key of the APIService +# Any extra volumes +extraVolumes: [] +# - name: example-name +# hostPath: +# path: /path/on/host +# type: DirectoryOrCreate +# - name: ssl-certs +# hostPath: +# path: /etc/ssl/certs/ca-bundle.crt +# type: File + +# Any extra volume mounts +extraVolumeMounts: [] +# - name: example-name +# mountPath: /path/in/container +# - name: ssl-certs +# mountPath: /etc/ssl/certs/ca-certificates.crt +# readOnly: true + +tolerations: [] +# Labels added to the pod +podLabels: {} +# Annotations added to the pod +podAnnotations: {} +hostNetwork: + # Specifies if prometheus-adapter should be started in hostNetwork mode. + # + # You would require this enabled if you use alternate overlay networking for pods and + # API server unable to communicate with metrics-server. As an example, this is required + # if you use Weave network on EKS + enabled: false