Initial commit
This commit is contained in:
1
charts/alloy/templates/NOTES.txt
Normal file
1
charts/alloy/templates/NOTES.txt
Normal file
@@ -0,0 +1 @@
|
||||
Welcome to Grafana Alloy!
|
||||
25
charts/alloy/templates/_config.tpl
Normal file
25
charts/alloy/templates/_config.tpl
Normal file
@@ -0,0 +1,25 @@
|
||||
{{/*
|
||||
Retrieve configMap name from the name of the chart or the ConfigMap the user
|
||||
specified.
|
||||
*/}}
|
||||
{{- define "alloy.config-map.name" -}}
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if $values.configMap.name -}}
|
||||
{{- $values.configMap.name }}
|
||||
{{- else -}}
|
||||
{{- include "alloy.fullname" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
The name of the config file is the default or the key the user specified in the
|
||||
ConfigMap.
|
||||
*/}}
|
||||
{{- define "alloy.config-map.key" -}}
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if $values.configMap.key -}}
|
||||
{{- $values.configMap.key }}
|
||||
{{- else -}}
|
||||
config.alloy
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
162
charts/alloy/templates/_helpers.tpl
Normal file
162
charts/alloy/templates/_helpers.tpl
Normal file
@@ -0,0 +1,162 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "alloy.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 "alloy.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 "alloy.chart" -}}
|
||||
{{- if index .Values "$chart_tests" }}
|
||||
{{- printf "%s" .Chart.Name | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||
*/}}
|
||||
{{- define "alloy.namespace" -}}
|
||||
{{- if .Values.namespaceOverride }}
|
||||
{{- .Values.namespaceOverride }}
|
||||
{{- else }}
|
||||
{{- .Release.Namespace }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "alloy.labels" -}}
|
||||
helm.sh/chart: {{ include "alloy.chart" . }}
|
||||
{{ include "alloy.selectorLabels" . }}
|
||||
{{- if index .Values "$chart_tests" }}
|
||||
app.kubernetes.io/version: "vX.Y.Z"
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- else -}}
|
||||
{{/* substr trims delimeter prefix char from alloy.imageId output
|
||||
e.g. ':' for tags and '@' for digests.
|
||||
For digests, we crop the string to a 7-char (short) sha. */}}
|
||||
app.kubernetes.io/version: {{ (include "alloy.imageId" .) | trunc 15 | trimPrefix "@sha256" | trimPrefix ":" | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: alloy
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "alloy.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "alloy.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "alloy.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "alloy.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Calculate name of image ID to use for "alloy.
|
||||
*/}}
|
||||
{{- define "alloy.imageId" -}}
|
||||
{{- if .Values.image.digest }}
|
||||
{{- $digest := .Values.image.digest }}
|
||||
{{- if not (hasPrefix "sha256:" $digest) }}
|
||||
{{- $digest = printf "sha256:%s" $digest }}
|
||||
{{- end }}
|
||||
{{- printf "@%s" $digest }}
|
||||
{{- else if .Values.image.tag }}
|
||||
{{- printf ":%s" .Values.image.tag }}
|
||||
{{- else }}
|
||||
{{- printf ":%s" .Chart.AppVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Calculate name of image ID to use for "config-reloader".
|
||||
*/}}
|
||||
{{- define "config-reloader.imageId" -}}
|
||||
{{- if .Values.configReloader.image.digest }}
|
||||
{{- $digest := .Values.configReloader.image.digest }}
|
||||
{{- if not (hasPrefix "sha256:" $digest) }}
|
||||
{{- $digest = printf "sha256:%s" $digest }}
|
||||
{{- end }}
|
||||
{{- printf "@%s" $digest }}
|
||||
{{- else if .Values.configReloader.image.tag }}
|
||||
{{- printf ":%s" .Values.configReloader.image.tag }}
|
||||
{{- else }}
|
||||
{{- printf ":%s" "v0.8.0" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for ingress.
|
||||
*/}}
|
||||
{{- define "alloy.ingress.apiVersion" -}}
|
||||
{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }}
|
||||
{{- print "networking.k8s.io/v1" }}
|
||||
{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
|
||||
{{- print "networking.k8s.io/v1beta1" }}
|
||||
{{- else }}
|
||||
{{- print "extensions/v1beta1" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return if ingress is stable.
|
||||
*/}}
|
||||
{{- define "alloy.ingress.isStable" -}}
|
||||
{{- eq (include "alloy.ingress.apiVersion" .) "networking.k8s.io/v1" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return if ingress supports ingressClassName.
|
||||
*/}}
|
||||
{{- define "alloy.ingress.supportsIngressClassName" -}}
|
||||
{{- or (eq (include "alloy.ingress.isStable" .) "true") (and (eq (include "alloy.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
|
||||
{{- end }}
|
||||
{{/*
|
||||
Return if ingress supports pathType.
|
||||
*/}}
|
||||
{{- define "alloy.ingress.supportsPathType" -}}
|
||||
{{- or (eq (include "alloy.ingress.isStable" .) "true") (and (eq (include "alloy.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for PodDisruptionBudget.
|
||||
*/}}
|
||||
{{- define "alloy.controller.pdb.apiVersion" -}}
|
||||
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">=1.21-0" .Capabilities.KubeVersion.Version) -}}
|
||||
{{- print "policy/v1" -}}
|
||||
{{- else -}}
|
||||
{{- print "policy/v1beta1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
38
charts/alloy/templates/cluster_service.yaml
Normal file
38
charts/alloy/templates/cluster_service.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if $values.clustering.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}-cluster
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: networking
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: 'None'
|
||||
publishNotReadyAddresses: true
|
||||
selector:
|
||||
{{- include "alloy.selectorLabels" . | nindent 4 }}
|
||||
ports:
|
||||
# Do not include the -metrics suffix in the port name, otherwise metrics
|
||||
# can be double-collected with the non-headless Service if it's also
|
||||
# enabled.
|
||||
#
|
||||
# This service should only be used for clustering, and not metric
|
||||
# collection.
|
||||
- name: {{ $values.clustering.portName }}
|
||||
port: {{ $values.listenPort }}
|
||||
targetPort: {{ $values.listenPort }}
|
||||
protocol: "TCP"
|
||||
{{- range $portMap := $values.extraPorts }}
|
||||
- name: {{ $portMap.name }}
|
||||
port: {{ $portMap.port }}
|
||||
targetPort: {{ $portMap.targetPort }}
|
||||
protocol: {{ coalesce $portMap.protocol "TCP" }}
|
||||
{{- if not (empty $portMap.appProtocol) }}
|
||||
# Useful for OpenShift clusters that want to expose Alloy ports externally
|
||||
appProtocol: {{ $portMap.appProtocol }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
17
charts/alloy/templates/configmap.yaml
Normal file
17
charts/alloy/templates/configmap.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if $values.configMap.create }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "alloy.config-map.name" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: config
|
||||
data:
|
||||
{{- if $values.configMap.content }}
|
||||
config.alloy: |- {{- (tpl $values.configMap.content .) | nindent 4 }}
|
||||
{{- else }}
|
||||
config.alloy: |- {{- .Files.Get "config/example.alloy" | trim | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
92
charts/alloy/templates/containers/_agent.yaml
Normal file
92
charts/alloy/templates/containers/_agent.yaml
Normal file
@@ -0,0 +1,92 @@
|
||||
{{- define "alloy.container" -}}
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
- name: alloy
|
||||
image: {{ .Values.global.image.registry | default .Values.image.registry }}/{{ .Values.image.repository }}{{ include "alloy.imageId" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
args:
|
||||
- run
|
||||
- /etc/alloy/{{ include "alloy.config-map.key" . }}
|
||||
- --storage.path={{ $values.storagePath }}
|
||||
- --server.http.listen-addr={{ $values.listenAddr }}:{{ $values.listenPort }}
|
||||
- --server.http.ui-path-prefix={{ $values.uiPathPrefix }}
|
||||
{{- if not $values.enableReporting }}
|
||||
- --disable-reporting
|
||||
{{- end}}
|
||||
{{- if $values.clustering.enabled }}
|
||||
- --cluster.enabled=true
|
||||
- --cluster.join-addresses={{ include "alloy.fullname" . }}-cluster
|
||||
{{- if $values.clustering.name }}
|
||||
- --cluster.name={{ $values.clustering.name }}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
{{- if $values.stabilityLevel }}
|
||||
- --stability.level={{ $values.stabilityLevel }}
|
||||
{{- end }}
|
||||
{{- range $values.extraArgs }}
|
||||
- {{ . }}
|
||||
{{- end}}
|
||||
env:
|
||||
- name: ALLOY_DEPLOY_MODE
|
||||
value: "helm"
|
||||
- name: HOSTNAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
{{- range $values.extraEnv }}
|
||||
- {{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if $values.envFrom }}
|
||||
envFrom:
|
||||
{{- toYaml $values.envFrom | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ $values.listenPort }}
|
||||
name: http-metrics
|
||||
{{- range $portMap := $values.extraPorts }}
|
||||
- containerPort: {{ $portMap.targetPort }}
|
||||
{{- if $portMap.hostPort }}
|
||||
hostPort: {{ $portMap.hostPort }}
|
||||
{{- end}}
|
||||
name: {{ $portMap.name }}
|
||||
protocol: {{ coalesce $portMap.protocol "TCP" }}
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /-/ready
|
||||
port: {{ $values.listenPort }}
|
||||
scheme: {{ $values.listenScheme }}
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 1
|
||||
{{- with $values.livenessProbe }}
|
||||
livenessProbe:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $values.lifecycle }}
|
||||
lifecycle:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $values.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/alloy
|
||||
{{- if $values.mounts.varlog }}
|
||||
- name: varlog
|
||||
mountPath: /var/log
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if $values.mounts.dockercontainers }}
|
||||
- name: dockercontainers
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- range $values.mounts.extra }}
|
||||
- {{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
26
charts/alloy/templates/containers/_watch.yaml
Normal file
26
charts/alloy/templates/containers/_watch.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- define "alloy.watch-container" -}}
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if .Values.configReloader.enabled -}}
|
||||
- name: config-reloader
|
||||
image: {{ .Values.global.image.registry | default .Values.configReloader.image.registry }}/{{ .Values.configReloader.image.repository }}{{ include "config-reloader.imageId" . }}
|
||||
{{- if .Values.configReloader.customArgs }}
|
||||
args:
|
||||
{{- toYaml .Values.configReloader.customArgs | nindent 4 }}
|
||||
{{- else }}
|
||||
args:
|
||||
- --watched-dir=/etc/alloy
|
||||
- --reload-url=http://localhost:{{ $values.listenPort }}/-/reload
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/alloy
|
||||
{{- with .Values.configReloader.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.configReloader.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
93
charts/alloy/templates/controllers/_pod.yaml
Normal file
93
charts/alloy/templates/controllers/_pod.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
{{- define "alloy.pod-template" -}}
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
metadata:
|
||||
annotations:
|
||||
kubectl.kubernetes.io/default-container: alloy
|
||||
{{- if and $values.configMap.create $values.configMap.content }}
|
||||
checksum/config: {{ (tpl $values.configMap.content .) | sha256sum | trunc 63 }}
|
||||
{{- end }}
|
||||
{{- with .Values.controller.podAnnotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "alloy.selectorLabels" . | nindent 4 }}
|
||||
{{- with .Values.controller.podLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.global.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "alloy.serviceAccountName" . }}
|
||||
{{- if or .Values.global.image.pullSecrets .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- if .Values.global.image.pullSecrets }}
|
||||
{{- toYaml .Values.global.image.pullSecrets | nindent 4 }}
|
||||
{{- else }}
|
||||
{{- toYaml .Values.image.pullSecrets | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.initContainers }}
|
||||
initContainers:
|
||||
{{- with .Values.controller.initContainers }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
{{- include "alloy.container" . | nindent 4 }}
|
||||
{{- include "alloy.watch-container" . | nindent 4 }}
|
||||
{{- with .Values.controller.extraContainers }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end}}
|
||||
{{- if .Values.controller.priorityClassName }}
|
||||
priorityClassName: {{ .Values.controller.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.hostNetwork }}
|
||||
hostNetwork: {{ .Values.controller.hostNetwork }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.hostPID }}
|
||||
hostPID: {{ .Values.controller.hostPID }}
|
||||
{{- end }}
|
||||
dnsPolicy: {{ .Values.controller.dnsPolicy }}
|
||||
{{- with .Values.controller.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds | int }}
|
||||
{{- end }}
|
||||
{{- with .Values.controller.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.controller.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.controller.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "alloy.config-map.name" . }}
|
||||
{{- if $values.mounts.varlog }}
|
||||
- name: varlog
|
||||
hostPath:
|
||||
path: /var/log
|
||||
{{- end }}
|
||||
{{- if $values.mounts.dockercontainers }}
|
||||
- name: dockercontainers
|
||||
hostPath:
|
||||
path: /var/lib/docker/containers
|
||||
{{- end }}
|
||||
{{- if .Values.controller.volumes.extra }}
|
||||
{{- toYaml .Values.controller.volumes.extra | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $values.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml $values.hostAliases | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
26
charts/alloy/templates/controllers/daemonset.yaml
Normal file
26
charts/alloy/templates/controllers/daemonset.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- if eq .Values.controller.type "daemonset" }}
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
{{- with .Values.controller.extraAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if ge (int .Capabilities.KubeVersion.Minor) 22 }}
|
||||
minReadySeconds: 10
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "alloy.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
{{- include "alloy.pod-template" . | nindent 4 }}
|
||||
{{- with .Values.controller.updateStrategy }}
|
||||
updateStrategy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
29
charts/alloy/templates/controllers/deployment.yaml
Normal file
29
charts/alloy/templates/controllers/deployment.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
{{- if eq .Values.controller.type "deployment" }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
{{- with .Values.controller.extraAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if not .Values.controller.autoscaling.enabled }}
|
||||
replicas: {{ .Values.controller.replicas }}
|
||||
{{- end }}
|
||||
{{- if ge (int .Capabilities.KubeVersion.Minor) 22 }}
|
||||
minReadySeconds: 10
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "alloy.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
{{- include "alloy.pod-template" . | nindent 4 }}
|
||||
{{- with .Values.controller.updateStrategy }}
|
||||
strategy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
51
charts/alloy/templates/controllers/statefulset.yaml
Normal file
51
charts/alloy/templates/controllers/statefulset.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
{{- if eq .Values.controller.type "statefulset" }}
|
||||
{{- if .Values.enableStatefulSetAutoDeletePVC }}
|
||||
{{- fail "Value 'enableStatefulSetAutoDeletePVC' should be nested inside 'controller' options." }}
|
||||
{{- end }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
{{- with .Values.controller.extraAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if not .Values.controller.autoscaling.enabled }}
|
||||
replicas: {{ .Values.controller.replicas }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.parallelRollout }}
|
||||
podManagementPolicy: Parallel
|
||||
{{- end }}
|
||||
{{- if ge (int .Capabilities.KubeVersion.Minor) 22 }}
|
||||
minReadySeconds: 10
|
||||
{{- end }}
|
||||
serviceName: {{ include "alloy.fullname" . }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "alloy.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
{{- include "alloy.pod-template" . | nindent 4 }}
|
||||
{{- with .Values.controller.updateStrategy }}
|
||||
updateStrategy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.controller.volumeClaimTemplates }}
|
||||
volumeClaimTemplates:
|
||||
{{- range . }}
|
||||
- {{ toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.controller.enableStatefulSetAutoDeletePVC) }}
|
||||
{{- /*
|
||||
Data on the read nodes is easy to replace, so we want to always delete PVCs to make
|
||||
operation easier, and will rely on re-fetching data when needed.
|
||||
*/}}
|
||||
persistentVolumeClaimRetentionPolicy:
|
||||
whenDeleted: Delete
|
||||
whenScaled: Delete
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
4
charts/alloy/templates/extra-manifests.yaml
Normal file
4
charts/alloy/templates/extra-manifests.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
{{ range .Values.extraObjects }}
|
||||
---
|
||||
{{ tpl (toYaml .) $ }}
|
||||
{{ end }}
|
||||
83
charts/alloy/templates/hpa.yaml
Normal file
83
charts/alloy/templates/hpa.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if and (or (eq .Values.controller.type "deployment") (eq .Values.controller.type "statefulset" )) (or .Values.controller.autoscaling.horizontal.enabled .Values.controller.autoscaling.enabled) }}
|
||||
{{ $autoscaling := .Values.controller.autoscaling }}
|
||||
{{- if .Values.controller.autoscaling.horizontal.enabled }}
|
||||
{{- $autoscaling = .Values.controller.autoscaling.horizontal }}
|
||||
{{- end }}
|
||||
{{- if (not (empty $autoscaling.targetMemoryUtilizationPercentage)) }}
|
||||
{{- $_ := $values.resources.requests | required ".Values.alloy.resources.requests is required when using autoscaling." -}}
|
||||
{{- $_ := $values.resources.requests.memory | required ".Values.alloy.resources.requests.memory is required when using autoscaling based on memory utilization." -}}
|
||||
{{- $_ := .Values.configReloader.resources.requests | required ".Values.configReloader.resources.requests is required when using autoscaling." -}}
|
||||
{{- $_ := .Values.configReloader.resources.requests.memory | required ".Values.configReloader.resources.requests.memory is required when using autoscaling based on memory utilization." -}}
|
||||
{{- end}}
|
||||
{{- if (not (empty $autoscaling.targetCPUUtilizationPercentage)) }}
|
||||
{{- $_ := $values.resources.requests | required ".Values.alloy.resources.requests is required when using autoscaling." -}}
|
||||
{{- $_ := $values.resources.requests.cpu | required ".Values.alloy.resources.requests.cpu is required when using autoscaling based on cpu utilization." -}}
|
||||
{{- $_ := .Values.configReloader.resources.requests | required ".Values.configReloader.resources.requests is required when using autoscaling." -}}
|
||||
{{- $_ := .Values.configReloader.resources.requests.cpu | required ".Values.configReloader.resources.requests.cpu is required when using autoscaling based on cpu utilization." -}}
|
||||
{{- end}}
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: availability
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: {{ .Values.controller.type }}
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
{{- with $autoscaling }}
|
||||
minReplicas: {{ .minReplicas }}
|
||||
maxReplicas: {{ .maxReplicas }}
|
||||
behavior:
|
||||
{{- with .scaleDown }}
|
||||
scaleDown:
|
||||
{{- if .policies }}
|
||||
policies:
|
||||
{{- range .policies }}
|
||||
- type: {{ .type }}
|
||||
value: {{ .value }}
|
||||
periodSeconds: {{ .periodSeconds }}
|
||||
{{- end }}
|
||||
selectPolicy: {{ .selectPolicy }}
|
||||
{{- end }}
|
||||
stabilizationWindowSeconds: {{ .stabilizationWindowSeconds }}
|
||||
{{- end }}
|
||||
{{- with .scaleUp }}
|
||||
scaleUp:
|
||||
{{- if .policies }}
|
||||
policies:
|
||||
{{- range .policies }}
|
||||
- type: {{ .type }}
|
||||
value: {{ .value }}
|
||||
periodSeconds: {{ .periodSeconds }}
|
||||
{{- end }}
|
||||
selectPolicy: {{ .selectPolicy }}
|
||||
{{- end }}
|
||||
stabilizationWindowSeconds: {{ .stabilizationWindowSeconds }}
|
||||
{{- end }}
|
||||
metrics:
|
||||
# Changing the order of the metrics will cause ArgoCD to go into a sync loop
|
||||
# memory needs to be first.
|
||||
# More info in: https://github.com/argoproj/argo-cd/issues/1079
|
||||
{{- with .targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
79
charts/alloy/templates/ingress.yaml
Normal file
79
charts/alloy/templates/ingress.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $ingressApiIsStable := eq (include "alloy.ingress.isStable" .) "true" -}}
|
||||
{{- $ingressSupportsIngressClassName := eq (include "alloy.ingress.supportsIngressClassName" .) "true" -}}
|
||||
{{- $ingressSupportsPathType := eq (include "alloy.ingress.supportsPathType" .) "true" -}}
|
||||
{{- $fullName := include "alloy.fullname" . -}}
|
||||
{{- $servicePort := .Values.ingress.faroPort -}}
|
||||
{{- $ingressPath := .Values.ingress.path -}}
|
||||
{{- $ingressPathType := .Values.ingress.pathType -}}
|
||||
{{- $extraPaths := .Values.ingress.extraPaths -}}
|
||||
apiVersion: {{ include "alloy.ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: networking
|
||||
{{- with .Values.ingress.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := . }}
|
||||
{{ $key }}: {{ tpl $value $ | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and $ingressSupportsIngressClassName .Values.ingress.ingressClassName }}
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName }}
|
||||
{{- end -}}
|
||||
{{- with .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- tpl (toYaml .) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.ingress.hosts }}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ tpl . $ }}
|
||||
http:
|
||||
paths:
|
||||
{{- with $extraPaths }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
- path: {{ $ingressPath }}
|
||||
{{- if $ingressSupportsPathType }}
|
||||
pathType: {{ $ingressPathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if $ingressApiIsStable }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- http:
|
||||
paths:
|
||||
- backend:
|
||||
{{- if $ingressApiIsStable }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- with $ingressPath }}
|
||||
path: {{ . }}
|
||||
{{- end }}
|
||||
{{- if $ingressSupportsPathType }}
|
||||
pathType: {{ $ingressPathType }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
31
charts/alloy/templates/pdb.yaml
Normal file
31
charts/alloy/templates/pdb.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
{{- if .Values.controller.podDisruptionBudget.enabled }}
|
||||
{{- if eq .Values.controller.type "daemonset" }}
|
||||
{{- fail "PDBs (Pod Disruption Budgets) are not intended for DaemonSets. Please use a different controller type." }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and .Values.controller.podDisruptionBudget.minAvailable .Values.controller.podDisruptionBudget.maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be defined for PodDisruptionBudget" }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not (or .Values.controller.podDisruptionBudget.minAvailable .Values.controller.podDisruptionBudget.maxUnavailable) }}
|
||||
{{- fail "Either minAvailable or maxUnavailable must be defined for PodDisruptionBudget" }}
|
||||
{{- end }}
|
||||
|
||||
apiVersion: {{ include "alloy.controller.pdb.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "alloy.selectorLabels" . | nindent 6 }}
|
||||
{{- if .Values.controller.podDisruptionBudget.minAvailable }}
|
||||
minAvailable: {{ .Values.controller.podDisruptionBudget.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.podDisruptionBudget.maxUnavailable }}
|
||||
maxUnavailable: {{ .Values.controller.podDisruptionBudget.maxUnavailable }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
112
charts/alloy/templates/rbac.yaml
Normal file
112
charts/alloy/templates/rbac.yaml
Normal file
@@ -0,0 +1,112 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: rbac
|
||||
rules:
|
||||
# Rules which allow discovery.kubernetes to function.
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "discovery.k8s.io"
|
||||
- "networking.k8s.io"
|
||||
resources:
|
||||
- endpoints
|
||||
- endpointslices
|
||||
- ingresses
|
||||
- nodes
|
||||
- nodes/proxy
|
||||
- nodes/metrics
|
||||
- pods
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# Rules which allow loki.source.kubernetes and loki.source.podlogs to work.
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- pods/log
|
||||
- namespaces
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- "monitoring.grafana.com"
|
||||
resources:
|
||||
- podlogs
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# Rules which allow mimir.rules.kubernetes to work.
|
||||
- apiGroups: ["monitoring.coreos.com"]
|
||||
resources:
|
||||
- prometheusrules
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- nonResourceURLs:
|
||||
- /metrics
|
||||
verbs:
|
||||
- get
|
||||
# Rules for prometheus.kubernetes.*
|
||||
- apiGroups: ["monitoring.coreos.com"]
|
||||
resources:
|
||||
- podmonitors
|
||||
- servicemonitors
|
||||
- probes
|
||||
- scrapeconfigs
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# Rules which allow eventhandler to work.
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# needed for remote.kubernetes.*
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- "configmaps"
|
||||
- "secrets"
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# needed for otelcol.processor.k8sattributes
|
||||
- apiGroups: ["apps"]
|
||||
resources: ["replicasets"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["extensions"]
|
||||
resources: ["replicasets"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: rbac
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "alloy.serviceAccountName" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
{{- end }}
|
||||
43
charts/alloy/templates/service.yaml
Normal file
43
charts/alloy/templates/service.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if .Values.service.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: networking
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if .Values.service.clusterIP }}
|
||||
clusterIP: {{ .Values.service.clusterIP }}
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "alloy.selectorLabels" . | nindent 4 }}
|
||||
{{- if semverCompare ">=1.26-0" .Capabilities.KubeVersion.Version }}
|
||||
internalTrafficPolicy: {{.Values.service.internalTrafficPolicy}}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
{{- if eq .Values.service.type "NodePort" }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
port: {{ $values.listenPort }}
|
||||
targetPort: {{ $values.listenPort }}
|
||||
protocol: "TCP"
|
||||
{{- range $portMap := $values.extraPorts }}
|
||||
- name: {{ $portMap.name }}
|
||||
port: {{ $portMap.port }}
|
||||
targetPort: {{ $portMap.targetPort }}
|
||||
protocol: {{ coalesce $portMap.protocol "TCP" }}
|
||||
{{- if not (empty $portMap.appProtocol) }}
|
||||
# Useful for OpenShift clusters that want to expose Alloy ports externally
|
||||
appProtocol: {{ $portMap.appProtocol }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
18
charts/alloy/templates/serviceaccount.yaml
Normal file
18
charts/alloy/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
|
||||
metadata:
|
||||
name: {{ include "alloy.serviceAccountName" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: rbac
|
||||
{{- with .Values.serviceAccount.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
37
charts/alloy/templates/servicemonitor.yaml
Normal file
37
charts/alloy/templates/servicemonitor.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if and .Values.service.enabled .Values.serviceMonitor.enabled -}}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- with .Values.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
scheme: {{ $values.listenScheme | lower }}
|
||||
honorLabels: true
|
||||
{{- if .Values.serviceMonitor.interval }}
|
||||
interval: {{ .Values.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{ tpl (toYaml .Values.serviceMonitor.metricRelabelings | nindent 6) . }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{ tpl (toYaml .Values.serviceMonitor.relabelings | nindent 6) . }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceMonitor.tlsConfig }}
|
||||
tlsConfig:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "alloy.selectorLabels" . | nindent 6 }}
|
||||
{{- end }}
|
||||
41
charts/alloy/templates/vpa.yaml
Normal file
41
charts/alloy/templates/vpa.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
{{- if .Capabilities.APIVersions.Has "autoscaling.k8s.io/v1" -}}
|
||||
{{- if .Values.controller.autoscaling.vertical.enabled -}}
|
||||
apiVersion: autoscaling.k8s.io/v1
|
||||
kind: VerticalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: availability
|
||||
spec:
|
||||
{{- with .Values.controller.autoscaling.vertical }}
|
||||
{{- with .recommenders }}
|
||||
recommenders:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .resourcePolicy }}
|
||||
resourcePolicy:
|
||||
{{- with .containerPolicies }}
|
||||
containerPolicies:
|
||||
{{- range . }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .updatePolicy }}
|
||||
updatePolicy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
targetRef:
|
||||
apiVersion: apps/v1
|
||||
{{- if eq .Values.controller.type "deployment" }}
|
||||
kind: Deployment
|
||||
{{- else if eq .Values.controller.type "statefulset" }}
|
||||
kind: StatefulSet
|
||||
{{- else }}
|
||||
kind: DaemonSet
|
||||
{{- end }}
|
||||
name: {{ include "alloy.fullname" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user