"...v0.0.7/charts/prometheus/jmayer/system-charts" did not exist on "100756799dc0cd6dc6f4a31001a363b75f28936c"
prometheus.yaml 6.58 KB
Newer Older
GGGitBoy's avatar
GGGitBoy committed
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 145 146 147 148 149 150 151 152 153 154 155 156
apiVersion: {{ template "operator_api_version" . }}
kind: Prometheus
metadata:
  labels:
    app: {{ template "app.name" . }}
    chart: {{ template "app.version" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ .Release.Name }}
spec:
{{- if .Values.securityContext }}
  securityContext:
{{ toYaml .Values.securityContext | indent 4 }}
{{- end }}
  containers:
  - name: prometheus-proxy
    command:
    - /bin/sh
    - -c 
    - cp /nginx/run-sh.tmpl /var/cache/nginx/nginx-start.sh; chmod +x /var/cache/nginx/nginx-start.sh; /var/cache/nginx/nginx-start.sh
    env:
    - name: POD_IP
      valueFrom:
        fieldRef:
          fieldPath: status.podIP
    image: {{ template "system_default_registry" . }}{{ .Values.image.proxy.repository }}:{{ .Values.image.proxy.tag }}
    ports:
    - containerPort: 8080
      name: http
      protocol: TCP
    {{- if and .Values.resources .Values.resources.proxy }}
    resources:
{{ toYaml .Values.resources.proxy | indent 6 }}
    {{- end }}
    securityContext:
      runAsUser: 101
      runAsGroup: 101
    volumeMounts:
    - mountPath: /nginx
      name: configmap-{{ template "app.nginx.fullname" . }}
    - mountPath: /var/cache/nginx
      name: nginx-home
{{- if eq .Values.level "cluster" }}
  - name: prometheus-agent
    command:
    - prometheus-auth
    {{- if and .Values.auth .Values.auth.args }}
    args:
{{ toYaml .Values.auth.args | indent 6 }}
    {{- end }}
    {{- if and .Values.auth .Values.auth.env }}
    env:
{{ toYaml .Values.auth.env | indent 6 }}
    {{- end }}
    image: {{ template "system_default_registry" . }}{{ .Values.image.auth.repository }}:{{ .Values.image.auth.tag }}
    ports:
    - containerPort: 9090
      name: web
      protocol: TCP
    livenessProbe:
      failureThreshold: 6
      httpGet:
        path: /-/healthy
        port: web
        scheme: HTTP
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 10
    readinessProbe:
      failureThreshold: 10
      httpGet:
        path: /-/ready
        port: web
        scheme: HTTP
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 10
    {{- if and .Values.resources .Values.resources.auth }}
    resources:
{{ toYaml .Values.resources.auth | indent 6 }}
    {{- end }}
  listenLocal: true
{{- end }}
  podMetadata:
    creationTimestamp: {{ now | date "2006-01-02T15:04:05Z" | quote }}
    labels:
      app: {{ template "app.name" . }}
      chart: {{ template "app.version" . }}
      release: {{ .Release.Name }}
{{- if .Values.alertingEndpoints }}
  alerting:
    alertmanagers:
{{ toYaml .Values.alertingEndpoints | indent 6 }}
{{- else if not (include "additional-alertmanager-configs.yaml" .) }}
  alerting:
    alertmanagers:
      - namespace: {{ .Values.cluster.alertManagerNamespace }}
        name: alertmanager-operated
        port: http
{{- end }}
  baseImage: {{ template "system_default_registry" . }}{{ .Values.image.repository }}
{{- if or (.Values.externalLabels) (eq .Values.level "project") }}
  externalLabels:
{{- if and (eq .Values.level "project") }}
    prometheus_from: {{ .Values.global.clusterName }}
{{- end }}
{{- range $key, $value := .Values.externalLabels}}
    {{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
  nodeSelector:
{{- include "linux-node-selector" . | nindent 4 }}
    {{- range .Values.nodeSelectors }}
    {{- $pair := regexSplit "=" . 2 }}
    {{- if eq 2 (len $pair) }}
    {{ (index $pair 0) }}: {{ (index $pair 1) }}
    {{- else }}
    {{ (index $pair 0) }}: ""
    {{- end }}
    {{- end }}
  paused: {{ .Values.paused }}
  replicas: {{ .Values.replicaCount }}
  logLevel:  {{ .Values.logLevel }}
  logFormat: {{ .Values.logFormat }}
  scrapeInterval: {{ .Values.scrapeInterval }}
  evaluationInterval: {{ .Values.evaluationInterval }}
{{- if and .Values.resources .Values.resources.core }}
  resources:
{{ toYaml .Values.resources.core | indent 4 }}
{{- end }}
  retention: "{{ .Values.retention }}"
  configMaps:
  - {{ template "app.nginx.fullname" . }}
{{- if .Values.secrets }}
  secrets:
{{ toYaml .Values.secrets | indent 2 }}
{{- end }}
{{- if .Values.enabledRBAC }}
  serviceAccountName: {{ default (default (include "app.fullname" .) .Values.serviceAccountName) .Values.serviceAccountNameOverride }}
{{- end }}
{{ include "serviceMonitor.namespace.selector" . | indent 2 }}
{{- if or (.Values.serviceMonitorSelector) (eq .Values.level "project") }}
  serviceMonitorSelector:
{{ toYaml .Values.serviceMonitorSelector | indent 4 }}
{{- end }}
{{- if and (eq .Values.level "project") (eq .Values.sync.mode "remote") }}
  remoteRead:
  - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    url: {{ printf "%s%s" .Values.sync.target .Values.sync.path }}
{{- end }}
{{ include "rule.namespace.selector" . | indent 2}}
{{ include "rule.selector" . | indent 2 }}
{{- if or .Values.storageSpec .Values.persistence.enabled }}
  storage:
    volumeClaimTemplate:
      metadata:
157 158
        creationTimestamp: {{ now | date "2006-01-02T15:04:05Z" | quote }}
      {{- if .Values.persistence.name }}
GGGitBoy's avatar
GGGitBoy committed
159 160 161 162 163 164 165 166 167
        name: {{ .Values.persistence.name }}
      {{- end }}
      spec:
{{- if .Values.storageSpec }}
{{ toYaml .Values.storageSpec | indent 8 }}
{{- else }}
        {{ if and .Values.persistence.storageClass (ne "default" .Values.persistence.storageClass) }}
        storageClassName: {{ .Values.persistence.storageClass }}
        {{ end }}
168 169 170 171
        dataSource:
          kind: ""
          name: ""
          apiGroup: ""
GGGitBoy's avatar
GGGitBoy committed
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
        accessModes: 
          - {{ default "ReadWriteOnce" .Values.persistence.accessMode }}
        resources:
          requests:
            storage: {{ .Values.persistence.size | quote }}
{{- end }}
{{- end }}
  volumes:
  - name: nginx-home
    emptyDir: {}
  version: "{{ .Values.image.tag }}"
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          topologyKey: kubernetes.io/hostname
          labelSelector:
            matchLabels:
              app: {{ template "app.name" . }}
              prometheus: {{ .Release.Name }}
  tolerations:
{{- include "linux-node-tolerations" . | nindent 4}}
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 4 }}
{{- end }}
{{- if (include "additional-scrape-configs.yaml" .) }}
  additionalScrapeConfigs:
    name: {{ template "app.fullname" . }}-additional-scrape-configs
    key: additional-scrape-configs.yaml
{{- end }}
{{- if (include "additional-alertmanager-configs.yaml" .) }}
  additionalAlertManagerConfigs:
    name: {{ template "app.fullname" . }}-additional-alertmanager-configs
    key: additional-alertmanager-configs.yaml
{{- end }}