diff --git a/README.md b/README.md index 641b6e8..6d2cb85 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ We are open to contributors, you can contribute to Empathy Helm Charts through c Following the list complete list of supported Helm Charts: +* motive-cache * motive-cronjob * motive-service * multi-service \ No newline at end of file diff --git a/charts/motive-cache/.helmignore b/charts/motive-cache/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/motive-cache/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/motive-cache/Chart.yaml b/charts/motive-cache/Chart.yaml new file mode 100644 index 0000000..87a0ccc --- /dev/null +++ b/charts/motive-cache/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: motive-cache +description: A Helm chart for Kubernetes + +type: application + +version: 0.1.0 + +appVersion: "1.0.0" diff --git a/charts/motive-cache/README.md b/charts/motive-cache/README.md new file mode 100644 index 0000000..dcbfadc --- /dev/null +++ b/charts/motive-cache/README.md @@ -0,0 +1,76 @@ +# motive-cache + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) + +A Helm chart for Kubernetes + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | Similar to the nodeSelector, but slightly different: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity | +| backend.namespaces | list | `[]` | Namespace(s) to look for backend pods. By default - namespace the VarnishCluster is deployed to. | +| backend.onlyReady | bool | `false` | Include (false, by default) or exclude (true) backend pods from the VCL (.Backends template var). Alters .Backends template variable based on Kubernetes health checks (by default not ready pods are also included in VCL) instead of Varnish health probes. | +| backend.port | string | `"backend-port"` | The port of the backend pods being cached by Varnish. Can be port name or port number. | +| backend.selector | object | `{}` | The selector used to identify the backend Pods. | +| backend.zoneBalancing | object | `{"thresholds":[],"type":"disabled"}` | Controls Varnish backend topology aware routing which can assign weights to backends according to their geographical location. | +| backend.zoneBalancing.thresholds | list | `[]` | Array of thresholds objects to determine condition and respective weights to be assigned to backends: threshold, local - local backend weight, remote - remote backend weight | +| backend.zoneBalancing.type | string | `"disabled"` | Varnish backend zone-balancing type. Accepted values: disabled, auto, thresholds | +| fullnameOverride | string | `""` | | +| ingress.internal.annotations | object | `{}` | | +| ingress.internal.className | string | `"nginx-internal"` | | +| ingress.internal.enabled | bool | `false` | | +| ingress.internal.hosts[0].host | string | `"chart-example.local"` | | +| ingress.internal.hosts[0].paths[0].path | string | `"/"` | | +| ingress.internal.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.internal.hosts[0].paths[0].port | int | `8080` | | +| ingress.internal.hosts[0].paths[0].portName | string | `"http"` | | +| ingress.internal.tls | list | `[]` | | +| logFormat | string | `"json"` | Format of the logs. Can be json and console. | +| logLevel | string | `"info"` | The minimum enabled logging level. Allowed values: debug, info, warn, error, dpanic, panic, fatal. | +| monitoring | object | `{"grafanaDashboard":{"datasourceName":"","enabled":false,"labels":{},"namespace":"","title":""},"prometheusServiceMonitor":{"enabled":true,"labels":{},"namespace":""}}` | The operator monitoring configuration object | +| monitoring.grafanaDashboard | object | `{"datasourceName":"","enabled":false,"labels":{},"namespace":"","title":""}` | A dashboard that can be installed along with the operator and used in grafana. Installed as a ConfigMap. | +| monitoring.grafanaDashboard.datasourceName | string | `""` | Name of the Grafana datasource the dashboard should use. (required) | +| monitoring.grafanaDashboard.enabled | bool | `false` | Enable or disable the ConfigMap installation. | +| monitoring.grafanaDashboard.labels | object | `{}` | ConfigMap labels. Can be used to for discovery by grafana. | +| monitoring.grafanaDashboard.namespace | string | `""` | Namespace that the ConfigMap with the dashboard should be installed to. Default to the namespace VarnishCluster is installed to | +| monitoring.grafanaDashboard.title | string | `""` | Title of the Grafana dashboard. Default: Varnish (/) | +| monitoring.prometheusServiceMonitor | object | `{"enabled":true,"labels":{},"namespace":""}` | The Prometheus ServiceMonitor that is preconfigured to monitors the operator pods. | +| monitoring.prometheusServiceMonitor.enabled | bool | `true` | Enable or disable ServiceMontitor installation. | +| monitoring.prometheusServiceMonitor.labels | object | `{}` | ServiceMonitor labels that will be used by Prometheus instance to discover this ServiceMonitor. | +| monitoring.prometheusServiceMonitor.namespace | string | `""` | The namespace it should be installed to. Default to the namespace VarnishCluster is installed to | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | Node selector to control where the Varnish pods should be scheduled | +| podAntiAffinity | string | `"hard"` | | +| podAntiAffinityTopologyKey | string | `"kubernetes.io/hostname"` | | +| podDisruptionBudget | object | `{"maxUnavailable":null,"minAvailable":1}` | Pod Disruption Budget configuration. Can be used to tell Kubernetes how many pods are required to be up (or allowed to be down) to not cause service disruption | +| podDisruptionBudget.maxUnavailable | string | `nil` | An eviction is allowed if at most maxUnavailable pods are unavailable after the eviction, i.e. even in absence of the evicted pod. This is a mutually exclusive setting with minAvailable | +| podDisruptionBudget.minAvailable | int | `1` | An eviction is allowed if at least minAvailable pods will still be available after the eviction, i.e. even in the absence of the evicted pod | +| replicas | int | `1` | Number of Varnish nodes | +| service | object | `{"annotations":{},"controllerMetricsNodePort":30002,"metricsNodePort":30001,"metricsPort":9131,"nodePort":30000,"port":80,"type":"ClusterIP"}` | Varnish service configuration. | +| service.annotations | object | `{}` | Additional annotations for the service. | +| service.controllerMetricsNodePort | int | `30002` | The port number used to set NodePort for Varnish Controller Metrics exporter. Service type `NodePort should be selected. | +| service.metricsNodePort | int | `30001` | The port number used to set NodePort for Varnish Metrics Exporter. Service type `NodePort should be selected. | +| service.metricsPort | int | `9131` | The port that will expose the Prometheus metrics exporter. | +| service.nodePort | int | `30000` | The port number used to set NodePort for Varnish. Service type `NodePort should be selected. | +| service.port | int | `80` | The port number used to expose Varnish pods. | +| service.type | string | `"ClusterIP"` | Type of the Service. Allowed values: ClusterIP; LoadBalancer; NodePort | +| tolerations | list | `[]` | Configuration that defines which node taints can the pods tolerate. For example to allow Varnish pods to run on nodes that are marked (tainted) as machines dedicated for in-memory cache | +| updateStrategy | object | `{"delayedRollingUpdate":{"delaySeconds":60},"rollingUpdate":{"partition":0},"type":"OnDelete"}` | Allows to control the way Varnish pods will be updated. | +| updateStrategy.delayedRollingUpdate | object | `{"delaySeconds":60}` | Configuration for DelayedRollingUpdate strategy | +| updateStrategy.delayedRollingUpdate.delaySeconds | int | `60` | Indicates the wait time between pod reloads during rolling update | +| updateStrategy.rollingUpdate | object | `{"partition":0}` | Used to communicate parameters when type is RollingUpdate | +| updateStrategy.rollingUpdate.partition | int | `0` | Partition indicates the ordinal at which the StatefulSet should be partitioned. | +| updateStrategy.type | string | `"OnDelete"` | Defines the type of the update strategy. (RollingUpdate, OnDelete, DelayedRollingUpdate) | +| varnish | object | `{"args":[],"controller":{"imagePullPolicy":"IfNotPresent","resources":{"limits":{"memory":"128Mi"},"requests":{"cpu":"10m","memory":"64Mi"}}},"imagePullPolicy":"IfNotPresent","metricsExporter":{"imagePullPolicy":"IfNotPresent","resources":{"limits":{"memory":"32Mi"},"requests":{"cpu":"10m","memory":"16Mi"}}},"resources":{"limits":{"memory":"192Mi"},"requests":{"cpu":"20m","memory":"128Mi"}}}` | An object that defines the configuration of a particular Varnish instance being deployed | +| varnish.args | list | `[]` | Additional Varnish daemon arguments | +| varnish.controller | object | `{"imagePullPolicy":"IfNotPresent","resources":{"limits":{"memory":"128Mi"},"requests":{"cpu":"10m","memory":"64Mi"}}}` | An object that defines the configuration of a particular Varnish controller being deployed | +| varnish.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy for the Varnish container. | +| varnish.metricsExporter | object | `{"imagePullPolicy":"IfNotPresent","resources":{"limits":{"memory":"32Mi"},"requests":{"cpu":"10m","memory":"16Mi"}}}` | An object that defines the configuration of a particular Varnish Prometheus metrics exporter being deployed | +| varnish.resources | object | `{"limits":{"memory":"192Mi"},"requests":{"cpu":"20m","memory":"128Mi"}}` | Resource requests and limits for Varnish container. | +| vcl | object | `{"configMapName":"tmp","entrypointFileName":"tmp"}` | An object that defines the VCL ConfigMap configuration | +| vcl.configMapName | string | `"tmp"` | Name of the ConfigMap containing the VCL configuration files | +| vcl.entrypointFileName | string | `"tmp"` | The name of the main VCL file | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) diff --git a/charts/motive-cache/templates/_helpers.tpl b/charts/motive-cache/templates/_helpers.tpl new file mode 100644 index 0000000..6d9b17e --- /dev/null +++ b/charts/motive-cache/templates/_helpers.tpl @@ -0,0 +1,105 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "motive-cache.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 "motive-cache.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 "motive-cache.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "motive-cache.labels" -}} +helm.sh/chart: {{ include "motive-cache.chart" . }} +{{ include "motive-cache.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "motive-cache.selectorLabels" -}} +app.kubernetes.io/name: {{ include "motive-cache.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "motive-cache.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "motive-cache.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Common affinity definition +Pod affinity + - Soft prefers different nodes + - Hard requires different nodes and prefers different availibility zones +Node affinity + - Soft prefers given user expressions + - Hard requires given user expressions +*/}} +{{- define "motive-cache.affinity" -}} +{{- if or $.Values.podAntiAffinity $.Values.affinity -}} +affinity: + {{- with $.Values.affinity }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- if eq $.Values.podAntiAffinity "hard" }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + {{- include "motive-cache.selectorLabels" $ | nindent 12 }} + topologyKey: {{ $.Values.podAntiAffinityTopologyKey }} + {{- if (semverCompare ">=1.29.0-0" $.Capabilities.KubeVersion.Version) -}} + matchLabelKeys: + - pod-template-hash + {{- end -}} + {{- else if eq $.Values.podAntiAffinity "soft" }} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + {{- include "motive-cache.selectorLabels" $ | nindent 14 }} + topologyKey: {{ $.Values.podAntiAffinityTopologyKey }} + {{- if (semverCompare ">=1.29.0-0" $.Capabilities.KubeVersion.Version) -}} + matchLabelKeys: + - pod-template-hash + {{- end -}} + {{- end -}} +{{- end }} +{{- end }} diff --git a/charts/motive-cache/templates/ingress-internal.yaml b/charts/motive-cache/templates/ingress-internal.yaml new file mode 100644 index 0000000..c871dc7 --- /dev/null +++ b/charts/motive-cache/templates/ingress-internal.yaml @@ -0,0 +1,61 @@ +{{- with .Values.ingress.internal -}} +{{- if .enabled -}} +{{- if and .className (not (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .annotations "kubernetes.io/ingress.class" .className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" $.Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ include "motive-cache.fullname" $ }}-internal + labels: + {{- include "motive-cache.labels" $ | nindent 4 }} + {{- with .annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .className (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .className }} + {{- end }} + {{- if .tls }} + tls: + {{- range .tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ include "motive-cache.fullname" $ }} + port: + name: varnish + {{- else }} + serviceName: {{ include "motive-cache.fullname" $ }} + servicePort: {{ .port | default 80 }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/motive-cache/templates/service.yaml b/charts/motive-cache/templates/service.yaml new file mode 100644 index 0000000..8ecfe8d --- /dev/null +++ b/charts/motive-cache/templates/service.yaml @@ -0,0 +1,29 @@ +{{- range untilStep 0 (int .Values.replicas) 1 }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "motive-cache.fullname" $ }}-{{ . }} + labels: + {{- include "motive-cache.labels" $ | nindent 4 }} + annotations: + service.kubernetes.io/topology-mode: Auto +spec: + type: ClusterIP + ports: + - name: varnish + port: 80 + targetPort: varnish + protocol: TCP + - name: metrics + port: 9131 + protocol: TCP + targetPort: metrics + - name: ctrl-metrics + port: 8235 + protocol: TCP + targetPort: ctrl-metrics + selector: + varnish-component: varnish + statefulset.kubernetes.io/pod-name: {{ include "motive-cache.fullname" $ }}-{{ . }} +{{- end }} \ No newline at end of file diff --git a/charts/motive-cache/templates/varnish-cluster.yaml b/charts/motive-cache/templates/varnish-cluster.yaml new file mode 100644 index 0000000..5d13f08 --- /dev/null +++ b/charts/motive-cache/templates/varnish-cluster.yaml @@ -0,0 +1,111 @@ +apiVersion: caching.ibm.com/v1alpha1 +kind: VarnishCluster +metadata: + name: {{ include "motive-cache.fullname" . }} + labels: + {{- include "motive-cache.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- include "motive-cache.affinity" $ | nindent 2 }} + + backend: # required + {{- with .Values.backend.namespaces }} + namespaces: + {{- toYaml . | nindent 6 }} + {{- end }} + onlyReady: {{ .Values.backend.onlyReady | default true }} + port: {{ .Values.backend.port | required ".Values.backend.port is required." }} # required + selector: # required + {{- toYaml (.Values.backend.selector | required ".Values.backend.selector is required.") | nindent 6 }} + zoneBalancing: + type: {{ .Values.backend.zoneBalancing.type }} + {{- with .Values.backend.zoneBalancing.thresholds }} + thresholds: + {{- toYaml . | nindent 8 }} + {{- end }} + + logFormat: {{ .Values.logFormat | default "json" }} + + logLevel: {{ .Values.logLevel | default "info" }} + + {{- if or .Values.monitoring.grafanaDashboard.enabled .Values.monitoring.prometheusServiceMonitor.enabled }} + monitoring: + {{- if .Values.monitoring.grafanaDashboard.enabled }} + grafanaDashboard: + enabled: true + datasourceName: {{ .Values.monitoring.grafanaDashboard.datasourceName | required "monitoring.grafanaDashboard.datasourceName is required." }} + {{- with .Values.monitoring.grafanaDashboard.labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end }} + namespace: {{ .Values.monitoring.grafanaDashboard.namespace | default .Release.Namespace }} + {{- with .Values.monitoring.grafanaDashboard.title }} + title: {{ . }} + {{- end }} + {{- end }} + {{- if .Values.monitoring.prometheusServiceMonitor.enabled }} + prometheusServiceMonitor: + enabled: true + {{- with .Values.monitoring.prometheusServiceMonitor.labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end }} + namespace: {{ .Values.monitoring.prometheusServiceMonitor.namespace | default .Release.Namespace }} + {{- end }} + {{- end }} + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 4 }} + {{- end }} + + {{- if (gt (.Values.replicas | int) 1) }} + podDisruptionBudget: + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- else if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- end }} + + # priorityClassName: "" + + replicas: {{ .Values.replicas | default 1 }} + + service: # required + type: {{ .Values.service.type | default "ClusterIP" }} + {{- if .Values.service.type | default "ClusterIP" | eq "ClusterIP" }} + port: {{ .Values.service.port | default 80 }} + metricsPort: {{ .Values.service.metricsPort | default 9131 }} + {{- else if .Values.service.type | default "ClusterIP" | eq "NodePort" }} + nodePort: {{ .Values.service.nodePort | default 30000 }} + metricsNodePort: {{ .Values.service.metricsNodePort | default 30001 }} + controllerMetricsNodePort: {{ .Values.service.controllerMetricsNodePort | default 30002 }} + {{- end }} + + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 4 }} + {{- end }} + + updateStrategy: + type: {{ .Values.updateStrategy.type | default "OnDelete" }} + {{- if .Values.updateStrategy.type | default "OnDelete" | eq "DelayedRollingUpdate" }} + delayedRollingUpdate: + delaySeconds: {{ .Values.updateStrategy.delayedRollingUpdate.delaySeconds | default 60 }} + {{- else if .Values.updateStrategy.type | default "OnDelete" | eq "RollingUpdate" }} + rollingUpdate: + partition: {{ .Values.updateStrategy.rollingUpdate.partition | default 0 }} + {{- end }} + + {{- with .Values.varnish }} + varnish: + {{- toYaml . | nindent 4 }} + {{- end }} + + vcl: # required + configMapName: {{ .Values.vcl.configMapName | required ".Values.vcl.configMapName is required." }} + entrypointFileName: {{ .Values.vcl.entrypointFileName | required ".Values.vcl.entrypointFileName is required." }} diff --git a/charts/motive-cache/values.yaml b/charts/motive-cache/values.yaml new file mode 100644 index 0000000..56dd1cb --- /dev/null +++ b/charts/motive-cache/values.yaml @@ -0,0 +1,205 @@ +# Default values for motive-cache. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + + + +# -- -------------- +# Global +# -- -------------- + + + +nameOverride: "" +fullnameOverride: "" + + + +# -- -------------- +# Varnish Cluster +# -- -------------- + + +## Pod anti-affinity can prevent the scheduler from placing service replicas on the same node. +## The default value "soft" means that the scheduler should *prefer* to not schedule two replica pods onto the same node but no guarantee is provided. +## The value "hard" means that the scheduler is *required* to not schedule two replica pods onto the same node. +## The value "" will disable pod anti-affinity so that no anti-affinity rules will be configured. +## +podAntiAffinity: "hard" + +## If anti-affinity is enabled sets the topologyKey to use for anti-affinity. +## This can be changed to, for example, failure-domain.beta.kubernetes.io/zone +## +podAntiAffinityTopologyKey: kubernetes.io/hostname + +# -- Similar to the nodeSelector, but slightly different: +# https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity +affinity: {} +# nodeAffinity: +# requiredDuringSchedulingIgnoredDuringExecution: +# nodeSelectorTerms: +# - matchExpressions: +# - key: kubernetes.io/e2e-az-name +# operator: In +# values: +# - e2e-az1 +# - e2e-az2 + +backend: + # -- Namespace(s) to look for backend pods. By default - namespace the VarnishCluster is deployed to. + namespaces: [] + + # -- Include (false, by default) or exclude (true) backend pods from the VCL (.Backends template var). + # Alters .Backends template variable based on Kubernetes health checks (by default not ready pods are also included in VCL) instead of Varnish health probes. + onlyReady: false + + # -- The port of the backend pods being cached by Varnish. Can be port name or port number. + port: "backend-port" + + # -- The selector used to identify the backend Pods. + selector: {} + + # -- Controls Varnish backend topology aware routing which can assign weights to backends according to their geographical location. + zoneBalancing: + # -- Varnish backend zone-balancing type. Accepted values: disabled, auto, thresholds + type: "disabled" + # -- Array of thresholds objects to determine condition and respective weights to be assigned to backends: threshold, local - local backend weight, remote - remote backend weight + thresholds: [] + +# -- The minimum enabled logging level. Allowed values: debug, info, warn, error, dpanic, panic, fatal. +logLevel: "info" + +# -- Format of the logs. Can be json and console. +logFormat: "json" + +# -- The operator monitoring configuration object +monitoring: + # -- A dashboard that can be installed along with the operator and used in grafana. Installed as a ConfigMap. + grafanaDashboard: + # -- Enable or disable the ConfigMap installation. + enabled: false + # -- Name of the Grafana datasource the dashboard should use. (required) + datasourceName: "" + # -- ConfigMap labels. Can be used to for discovery by grafana. + labels: {} + # -- Namespace that the ConfigMap with the dashboard should be installed to. Default to the namespace VarnishCluster is installed to + namespace: "" + # -- Title of the Grafana dashboard. Default: Varnish (/) + title: "" + # -- The Prometheus ServiceMonitor that is preconfigured to monitors the operator pods. + prometheusServiceMonitor: + # -- Enable or disable ServiceMontitor installation. + enabled: true + # -- ServiceMonitor labels that will be used by Prometheus instance to discover this ServiceMonitor. + labels: {} + # -- The namespace it should be installed to. Default to the namespace VarnishCluster is installed to + namespace: "" + +# -- Node selector to control where the Varnish pods should be scheduled +nodeSelector: {} + +# -- Pod Disruption Budget configuration. Can be used to tell Kubernetes how many pods are required to be up (or allowed to be down) to not cause service disruption +podDisruptionBudget: + # -- An eviction is allowed if at least minAvailable pods will still be available after the eviction, i.e. even in the absence of the evicted pod + minAvailable: 1 + # -- An eviction is allowed if at most maxUnavailable pods are unavailable after the eviction, i.e. even in absence of the evicted pod. This is a mutually exclusive setting with minAvailable + maxUnavailable: # 1 + +# -- Number of Varnish nodes +replicas: 1 + +# -- Varnish service configuration. +service: + # -- Additional annotations for the service. + annotations: {} + # -- The port number used to expose Varnish pods. + port: 80 + # -- The port that will expose the Prometheus metrics exporter. + metricsPort: 9131 + # -- The port number used to set NodePort for Varnish. Service type `NodePort should be selected. + nodePort: 30000 + # -- The port number used to set NodePort for Varnish Metrics Exporter. Service type `NodePort should be selected. + metricsNodePort: 30001 + # -- The port number used to set NodePort for Varnish Controller Metrics exporter. Service type `NodePort should be selected. + controllerMetricsNodePort: 30002 + # -- Type of the Service. Allowed values: ClusterIP; LoadBalancer; NodePort + type: ClusterIP + +# -- Configuration that defines which node taints can the pods tolerate. For example to allow Varnish pods to run on nodes that are marked (tainted) as machines dedicated for in-memory cache +tolerations: [] + +# -- Allows to control the way Varnish pods will be updated. +updateStrategy: + # -- Defines the type of the update strategy. (RollingUpdate, OnDelete, DelayedRollingUpdate) + type: OnDelete + # -- Configuration for DelayedRollingUpdate strategy + delayedRollingUpdate: + # -- Indicates the wait time between pod reloads during rolling update + delaySeconds: 60 + # -- Used to communicate parameters when type is RollingUpdate + rollingUpdate: + # -- Partition indicates the ordinal at which the StatefulSet should be partitioned. + partition: 0 + +# -- An object that defines the configuration of a particular Varnish instance being deployed +varnish: + # -- Additional Varnish daemon arguments + args: [] + # -- An object that defines the configuration of a particular Varnish controller being deployed + controller: + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 10m + memory: 64Mi + limits: + memory: 128Mi + # -- An object that defines the configuration of a particular Varnish Prometheus metrics exporter being deployed + metricsExporter: + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 10m + memory: 16Mi + limits: + memory: 32Mi + # -- Image pull policy for the Varnish container. + imagePullPolicy: IfNotPresent + # -- Resource requests and limits for Varnish container. + resources: + requests: + cpu: 20m + memory: 128Mi + limits: + memory: 192Mi + +# -- An object that defines the VCL ConfigMap configuration +vcl: + # -- Name of the ConfigMap containing the VCL configuration files + configMapName: "tmp" + # -- The name of the main VCL file + entrypointFileName: "tmp" + + +# -- -------------- +# Ingress +# -- -------------- +ingress: + internal: + enabled: false + className: "nginx-internal" + annotations: {} + # nginx.ingress.kubernetes.io/enable-opentelemetry: "true" + # nginx.ingress.kubernetes.io/load-balance: "ewma" + # nginx.ingress.kubernetes.io/use-regex: "false" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + portName: http + port: 8080 + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local \ No newline at end of file