3 Commits

Author SHA1 Message Date
413fe95b86 fix(prometheus): add init containers to download plugins
Some checks failed
Generate README / generate-parameters (push) Failing after 15s
Helm / helm-lint (push) Successful in 15s
Helm / helm-unittest (push) Successful in 7s
Markdown linter / markdown-lint (push) Successful in 8s
Release / publish-chart (push) Successful in 8s
Markdown linter / markdown-link-checker (push) Successful in 43s
The following patch extends the helm chart of additional init containers for
each plugin.
2025-09-20 16:21:40 +02:00
de8ef2b201 chore(deps): update actions/checkout to v5.0.0 2025-09-20 16:21:37 +02:00
6e38335808 feat(prometheus): add podMonitor and serviceMonitor
This patch adds Prometheus podMonitor and serviceMonitor.
2025-09-20 16:21:16 +02:00
22 changed files with 1025 additions and 57 deletions

View File

@@ -16,7 +16,7 @@ jobs:
apk update apk update
apk add git npm jq yq apk add git npm jq yq
- uses: actions/checkout@v5 - uses: actions/checkout@v5.0.0
with: with:
fetch-depth: 0 fetch-depth: 0

4
.gitignore vendored
View File

@@ -1,6 +1,6 @@
charts charts
node_modules node_modules
target target
values2.yml values[0-9].yml
values2.yaml values[0-9].yaml
*.tgz *.tgz

149
README.md
View File

@@ -122,14 +122,15 @@ deployment:
secret.reloader.stakater.com/reload: "reposilite-tls" secret.reloader.stakater.com/reload: "reposilite-tls"
``` ```
### Network policies #### Network policies
Network policies can only take effect, when the used CNI plugin support network policies. The chart supports no custom Network policies can only take effect, when the used CNI plugin support network policies. The chart supports no custom
network policy implementation of CNI plugins. It's support only the official API resource of `networking.k8s.io/v1`. network policy implementation of CNI plugins. It's support only the official API resource of `networking.k8s.io/v1`.
The example below is an excerpt of the `values.yaml` file. The network policy contains ingress rules to allow incoming The example below is an excerpt of the `values.yaml` file. The network policy contains ingress rules to allow incoming
traffic from an ingress controller. Additionally one egress rule is defined, to allow the application outgoing access traffic from an ingress controller. Additionally two egress rules are defined. The first one to allow the application
to the internal running DNS server `core-dns`. outgoing access to the internal running DNS server `core-dns`. The second rule to be able to access the Apache Maven
Central repository via HTTPS.
> [!IMPORTANT] > [!IMPORTANT]
> Please keep in mind, that the namespace and pod selector labels can be different from environment to environment. For > Please keep in mind, that the namespace and pod selector labels can be different from environment to environment. For
@@ -156,6 +157,10 @@ networkPolicies:
protocol: TCP protocol: TCP
- port: 53 - port: 53
protocol: UDP protocol: UDP
- ports:
- port: 443
protocol: TCP
ingress: ingress:
- from: - from:
- namespaceSelector: - namespaceSelector:
@@ -169,6 +174,26 @@ networkPolicies:
protocol: TCP protocol: TCP
``` ```
### Prometheus
Reposilite is not able to expose metrics by default. Reposilite requires an additional plugin to expose the metrics via
`/metrics`. The plugin will be downloaded from Apache Maven Central, when the plugin is enabled directly or the
Prometheus feature has been enabled. The plugin is a simple JAR file, which will be stored in `/app/data/plugins`.
Furthermore, Reposilite will not expose the metrics without protection. For this reason must be defined basic auth
credentials. By default generate the helm chart a random username and password for basic auth. For debugging propose can
be set the credentials manually.
The following example enable Prometheus metrics with custom basic auth credentials:
```bash
CHART_VERSION=0.1.3
helm install --version "${CHART_VERSION}" reposilite volker.raschek/reposilite \
--set 'prometheus.metrics.enabled=true' \
--set 'prometheus.metrics.basicAuthUsername=my-username' \
--set 'prometheus.metrics.basicAuthUsername=my-password'
```
## Parameters ## Parameters
### Global ### Global
@@ -178,44 +203,56 @@ networkPolicies:
| `nameOverride` | Individual release name suffix. | `""` | | `nameOverride` | Individual release name suffix. | `""` |
| `fullnameOverride` | Override the complete release name logic. | `""` | | `fullnameOverride` | Override the complete release name logic. | `""` |
### Config
| Name | Description | Value |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `config.plugins.prometheus.enabled` | Download the Prometheus plugin via an additional init container. The Prometheus plugin will automatically enabled, when Prometheus is enabled. | `false` |
| `config.plugins.prometheus.url` | URL to download the plugin. | `https://maven.reposilite.com/releases/com/reposilite/plugin/prometheus-plugin/3.5.25/prometheus-plugin-3.5.25-all.jar` |
### Deployment ### Deployment
| Name | Description | Value | | Name | Description | Value |
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | --------------------- | | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `deployment.annotations` | Additional deployment annotations. | `{}` | | `deployment.annotations` | Additional deployment annotations. | `{}` |
| `deployment.labels` | Additional deployment labels. | `{}` | | `deployment.labels` | Additional deployment labels. | `{}` |
| `deployment.additionalContainers` | List of additional containers. | `[]` | | `deployment.additionalContainers` | List of additional containers. | `[]` |
| `deployment.affinity` | Affinity for the Reposilite deployment. | `{}` | | `deployment.affinity` | Affinity for the Reposilite deployment. | `{}` |
| `deployment.initContainers` | List of additional init containers. | `[]` | | `deployment.initContainers` | List of additional init containers. | `[]` |
| `deployment.dnsConfig` | dnsConfig of the Reposilite deployment. | `{}` | | `deployment.dnsConfig` | dnsConfig of the Reposilite deployment. | `{}` |
| `deployment.dnsPolicy` | dnsPolicy of the Reposilite deployment. | `""` | | `deployment.dnsPolicy` | dnsPolicy of the Reposilite deployment. | `""` |
| `deployment.hostname` | Individual hostname of the pod. | `""` | | `deployment.hostname` | Individual hostname of the pod. | `""` |
| `deployment.subdomain` | Individual domain of the pod. | `""` | | `deployment.subdomain` | Individual domain of the pod. | `""` |
| `deployment.hostNetwork` | Use the kernel network namespace of the host system. | `false` | | `deployment.hostNetwork` | Use the kernel network namespace of the host system. | `false` |
| `deployment.imagePullSecrets` | Secret to use for pulling the image. | `[]` | | `deployment.imagePullSecrets` | Secret to use for pulling the image. | `[]` |
| `deployment.reposilite.args` | Arguments passed to the Reposilite container. | `[]` | | `deployment.reposilite.args` | Arguments passed to the Reposilite container. | `[]` |
| `deployment.reposilite.command` | Command passed to the Reposilite container. | `[]` | | `deployment.reposilite.command` | Command passed to the Reposilite container. | `[]` |
| `deployment.reposilite.env` | List of environment variables for the Reposilite container. | | | `deployment.reposilite.env` | List of environment variables for the Reposilite container. | |
| `deployment.reposilite.envFrom` | List of environment variables mounted from configMaps or secrets for the Reposilite container. | `[]` | | `deployment.reposilite.envFrom` | List of environment variables mounted from configMaps or secrets for the Reposilite container. | `[]` |
| `deployment.reposilite.image.registry` | Image registry, eg. `docker.io`. | `docker.io` | | `deployment.reposilite.image.registry` | Image registry, eg. `docker.io`. | `docker.io` |
| `deployment.reposilite.image.repository` | Image repository, eg. `library/busybox`. | `dzikoysk/reposilite` | | `deployment.reposilite.image.repository` | Image repository, eg. `library/busybox`. | `dzikoysk/reposilite` |
| `deployment.reposilite.image.tag` | Custom image tag, eg. `0.1.0`. Defaults to `appVersion`. | `""` | | `deployment.reposilite.image.tag` | Custom image tag, eg. `0.1.0`. Defaults to `appVersion`. | `""` |
| `deployment.reposilite.image.pullPolicy` | Image pull policy. | `IfNotPresent` | | `deployment.reposilite.image.pullPolicy` | Image pull policy. | `IfNotPresent` |
| `deployment.reposilite.resources` | CPU and memory resources of the pod. | `{}` | | `deployment.reposilite.resources` | CPU and memory resources of the pod. | `{}` |
| `deployment.reposilite.securityContext` | Security context of the container of the deployment. | `{}` | | `deployment.reposilite.securityContext` | Security context of the container of the deployment. | `{}` |
| `deployment.reposilite.volumeMounts` | Additional volume mounts. | `[]` | | `deployment.reposilite.volumeMounts` | Additional volume mounts. | `[]` |
| `deployment.nodeSelector` | NodeSelector of the Reposilite deployment. | `{}` | | `deployment.nodeSelector` | NodeSelector of the Reposilite deployment. | `{}` |
| `deployment.priorityClassName` | PriorityClassName of the Reposilite deployment. | `""` | | `deployment.pluginContainer.args` | Arguments passed to the plugin container. | `["--location","--fail","--max-time","60"]` |
| `deployment.replicas` | Number of replicas for the Reposilite deployment. | `1` | | `deployment.pluginContainer.image.registry` | Image registry, eg. `docker.io`. | `docker.io` |
| `deployment.restartPolicy` | Restart policy of the Reposilite deployment. | `""` | | `deployment.pluginContainer.image.repository` | Image repository, eg. `curlimages/curl`. | `curlimages/curl` |
| `deployment.securityContext` | Security context of the Reposilite deployment. | `{}` | | `deployment.pluginContainer.image.tag` | Custom image tag, eg. `0.1.0`. | `8.15.0` |
| `deployment.strategy.type` | Strategy type - `Recreate` or `RollingUpdate`. | `RollingUpdate` | | `deployment.pluginContainer.image.pullPolicy` | Image pull policy. | `IfNotPresent` |
| `deployment.strategy.rollingUpdate.maxSurge` | The maximum number of pods that can be scheduled above the desired number of pods during a rolling update. | `1` | | `deployment.priorityClassName` | PriorityClassName of the Reposilite deployment. | `""` |
| `deployment.strategy.rollingUpdate.maxUnavailable` | The maximum number of pods that can be unavailable during a rolling update. | `1` | | `deployment.replicas` | Number of replicas for the Reposilite deployment. | `1` |
| `deployment.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod. | `60` | | `deployment.restartPolicy` | Restart policy of the Reposilite deployment. | `""` |
| `deployment.tolerations` | Tolerations of the Reposilite deployment. | `[]` | | `deployment.securityContext` | Security context of the Reposilite deployment. | `{}` |
| `deployment.topologySpreadConstraints` | TopologySpreadConstraints of the Reposilite deployment. | `[]` | | `deployment.strategy.type` | Strategy type - `Recreate` or `RollingUpdate`. | `RollingUpdate` |
| `deployment.volumes` | Additional volumes to mount into the pods of the reposilite deployment. | `[]` | | `deployment.strategy.rollingUpdate.maxSurge` | The maximum number of pods that can be scheduled above the desired number of pods during a rolling update. | `1` |
| `deployment.strategy.rollingUpdate.maxUnavailable` | The maximum number of pods that can be unavailable during a rolling update. | `1` |
| `deployment.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod. | `60` |
| `deployment.tolerations` | Tolerations of the Reposilite deployment. | `[]` |
| `deployment.topologySpreadConstraints` | TopologySpreadConstraints of the Reposilite deployment. | `[]` |
| `deployment.volumes` | Additional volumes to mount into the pods of the reposilite deployment. | `[]` |
### Horizontal Pod Autoscaler (HPA) ### Horizontal Pod Autoscaler (HPA)
@@ -265,6 +302,39 @@ networkPolicies:
| `persistentVolumeClaim.new.size` | Size of the persistent volume claim. | `10Gi` | | `persistentVolumeClaim.new.size` | Size of the persistent volume claim. | `10Gi` |
| `persistentVolumeClaim.new.storageClass` | Custom storage class. Left it empty to use the clusters default storage class. | `""` | | `persistentVolumeClaim.new.storageClass` | Custom storage class. Left it empty to use the clusters default storage class. | `""` |
### Prometheus
| Name | Description | Value |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `prometheus.metrics.enabled` | Enable of scraping metrics by Prometheus. | `false` |
| `prometheus.metrics.basicAuthUsername` | Username for basic auth. The username and password is required by reposilite to expose metrics. Default: random alpha numeric string. | `""` |
| `prometheus.metrics.basicAuthPassword` | Password for basic auth. The username and password is required by reposilite to expose metrics. Default random alpha numeric string. | `""` |
| `prometheus.metrics.podMonitor.enabled` | Enable creation of a podMonitor. Excludes the existence of a serviceMonitor resource. | `false` |
| `prometheus.metrics.podMonitor.annotations` | Additional podMonitor annotations. | `{}` |
| `prometheus.metrics.podMonitor.enableHttp2` | Enable HTTP2. | `false` |
| `prometheus.metrics.podMonitor.followRedirects` | FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. | `false` |
| `prometheus.metrics.podMonitor.honorLabels` | Honor labels. | `false` |
| `prometheus.metrics.podMonitor.labels` | Additional podMonitor labels. | `{}` |
| `prometheus.metrics.podMonitor.interval` | Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used. | `60s` |
| `prometheus.metrics.podMonitor.path` | HTTP path of the Reposilite pod for scraping Prometheus metrics. | `/metrics` |
| `prometheus.metrics.podMonitor.port` | HTTP port of the Reposilite pod for scraping Prometheus metrics. | `http` |
| `prometheus.metrics.podMonitor.relabelings` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. | `[]` |
| `prometheus.metrics.podMonitor.scrapeTimeout` | Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used. | `30s` |
| `prometheus.metrics.podMonitor.scheme` | HTTP scheme to use for scraping. For example `http` or `https`. | `http` |
| `prometheus.metrics.podMonitor.tlsConfig` | TLS configuration to use when scraping the metric endpoint by Prometheus. | `{}` |
| `prometheus.metrics.serviceMonitor.enabled` | Enable creation of a serviceMonitor. Excludes the existence of a podMonitor resource. | `false` |
| `prometheus.metrics.serviceMonitor.annotations` | Additional serviceMonitor annotations. | `{}` |
| `prometheus.metrics.serviceMonitor.labels` | Additional serviceMonitor labels. | `{}` |
| `prometheus.metrics.serviceMonitor.enableHttp2` | Enable HTTP2. | `false` |
| `prometheus.metrics.serviceMonitor.followRedirects` | FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. | `false` |
| `prometheus.metrics.serviceMonitor.honorLabels` | Honor labels. | `false` |
| `prometheus.metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used. | `60s` |
| `prometheus.metrics.serviceMonitor.path` | HTTP path for scraping Prometheus metrics. | `/metrics` |
| `prometheus.metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. | `[]` |
| `prometheus.metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used. | `30s` |
| `prometheus.metrics.serviceMonitor.scheme` | HTTP scheme to use for scraping. For example `http` or `https`. | `http` |
| `prometheus.metrics.serviceMonitor.tlsConfig` | TLS configuration to use when scraping the metric endpoint by Prometheus. | `{}` |
### Service ### Service
| Name | Description | Value | | Name | Description | Value |
@@ -280,6 +350,7 @@ networkPolicies:
| `service.loadBalancerIP` | LoadBalancer will get created with the IP specified in this field. Requires service from type `LoadBalancer`. | `""` | | `service.loadBalancerIP` | LoadBalancer will get created with the IP specified in this field. Requires service from type `LoadBalancer`. | `""` |
| `service.loadBalancerSourceRanges` | Source range filter for LoadBalancer. Requires service from type `LoadBalancer`. | `[]` | | `service.loadBalancerSourceRanges` | Source range filter for LoadBalancer. Requires service from type `LoadBalancer`. | `[]` |
| `service.port` | Port to forward the traffic to. | `8080` | | `service.port` | Port to forward the traffic to. | `8080` |
| `service.scheme` | Name of the service port. This name is also used as scheme / port name of the service monitor resource. | `http` |
| `service.sessionAffinity` | Supports `ClientIP` and `None`. Enable client IP based session affinity via `ClientIP`. | `None` | | `service.sessionAffinity` | Supports `ClientIP` and `None`. Enable client IP based session affinity via `ClientIP`. | `None` |
| `service.sessionAffinityConfig` | Contains the configuration of the session affinity. | `{}` | | `service.sessionAffinityConfig` | Contains the configuration of the session affinity. | `{}` |
| `service.type` | Kubernetes service type for the traffic. | `ClusterIP` | | `service.type` | Kubernetes service type for the traffic. | `ClusterIP` |

View File

@@ -17,11 +17,32 @@
{{- if .Values.persistentVolumeClaim.enabled }} {{- if .Values.persistentVolumeClaim.enabled }}
{{- $env = concat $env (list (dict "name" "REPOSILITE_DATA" "value" .Values.persistentVolumeClaim.path )) }} {{- $env = concat $env (list (dict "name" "REPOSILITE_DATA" "value" .Values.persistentVolumeClaim.path )) }}
{{- end }} {{- end }}
{{- if eq (include "reposilite.podMonitor.enabled" $) "true" }}
{{- $env = concat $env (list (dict "name" "REPOSILITE_PROMETHEUS_PATH" "value" .Values.prometheus.metrics.podMonitor.path )) }}
{{- end }}
{{- if eq (include "reposilite.serviceMonitor.enabled" $) "true" }}
{{- $env = concat $env (list (dict "name" "REPOSILITE_PROMETHEUS_PATH" "value" .Values.prometheus.metrics.serviceMonitor.path )) }}
{{- end }}
{{- if or (eq (include "reposilite.podMonitor.enabled" $ ) "true") (eq (include "reposilite.serviceMonitor.enabled" $ ) "true") -}}
{{- $env = concat $env (list (dict "name" "REPOSILITE_PROMETHEUS_USER" "valueFrom" (dict "secretKeyRef" (dict "name" (include "reposilite.secrets.prometheusBasicAuth.name" $) "key" "username")))) }}
{{- $env = concat $env (list (dict "name" "REPOSILITE_PROMETHEUS_PASSWORD" "valueFrom" (dict "secretKeyRef" (dict "name" (include "reposilite.secrets.prometheusBasicAuth.name" $) "key" "password")))) }}
{{- end }}
{{ toYaml (dict "env" $env) }} {{ toYaml (dict "env" $env) }}
{{- end -}} {{- end -}}
{{/* image */}} {{/* image */}}
{{- define "reposilite.deployment.images.plugin.fqin" -}}
{{- $registry := .Values.deployment.pluginContainer.image.registry -}}
{{- $repository := .Values.deployment.pluginContainer.image.repository -}}
{{- $tag := default .Chart.AppVersion .Values.deployment.pluginContainer.image.tag -}}
{{- printf "%s/%s:%s" $registry $repository $tag -}}
{{- end -}}
{{- define "reposilite.deployment.images.reposilite.fqin" -}} {{- define "reposilite.deployment.images.reposilite.fqin" -}}
{{- $registry := .Values.deployment.reposilite.image.registry -}} {{- $registry := .Values.deployment.reposilite.image.registry -}}
{{- $repository := .Values.deployment.reposilite.image.repository -}} {{- $repository := .Values.deployment.reposilite.image.repository -}}
@@ -38,6 +59,34 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/* initContainers */}}
{{- define "reposilite.deployment.initContainers" -}}
{{- $initContainers := .Values.deployment.initContainers | default list -}}
{{- $pluginContainerImage := (include "reposilite.deployment.images.plugin.fqin" . ) }}
{{- $pluginContainerArgs := .Values.deployment.pluginContainer.args | default list }}
{{- $pluginContainerArgs := concat $pluginContainerArgs (list "--output-dir" "/app/data/plugins" ) }}
{{- $pluginContainerVolumeMounts := list (dict "name" "plugins" "mountPath" "/app/data/plugins") }}
{{- if eq (include "reposilite.plugins.prometheus.enabled" $) "true" }}
{{- $fileName := splitList "/" (tpl .Values.config.plugins.prometheus.url $) | last }}
{{- $individualArgs := concat $pluginContainerArgs (list "--output" $fileName (tpl .Values.config.plugins.prometheus.url $)) }}
{{- $initContainers = concat $initContainers (list (dict "args" $individualArgs "name" "download-prometheus-plugin" "image" $pluginContainerImage "volumeMounts" $pluginContainerVolumeMounts)) }}
{{- end }}
{{ toYaml (dict "initContainers" $initContainers) }}
{{- end }}
{{/* plugins */}}
{{- define "reposilite.plugins.prometheus.enabled" -}}
{{- if or .Values.config.plugins.prometheus.enabled .Values.prometheus.metrics.enabled -}}
true
{{- else -}}
false
{{- end -}}
{{- end }}
{{/* serviceAccount */}} {{/* serviceAccount */}}
{{- define "reposilite.deployment.serviceAccount" -}} {{- define "reposilite.deployment.serviceAccount" -}}
@@ -55,6 +104,11 @@
{{- if .Values.persistentVolumeClaim.enabled }} {{- if .Values.persistentVolumeClaim.enabled }}
{{- $volumeMounts = concat $volumeMounts (list (dict "name" "data" "mountPath" .Values.persistentVolumeClaim.path )) }} {{- $volumeMounts = concat $volumeMounts (list (dict "name" "data" "mountPath" .Values.persistentVolumeClaim.path )) }}
{{- end }} {{- end }}
{{- if eq (include "reposilite.plugins.prometheus.enabled" $) "true" }}
{{- $volumeMounts = concat $volumeMounts (list (dict "name" "plugins" "mountPath" "/app/data/plugins")) }}
{{- end }}
{{ toYaml (dict "volumeMounts" $volumeMounts) }} {{ toYaml (dict "volumeMounts" $volumeMounts) }}
{{- end -}} {{- end -}}
@@ -71,6 +125,10 @@
{{- $volumes = concat $volumes (list (dict "name" "data" "persistentVolumeClaim" (dict "claimName" $persistentVolumeClaimName))) }} {{- $volumes = concat $volumes (list (dict "name" "data" "persistentVolumeClaim" (dict "claimName" $persistentVolumeClaimName))) }}
{{- end }} {{- end }}
{{- if eq (include "reposilite.plugins.prometheus.enabled" $) "true" }}
{{- $volumes = concat $volumes (list (dict "name" "plugins" "emptyDir" dict)) }}
{{- end }}
{{ toYaml (dict "volumes" $volumes) }} {{ toYaml (dict "volumes" $volumes) }}
{{- end -}} {{- end -}}

View File

@@ -4,6 +4,9 @@
{{- define "reposilite.pod.annotations" -}} {{- define "reposilite.pod.annotations" -}}
{{ include "reposilite.annotations" . }} {{ include "reposilite.annotations" . }}
{{- if .Values.prometheus.metrics.enabled -}}
{{- printf "checksum/secret-%s: %s" (include "reposilite.secrets.prometheusBasicAuth.name" $) (include (print $.Template.BasePath "/secretPrometheusBasicAuth.yaml") . | sha256sum) }}
{{- end -}}
{{- end }} {{- end }}
{{/* labels */}} {{/* labels */}}

View File

@@ -0,0 +1,27 @@
{{/* vim: set filetype=mustache: */}}
{{/* annotations */}}
{{- define "reposilite.podMonitor.annotations" -}}
{{ include "reposilite.annotations" . }}
{{- if .Values.prometheus.metrics.podMonitor.annotations }}
{{ toYaml .Values.prometheus.metrics.podMonitor.annotations }}
{{- end }}
{{- end }}
{{/* enabled */}}
{{- define "reposilite.podMonitor.enabled" -}}
{{- if and .Values.prometheus.metrics.enabled .Values.prometheus.metrics.podMonitor.enabled (not .Values.prometheus.metrics.serviceMonitor.enabled) -}}
true
{{- else -}}
false
{{- end -}}
{{- end }}
{{/* labels */}}
{{- define "reposilite.podMonitor.labels" -}}
{{ include "reposilite.labels" . }}
{{- if .Values.prometheus.metrics.podMonitor.labels }}
{{ toYaml .Values.prometheus.metrics.podMonitor.labels }}
{{- end }}
{{- end }}

19
templates/_secrets.tpl Normal file
View File

@@ -0,0 +1,19 @@
{{/* vim: set filetype=mustache: */}}
{{/* annotations */}}
{{- define "reposilite.secrets.prometheusBasicAuth.annotations" -}}
{{ include "reposilite.annotations" . }}
{{- end }}
{{/* labels */}}
{{- define "reposilite.secrets.prometheusBasicAuth.labels" -}}
{{ include "reposilite.labels" . }}
{{- end }}
{{/* names */}}
{{- define "reposilite.secrets.prometheusBasicAuth.name" -}}
{{ include "reposilite.fullname" . }}-basic-auth-credentials
{{- end -}}

View File

@@ -0,0 +1,35 @@
{{/* vim: set filetype=mustache: */}}
{{/* annotations */}}
{{- define "reposilite.serviceMonitor.annotations" -}}
{{ include "reposilite.annotations" . }}
{{- if .Values.prometheus.metrics.serviceMonitor.annotations }}
{{ toYaml .Values.prometheus.metrics.serviceMonitor.annotations }}
{{- end }}
{{- end }}
{{/* enabled */}}
{{- define "reposilite.serviceMonitor.enabled" -}}
{{- if and .Values.prometheus.metrics.enabled (not .Values.prometheus.metrics.podMonitor.enabled) .Values.prometheus.metrics.serviceMonitor.enabled .Values.service.enabled -}}
true
{{- else -}}
false
{{- end -}}
{{- end }}
{{/* labels */}}
{{- define "reposilite.serviceMonitor.labels" -}}
{{ include "reposilite.labels" . }}
{{- if .Values.prometheus.metrics.serviceMonitor.labels }}
{{ toYaml .Values.prometheus.metrics.serviceMonitor.labels }}
{{- end }}
{{- end }}
{{- define "reposilite.serviceMonitor.selectorLabels" -}}
{{ include "reposilite.selectorLabels" . }}
{{/* Add label to select the correct service via `selector.matchLabels` of the serviceMonitor resource. */}}
app.kubernetes.io/service-name: {{ required "The scheme of the serviceMonitor is not defined!" .Values.service.scheme }}
{{- end }}

View File

@@ -16,6 +16,8 @@
{{- if .Values.service.labels }} {{- if .Values.service.labels }}
{{ toYaml .Values.service.labels }} {{ toYaml .Values.service.labels }}
{{- end }} {{- end }}
{{/* Add label to select the correct service via `selector.matchLabels` of the serviceMonitor resource. */}}
app.kubernetes.io/service-name: {{ required "The scheme of the serviceMonitor is not defined!" .Values.service.scheme }}
{{- end }} {{- end }}
{{/* names */}} {{/* names */}}

View File

@@ -68,7 +68,10 @@ spec:
name: reposilite name: reposilite
ports: ports:
- name: http - name: http
containerPort: {{ .Values.service.port }} containerPort: 8080
protocol: TCP
- name: https
containerPort: 8443
protocol: TCP protocol: TCP
readinessProbe: readinessProbe:
tcpSocket: tcpSocket:
@@ -106,6 +109,11 @@ spec:
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- $initContainers := (include "reposilite.deployment.initContainers" . | fromYaml) }}
{{- if and (hasKey $initContainers "initContainers") (gt (len $initContainers.initContainers) 0) }}
initContainers:
{{- toYaml $initContainers.initContainers | nindent 6 }}
{{- end }}
{{- with .Values.deployment.nodeSelector }} {{- with .Values.deployment.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

47
templates/podMonitor.yaml Normal file
View File

@@ -0,0 +1,47 @@
{{- if eq (include "reposilite.podMonitor.enabled" $) "true" }}
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
{{- with (include "reposilite.podMonitor.annotations" . | fromYaml) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (include "reposilite.podMonitor.labels" . | fromYaml) }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "reposilite.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
podMetricsEndpoints:
- basicAuth:
password:
key: password
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
username:
key: username
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
enableHttp2: {{ required "The enableHttp2 option of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.enableHttp2 }}
followRedirects: {{ required "The followRedirects option of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.followRedirects }}
honorLabels: {{ required "The honorLabels option of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.honorLabels }}
interval: {{ required "The scrape interval of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.interval }}
path: {{ required "The metric path of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.path }}
port: {{ required "The metric port of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.port | quote }}
{{- with .Values.prometheus.metrics.podMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
scrapeTimeout: {{ required "The scrape timeout of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.scrapeTimeout }}
scheme: {{ required "The scheme of the podMonitor is not defined!" .Values.prometheus.metrics.podMonitor.scheme }}
{{- with .Values.prometheus.metrics.podMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "reposilite.pod.selectorLabels" . | nindent 6 }}
{{- end }}

View File

@@ -0,0 +1,19 @@
{{- if .Values.prometheus.metrics.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
{{- with (include "reposilite.secrets.prometheusBasicAuth.annotations" . | fromYaml) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (include "reposilite.secrets.prometheusBasicAuth.labels" . | fromYaml) }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
namespace: {{ .Release.Namespace }}
stringData:
password: {{ default (randAlphaNum 16) .Values.prometheus.metrics.basicAuthPassword }}
username: {{ default (randAlphaNum 16) .Values.prometheus.metrics.basicAuthUsername }}
{{- end }}

View File

@@ -43,7 +43,7 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
ports: ports:
- name: http - name: {{ required "No service name defined. Either 'http' or 'https' is allowed!" .Values.service.scheme }}
protocol: TCP protocol: TCP
port: {{ required "No service port defined!" .Values.service.port }} port: {{ required "No service port defined!" .Values.service.port }}
selector: selector:

View File

@@ -0,0 +1,47 @@
{{- if eq (include "reposilite.serviceMonitor.enabled" $) "true" }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- with (include "reposilite.serviceMonitor.annotations" . | fromYaml) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (include "reposilite.serviceMonitor.labels" . | fromYaml) }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "reposilite.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
endpoints:
- basicAuth:
password:
key: password
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
username:
key: username
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
enableHttp2: {{ required "The enableHttp2 option of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.enableHttp2 }}
followRedirects: {{ required "The followRedirects option of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.followRedirects }}
honorLabels: {{ required "The honorLabels option of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.honorLabels }}
interval: {{ required "The scrape interval of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.interval }}
path: {{ required "The metric path of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.path }}
port: {{ required "The port of the serviceMonitor is not defined!" .Values.service.scheme }}
{{- with .Values.prometheus.metrics.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
scrapeTimeout: {{ required "The scrape timeout of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scrapeTimeout }}
scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme }}
{{- with .Values.prometheus.metrics.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "reposilite.serviceMonitor.selectorLabels" . | nindent 6 }}
{{- end }}

View File

@@ -0,0 +1,42 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Test reposilite plugins
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/deployment.yaml
- templates/secretPrometheusBasicAuth.yaml
tests:
- it: Test init containers for prometheus
set:
config.plugins.prometheus.enabled: true
config.plugins.prometheus.url: "https://reposilite.com/plugins/prometheus.jar"
deployment.pluginContainer.image.tag: 0.1.0
asserts:
- contains:
path: spec.template.spec.initContainers
content:
args:
- --location
- --fail
- --max-time
- "60"
- --output-dir
- /app/data/plugins
- --output
- prometheus.jar
- https://reposilite.com/plugins/prometheus.jar
name: download-prometheus-plugin
image: docker.io/curlimages/curl:0.1.0
volumeMounts:
- mountPath: /app/data/plugins
name: plugins
template: templates/deployment.yaml
- contains:
path: spec.template.spec.volumes
content:
name: plugins
emptyDir: {}
template: templates/deployment.yaml

View File

@@ -7,19 +7,23 @@ release:
namespace: testing namespace: testing
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
- templates/secretPrometheusBasicAuth.yaml
tests: tests:
- it: Rendering default - it: Rendering default
set: {} set: {}
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
template: templates/deployment.yaml
- containsDocument: - containsDocument:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
name: reposilite-unittest name: reposilite-unittest
namespace: testing namespace: testing
template: templates/deployment.yaml
- notExists: - notExists:
path: metadata.annotations path: metadata.annotations
template: templates/deployment.yaml
- equal: - equal:
path: metadata.labels path: metadata.labels
value: value:
@@ -28,14 +32,17 @@ tests:
app.kubernetes.io/name: reposilite app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0 app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0 helm.sh/chart: reposilite-0.1.0
template: templates/deployment.yaml
- equal: - equal:
path: spec.replicas path: spec.replicas
value: 1 value: 1
template: templates/deployment.yaml
- isSubset: - isSubset:
path: spec.selector.matchLabels path: spec.selector.matchLabels
content: content:
app.kubernetes.io/instance: reposilite-unittest app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/name: reposilite app.kubernetes.io/name: reposilite
template: templates/deployment.yaml
- equal: - equal:
path: spec.strategy path: spec.strategy
value: value:
@@ -43,9 +50,10 @@ tests:
rollingUpdate: rollingUpdate:
maxSurge: 1 maxSurge: 1
maxUnavailable: 1 maxUnavailable: 1
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.metadata.annotations path: spec.template.metadata.annotations
value: sadsdf template: templates/deployment.yaml
- equal: - equal:
path: spec.template.metadata.labels path: spec.template.metadata.labels
value: value:
@@ -54,25 +62,33 @@ tests:
app.kubernetes.io/name: reposilite app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0 app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0 helm.sh/chart: reposilite-0.1.0
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.affinity path: spec.template.spec.affinity
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.containers[0].args path: spec.template.spec.containers[0].args
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.containers[0].command path: spec.template.spec.containers[0].command
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: JAVA_OPTS name: JAVA_OPTS
value: "-Xmx64M" value: "-Xmx64M"
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.containers[0].envFrom path: spec.template.spec.containers[0].envFrom
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: docker.io/dzikoysk/reposilite:0.1.0 value: docker.io/dzikoysk/reposilite:0.1.0
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.containers[0].imagePullPolicy path: spec.template.spec.containers[0].imagePullPolicy
value: IfNotPresent value: IfNotPresent
template: templates/deployment.yaml
- isSubset: - isSubset:
path: spec.template.spec.containers[0].livenessProbe path: spec.template.spec.containers[0].livenessProbe
content: content:
@@ -83,15 +99,18 @@ tests:
periodSeconds: 60 periodSeconds: 60
successThreshold: 1 successThreshold: 1
timeoutSeconds: 3 timeoutSeconds: 3
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.containers[0].name path: spec.template.spec.containers[0].name
value: reposilite value: reposilite
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.containers[0].ports path: spec.template.spec.containers[0].ports
content: content:
name: http name: http
containerPort: 8080 containerPort: 8080
protocol: TCP protocol: TCP
template: templates/deployment.yaml
- isSubset: - isSubset:
path: spec.template.spec.containers[0].readinessProbe path: spec.template.spec.containers[0].readinessProbe
content: content:
@@ -102,42 +121,60 @@ tests:
periodSeconds: 15 periodSeconds: 15
successThreshold: 1 successThreshold: 1
timeoutSeconds: 3 timeoutSeconds: 3
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.containers[0].resources path: spec.template.spec.containers[0].resources
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.containers[0].securityContext path: spec.template.spec.containers[0].securityContext
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.containers[0].volumeMounts path: spec.template.spec.containers[0].volumeMounts
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.dnsConfig path: spec.template.spec.dnsConfig
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.dnsPolicy path: spec.template.spec.dnsPolicy
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.hostname path: spec.template.spec.hostname
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.hostNetwork path: spec.template.spec.hostNetwork
value: false value: false
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.imagePullSecrets path: spec.template.spec.imagePullSecrets
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.initContainers path: spec.template.spec.initContainers
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.nodeSelector path: spec.template.spec.nodeSelector
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.priorityClassName path: spec.template.spec.priorityClassName
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.restartPolicy path: spec.template.spec.restartPolicy
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.subdomain path: spec.template.spec.subdomain
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.terminationGracePeriodSeconds path: spec.template.spec.terminationGracePeriodSeconds
value: 60 value: 60
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.tolerations path: spec.template.spec.tolerations
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.topologySpreadConstraints path: spec.template.spec.topologySpreadConstraints
template: templates/deployment.yaml
- notExists: - notExists:
path: spec.template.spec.volumes path: spec.template.spec.volumes
template: templates/deployment.yaml
- it: Test custom replicas - it: Test custom replicas
set: set:
@@ -146,6 +183,7 @@ tests:
- equal: - equal:
path: spec.replicas path: spec.replicas
value: 3 value: 3
template: templates/deployment.yaml
- it: Test custom strategy - it: Test custom strategy
set: set:
@@ -162,6 +200,7 @@ tests:
rollingUpdate: rollingUpdate:
maxSurge: 10 maxSurge: 10
maxUnavailable: 5 maxUnavailable: 5
template: templates/deployment.yaml
- it: Test custom affinity - it: Test custom affinity
set: set:
@@ -188,6 +227,7 @@ tests:
values: values:
- antarctica-east1 - antarctica-east1
- antarctica-west1 - antarctica-west1
template: templates/deployment.yaml
- it: Test additional arguments - it: Test additional arguments
set: set:
@@ -200,6 +240,7 @@ tests:
value: value:
- --foo=bar - --foo=bar
- --bar=foo - --bar=foo
template: templates/deployment.yaml
- it: Test additional commands - it: Test additional commands
set: set:
@@ -210,6 +251,7 @@ tests:
path: spec.template.spec.containers[0].command path: spec.template.spec.containers[0].command
value: value:
- /bin/bash - /bin/bash
template: templates/deployment.yaml
- it: Test custom imageRegistry and imageRepository - it: Test custom imageRegistry and imageRepository
set: set:
@@ -220,6 +262,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.containers[0].image
value: registry.example.local/path/special/reposilite:2.0.0 value: registry.example.local/path/special/reposilite:2.0.0
template: templates/deployment.yaml
- it: Test custom imagePullPolicy - it: Test custom imagePullPolicy
set: set:
@@ -228,17 +271,7 @@ tests:
- equal: - equal:
path: spec.template.spec.containers[0].imagePullPolicy path: spec.template.spec.containers[0].imagePullPolicy
value: Always value: Always
template: templates/deployment.yaml
- it: Test custom port
set:
service.port: 8443
asserts:
- contains:
path: spec.template.spec.containers[0].ports
content:
name: http
containerPort: 8443
protocol: TCP
- it: Test custom resources - it: Test custom resources
set: set:
@@ -259,6 +292,7 @@ tests:
requests: requests:
cpu: 25m cpu: 25m
memory: 100MB memory: 100MB
template: templates/deployment.yaml
- it: Test custom securityContext - it: Test custom securityContext
set: set:
@@ -285,6 +319,7 @@ tests:
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
runAsNonRoot: true runAsNonRoot: true
runAsUser: 1000 runAsUser: 1000
template: templates/deployment.yaml
- it: Test custom volumeMounts - it: Test custom volumeMounts
set: set:
@@ -297,6 +332,7 @@ tests:
content: content:
name: data name: data
mountPath: /usr/lib/data mountPath: /usr/lib/data
template: templates/deployment.yaml
- it: Test dnsConfig - it: Test dnsConfig
set: set:
@@ -311,6 +347,7 @@ tests:
nameservers: nameservers:
- "8.8.8.8" - "8.8.8.8"
- "8.8.4.4" - "8.8.4.4"
template: templates/deployment.yaml
- it: Test dnsPolicy - it: Test dnsPolicy
set: set:
@@ -319,6 +356,7 @@ tests:
- equal: - equal:
path: spec.template.spec.dnsPolicy path: spec.template.spec.dnsPolicy
value: ClusterFirst value: ClusterFirst
template: templates/deployment.yaml
- it: Test hostNetwork, hostname, subdomain - it: Test hostNetwork, hostname, subdomain
set: set:
@@ -329,12 +367,15 @@ tests:
- equal: - equal:
path: spec.template.spec.hostNetwork path: spec.template.spec.hostNetwork
value: true value: true
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.hostname path: spec.template.spec.hostname
value: pg-exporter value: pg-exporter
template: templates/deployment.yaml
- equal: - equal:
path: spec.template.spec.subdomain path: spec.template.spec.subdomain
value: exporters.internal value: exporters.internal
template: templates/deployment.yaml
- it: Test imagePullSecrets - it: Test imagePullSecrets
set: set:
@@ -347,6 +388,20 @@ tests:
value: value:
- name: my-pull-secret - name: my-pull-secret
- name: my-special-secret - name: my-special-secret
template: templates/deployment.yaml
- it: Test initContainers
set:
deployment.initContainers:
- name: busybox
image: docker.io/library/busybox:latest
asserts:
- contains:
path: spec.template.spec.initContainers
content:
name: busybox
image: docker.io/library/busybox:latest
template: templates/deployment.yaml
- it: Test nodeSelector - it: Test nodeSelector
set: set:
@@ -357,6 +412,7 @@ tests:
path: spec.template.spec.nodeSelector path: spec.template.spec.nodeSelector
value: value:
foo: bar foo: bar
template: templates/deployment.yaml
- it: Test priorityClassName - it: Test priorityClassName
set: set:
@@ -365,6 +421,7 @@ tests:
- equal: - equal:
path: spec.template.spec.priorityClassName path: spec.template.spec.priorityClassName
value: my-priority value: my-priority
template: templates/deployment.yaml
- it: Test restartPolicy - it: Test restartPolicy
set: set:
@@ -373,6 +430,7 @@ tests:
- equal: - equal:
path: spec.template.spec.restartPolicy path: spec.template.spec.restartPolicy
value: Always value: Always
template: templates/deployment.yaml
- it: Test custom securityContext - it: Test custom securityContext
set: set:
@@ -389,6 +447,7 @@ tests:
runAsNonRoot: true runAsNonRoot: true
runAsUser: 1000 runAsUser: 1000
runAsGroup: 1000 runAsGroup: 1000
template: templates/deployment.yaml
- it: Test terminationGracePeriodSeconds - it: Test terminationGracePeriodSeconds
set: set:
@@ -397,6 +456,7 @@ tests:
- equal: - equal:
path: spec.template.spec.terminationGracePeriodSeconds path: spec.template.spec.terminationGracePeriodSeconds
value: 120 value: 120
template: templates/deployment.yaml
- it: Test tolerations - it: Test tolerations
set: set:
@@ -413,6 +473,7 @@ tests:
operator: Equal operator: Equal
value: ssd value: ssd
effect: NoSchedule effect: NoSchedule
template: templates/deployment.yaml
- it: Test topologySpreadConstraints - it: Test topologySpreadConstraints
set: set:
@@ -431,6 +492,7 @@ tests:
labelSelector: labelSelector:
matchLabels: matchLabels:
app.kubernetes.io/instance: reposilite app.kubernetes.io/instance: reposilite
template: templates/deployment.yaml
- it: Test additional volumes - it: Test additional volumes
set: set:
@@ -445,3 +507,4 @@ tests:
- name: data - name: data
hostPath: hostPath:
path: /usr/lib/data path: /usr/lib/data
template: templates/deployment.yaml

View File

@@ -7,6 +7,7 @@ release:
namespace: testing namespace: testing
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
- templates/secretPrometheusBasicAuth.yaml
tests: tests:
- it: Rendering default volumes and volumeMounts with persistent volume claim - it: Rendering default volumes and volumeMounts with persistent volume claim
set: set:
@@ -17,17 +18,20 @@ tests:
content: content:
name: REPOSILITE_DATA name: REPOSILITE_DATA
value: /app/data value: /app/data
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.containers[0].volumeMounts path: spec.template.spec.containers[0].volumeMounts
content: content:
name: data name: data
mountPath: /app/data mountPath: /app/data
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.volumes path: spec.template.spec.volumes
content: content:
name: data name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: reposilite-unittest claimName: reposilite-unittest
template: templates/deployment.yaml
- it: Rendering custom volumes and volumeMounts with persistent volume claim - it: Rendering custom volumes and volumeMounts with persistent volume claim
set: set:
@@ -39,17 +43,20 @@ tests:
content: content:
name: REPOSILITE_DATA name: REPOSILITE_DATA
value: /usr/lib/reposilite/data value: /usr/lib/reposilite/data
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.containers[0].volumeMounts path: spec.template.spec.containers[0].volumeMounts
content: content:
name: data name: data
mountPath: /usr/lib/reposilite/data mountPath: /usr/lib/reposilite/data
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.volumes path: spec.template.spec.volumes
content: content:
name: data name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: reposilite-unittest claimName: reposilite-unittest
template: templates/deployment.yaml
- it: Rendering custom volumes and volumeMounts with persistent volume claim - it: Rendering custom volumes and volumeMounts with persistent volume claim
set: set:
@@ -62,14 +69,17 @@ tests:
content: content:
name: REPOSILITE_DATA name: REPOSILITE_DATA
value: /app/data value: /app/data
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.containers[0].volumeMounts path: spec.template.spec.containers[0].volumeMounts
content: content:
name: data name: data
mountPath: /app/data mountPath: /app/data
template: templates/deployment.yaml
- contains: - contains:
path: spec.template.spec.volumes path: spec.template.spec.volumes
content: content:
name: data name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: my-custom-pvc claimName: my-custom-pvc
template: templates/deployment.yaml

View File

@@ -0,0 +1,37 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Add prometheus basic auth variables
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/deployment.yaml
- templates/secretPrometheusBasicAuth.yaml
tests:
- it: Rendering default environment variables with enabled prometheus metrics podMonitor
set:
prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true
asserts:
- exists:
path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials
template: templates/deployment.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: REPOSILITE_PROMETHEUS_PASSWORD
valueFrom:
secretKeyRef:
name: reposilite-unittest-basic-auth-credentials
key: password
template: templates/deployment.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: REPOSILITE_PROMETHEUS_USER
valueFrom:
secretKeyRef:
name: reposilite-unittest-basic-auth-credentials
key: username
template: templates/deployment.yaml

View File

@@ -0,0 +1,179 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: PodMonitor template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/podMonitor.yaml
tests:
- it: Skip podMonitor when metrics are disabled.
set:
prometheus.metrics.enabled: false
prometheus.metrics.podMonitor.enabled: true
prometheus.metrics.serviceMonitor.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Skip podMonitor when podMonitor is disabled.
set:
prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Skip podMonitor when both monitor types are enabled.
set:
prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true
prometheus.metrics.serviceMonitor.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Rendering podMonitor with default values - enabled manually.
set:
prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- isSubset:
path: spec.podMetricsEndpoints[0].basicAuth
content:
password:
key: password
name: reposilite-unittest-basic-auth-credentials
username:
key: username
name: reposilite-unittest-basic-auth-credentials
- equal:
path: spec.podMetricsEndpoints[0].enableHttp2
value: false
- equal:
path: spec.podMetricsEndpoints[0].followRedirects
value: false
- equal:
path: spec.podMetricsEndpoints[0].honorLabels
value: false
- equal:
path: spec.podMetricsEndpoints[0].interval
value: 60s
- equal:
path: spec.podMetricsEndpoints[0].path
value: /metrics
- equal:
path: spec.podMetricsEndpoints[0].port
value: http
- notExists:
path: spec.podMetricsEndpoints[0].relabelings
- equal:
path: spec.podMetricsEndpoints[0].scrapeTimeout
value: 30s
- equal:
path: spec.podMetricsEndpoints[0].scheme
value: http
- contains:
path: spec.namespaceSelector.matchNames
content:
testing
- equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/name: reposilite
- it: Render podMonitor with custom annotations and labels.
set:
prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true
prometheus.metrics.podMonitor.annotations:
foo: bar
prometheus.metrics.podMonitor.labels:
bar: foo
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
bar: foo
helm.sh/chart: reposilite-0.1.0
- it: Change defaults
set:
prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true
prometheus.metrics.podMonitor.enableHttp2: false
prometheus.metrics.podMonitor.followRedirects: true
prometheus.metrics.podMonitor.honorLabels: true
prometheus.metrics.podMonitor.interval: "180s"
prometheus.metrics.podMonitor.path: "/my-metrics"
prometheus.metrics.podMonitor.port: "8443"
prometheus.metrics.podMonitor.relabelings:
- sourceLabels: [ container ]
separator: ";"
regex: "app"
replacement: "$1"
action: "drop"
prometheus.metrics.podMonitor.scheme: https
prometheus.metrics.podMonitor.scrapeTimeout: "5s"
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.podMetricsEndpoints[0].enableHttp2
value: false
- equal:
path: spec.podMetricsEndpoints[0].followRedirects
value: true
- equal:
path: spec.podMetricsEndpoints[0].honorLabels
value: true
- equal:
path: spec.podMetricsEndpoints[0].interval
value: 180s
- equal:
path: spec.podMetricsEndpoints[0].path
value: /my-metrics
- equal:
path: spec.podMetricsEndpoints[0].port
value: "8443"
- contains:
path: spec.podMetricsEndpoints[0].relabelings
content:
sourceLabels: [ container ]
separator: ";"
regex: "app"
replacement: "$1"
action: "drop"
- equal:
path: spec.podMetricsEndpoints[0].scrapeTimeout
value: 5s
- equal:
path: spec.podMetricsEndpoints[0].scheme
value: https

View File

@@ -0,0 +1,181 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: ServiceMonitor template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/serviceMonitor.yaml
tests:
- it: Skip serviceMonitor when service is disabled.
set:
prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: true
service.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Skip serviceMonitor when metrics are disabled.
set:
prometheus.metrics.enabled: false
prometheus.metrics.serviceMonitor.enabled: true
services.http.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Skip serviceMonitor when serviceMonitor is disabled.
set:
prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: false
services.http.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Rendering serviceMonitor with default values - enabled manually.
set:
prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- isSubset:
path: spec.endpoints[0].basicAuth
content:
password:
key: password
name: reposilite-unittest-basic-auth-credentials
username:
key: username
name: reposilite-unittest-basic-auth-credentials
- equal:
path: spec.endpoints[0].enableHttp2
value: false
- equal:
path: spec.endpoints[0].followRedirects
value: false
- equal:
path: spec.endpoints[0].honorLabels
value: false
- equal:
path: spec.endpoints[0].interval
value: 60s
- equal:
path: spec.endpoints[0].path
value: /metrics
- notExists:
path: spec.endpoints[0].relabelings
- equal:
path: spec.endpoints[0].scrapeTimeout
value: 30s
- equal:
path: spec.endpoints[0].scheme
value: http
- equal:
path: spec.endpoints[0].port
value: http
- contains:
path: spec.namespaceSelector.matchNames
content:
testing
- equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/name: reposilite
app.kubernetes.io/service-name: http
- it: Render serviceMonitor with custom annotations and labels.
set:
prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: true
prometheus.metrics.serviceMonitor.annotations:
foo: bar
prometheus.metrics.serviceMonitor.labels:
bar: foo
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
bar: foo
helm.sh/chart: reposilite-0.1.0
- it: Change defaults
set:
prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: true
prometheus.metrics.serviceMonitor.enableHttp2: false
prometheus.metrics.serviceMonitor.followRedirects: true
prometheus.metrics.serviceMonitor.honorLabels: true
prometheus.metrics.serviceMonitor.interval: "180s"
prometheus.metrics.serviceMonitor.path: "/my-metrics"
prometheus.metrics.serviceMonitor.relabelings:
- sourceLabels: [ container ]
separator: ";"
regex: "app"
replacement: "$1"
action: "drop"
prometheus.metrics.serviceMonitor.scrapeTimeout: "5s"
prometheus.metrics.serviceMonitor.scheme: "https"
service.scheme: https
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.endpoints[0].enableHttp2
value: false
- equal:
path: spec.endpoints[0].followRedirects
value: true
- equal:
path: spec.endpoints[0].honorLabels
value: true
- equal:
path: spec.endpoints[0].interval
value: 180s
- equal:
path: spec.endpoints[0].path
value: /my-metrics
- equal:
path: spec.endpoints[0].port
value: https
- contains:
path: spec.endpoints[0].relabelings
content:
sourceLabels: [ container ]
separator: ";"
regex: "app"
replacement: "$1"
action: "drop"
- equal:
path: spec.endpoints[0].scrapeTimeout
value: 5s
- equal:
path: spec.endpoints[0].scheme
value: https

View File

@@ -32,6 +32,7 @@ tests:
app.kubernetes.io/instance: reposilite-unittest app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite app.kubernetes.io/name: reposilite
app.kubernetes.io/service-name: http
app.kubernetes.io/version: 0.1.0 app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0 helm.sh/chart: reposilite-0.1.0
- notExists: - notExists:
@@ -86,6 +87,13 @@ tests:
- failedTemplate: - failedTemplate:
errorMessage: No service port defined! errorMessage: No service port defined!
- it: Require scheme.
set:
service.scheme: ""
asserts:
- failedTemplate:
errorMessage: No service scheme defined!
- it: Require sessionAffinity. - it: Require sessionAffinity.
set: set:
service.sessionAffinity: "" service.sessionAffinity: ""
@@ -106,6 +114,7 @@ tests:
foo: bar foo: bar
service.labels: service.labels:
bar: foo bar: foo
service.scheme: https
asserts: asserts:
- equal: - equal:
path: metadata.annotations path: metadata.annotations
@@ -117,6 +126,7 @@ tests:
app.kubernetes.io/instance: reposilite-unittest app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite app.kubernetes.io/name: reposilite
app.kubernetes.io/service-name: https
app.kubernetes.io/version: 0.1.0 app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0 helm.sh/chart: reposilite-0.1.0
bar: foo bar: foo
@@ -134,6 +144,7 @@ tests:
service.loadBalancerSourceRanges: service.loadBalancerSourceRanges:
- "11.12.0.0/17" - "11.12.0.0/17"
service.port: 10443 service.port: 10443
service.scheme: https
service.sessionAffinity: ClientIP service.sessionAffinity: ClientIP
service.type: LoadBalancer service.type: LoadBalancer
asserts: asserts:
@@ -161,6 +172,9 @@ tests:
path: spec.loadBalancerSourceRanges path: spec.loadBalancerSourceRanges
value: value:
- "11.12.0.0/17" - "11.12.0.0/17"
- equal:
path: spec.ports[0].name
value: https
- equal: - equal:
path: spec.ports[0].port path: spec.ports[0].port
value: 10443 value: 10443

View File

@@ -6,6 +6,17 @@
nameOverride: "" nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
## @section Config
config:
plugins:
## @param config.plugins.prometheus.enabled Download the Prometheus plugin via an additional init container. The Prometheus plugin will automatically enabled, when Prometheus is enabled.
## @param config.plugins.prometheus.url URL to download the plugin.
prometheus:
enabled: false
url: https://maven.reposilite.com/releases/com/reposilite/plugin/prometheus-plugin/{{ .Chart.AppVersion }}/prometheus-plugin-{{ .Chart.AppVersion }}-all.jar
## @section Deployment ## @section Deployment
deployment: deployment:
## @param deployment.annotations Additional deployment annotations. ## @param deployment.annotations Additional deployment annotations.
@@ -149,6 +160,24 @@ deployment:
## @param deployment.nodeSelector NodeSelector of the Reposilite deployment. ## @param deployment.nodeSelector NodeSelector of the Reposilite deployment.
nodeSelector: {} nodeSelector: {}
pluginContainer:
## @param deployment.pluginContainer.args Arguments passed to the plugin container.
args:
- "--location"
- "--fail"
- "--max-time"
- "60"
## @param deployment.pluginContainer.image.registry Image registry, eg. `docker.io`.
## @param deployment.pluginContainer.image.repository Image repository, eg. `curlimages/curl`.
## @param deployment.pluginContainer.image.tag Custom image tag, eg. `0.1.0`.
## @param deployment.pluginContainer.image.pullPolicy Image pull policy.
image:
registry: docker.io
repository: curlimages/curl
tag: "8.15.0"
pullPolicy: IfNotPresent
## @param deployment.priorityClassName PriorityClassName of the Reposilite deployment. ## @param deployment.priorityClassName PriorityClassName of the Reposilite deployment.
priorityClassName: "" priorityClassName: ""
@@ -302,6 +331,11 @@ networkPolicy:
# - port: 53 # - port: 53
# protocol: UDP # protocol: UDP
## Allow outgoing HTTP traffic. For example to download maven artifacts from Apache Maven Central or Reposlite plugins from upstream.
# - ports:
# - port: 443
# protocol: TCP
ingress: [] ingress: []
# Allow incoming HTTP traffic from prometheus. # Allow incoming HTTP traffic from prometheus.
# #
@@ -315,6 +349,8 @@ networkPolicy:
# ports: # ports:
# - port: http # - port: http
# protocol: TCP # protocol: TCP
# - port: https
# protocol: TCP
# Allow incoming HTTP traffic from ingress-nginx. # Allow incoming HTTP traffic from ingress-nginx.
# #
@@ -328,6 +364,8 @@ networkPolicy:
# ports: # ports:
# - port: http # - port: http
# protocol: TCP # protocol: TCP
# - port: https
# protocol: TCP
## @section Persistent Volume Claim ## @section Persistent Volume Claim
@@ -356,6 +394,72 @@ persistentVolumeClaim:
storageClass: "" storageClass: ""
## @section Prometheus
prometheus:
## @param prometheus.metrics.enabled Enable of scraping metrics by Prometheus.
## @param prometheus.metrics.basicAuthUsername Username for basic auth. The username and password is required by reposilite to expose metrics. Default: random alpha numeric string.
## @param prometheus.metrics.basicAuthPassword Password for basic auth. The username and password is required by reposilite to expose metrics. Default random alpha numeric string.
metrics:
enabled: false
basicAuthUsername: ""
basicAuthPassword: ""
## @param prometheus.metrics.podMonitor.enabled Enable creation of a podMonitor. Excludes the existence of a serviceMonitor resource.
## @param prometheus.metrics.podMonitor.annotations Additional podMonitor annotations.
## @param prometheus.metrics.podMonitor.enableHttp2 Enable HTTP2.
## @param prometheus.metrics.podMonitor.followRedirects FollowRedirects configures whether scrape requests follow HTTP 3xx redirects.
## @param prometheus.metrics.podMonitor.honorLabels Honor labels.
## @param prometheus.metrics.podMonitor.labels Additional podMonitor labels.
## @param prometheus.metrics.podMonitor.interval Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used.
## @param prometheus.metrics.podMonitor.path HTTP path of the Reposilite pod for scraping Prometheus metrics.
## @param prometheus.metrics.podMonitor.port HTTP port of the Reposilite pod for scraping Prometheus metrics.
## @param prometheus.metrics.podMonitor.relabelings RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields.
## @param prometheus.metrics.podMonitor.scrapeTimeout Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used.
## @param prometheus.metrics.podMonitor.scheme HTTP scheme to use for scraping. For example `http` or `https`.
## @param prometheus.metrics.podMonitor.tlsConfig TLS configuration to use when scraping the metric endpoint by Prometheus.
## @skip prometheus.metrics.podMonitor.tlsConfig Skip individual TLS configuration.
podMonitor:
enabled: false
annotations: {}
enableHttp2: false
followRedirects: false
honorLabels: false
labels: {}
interval: "60s"
path: "/metrics"
port: "http"
relabelings: []
scrapeTimeout: "30s"
scheme: "http"
tlsConfig: {}
## @param prometheus.metrics.serviceMonitor.enabled Enable creation of a serviceMonitor. Excludes the existence of a podMonitor resource.
## @param prometheus.metrics.serviceMonitor.annotations Additional serviceMonitor annotations.
## @param prometheus.metrics.serviceMonitor.labels Additional serviceMonitor labels.
## @param prometheus.metrics.serviceMonitor.enableHttp2 Enable HTTP2.
## @param prometheus.metrics.serviceMonitor.followRedirects FollowRedirects configures whether scrape requests follow HTTP 3xx redirects.
## @param prometheus.metrics.serviceMonitor.honorLabels Honor labels.
## @param prometheus.metrics.serviceMonitor.interval Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used.
## @param prometheus.metrics.serviceMonitor.path HTTP path for scraping Prometheus metrics.
## @param prometheus.metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields.
## @param prometheus.metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used.
## @param prometheus.metrics.serviceMonitor.scheme HTTP scheme to use for scraping. For example `http` or `https`.
## @param prometheus.metrics.serviceMonitor.tlsConfig TLS configuration to use when scraping the metric endpoint by Prometheus.
## @skip prometheus.metrics.serviceMonitor.tlsConfig Skip individual TLS configuration.
serviceMonitor:
enabled: false
annotations: {}
labels: {}
enableHttp2: false
followRedirects: false
honorLabels: false
interval: "60s"
path: "/metrics"
relabelings: []
scrapeTimeout: "30s"
scheme: "http"
tlsConfig: {}
## @section Service ## @section Service
## @param service.enabled Enable the service. ## @param service.enabled Enable the service.
## @param service.annotations Additional service annotations. ## @param service.annotations Additional service annotations.
@@ -368,6 +472,7 @@ persistentVolumeClaim:
## @param service.loadBalancerIP LoadBalancer will get created with the IP specified in this field. Requires service from type `LoadBalancer`. ## @param service.loadBalancerIP LoadBalancer will get created with the IP specified in this field. Requires service from type `LoadBalancer`.
## @param service.loadBalancerSourceRanges Source range filter for LoadBalancer. Requires service from type `LoadBalancer`. ## @param service.loadBalancerSourceRanges Source range filter for LoadBalancer. Requires service from type `LoadBalancer`.
## @param service.port Port to forward the traffic to. ## @param service.port Port to forward the traffic to.
## @param service.scheme Name of the service port. This name is also used as scheme / port name of the service monitor resource.
## @param service.sessionAffinity Supports `ClientIP` and `None`. Enable client IP based session affinity via `ClientIP`. ## @param service.sessionAffinity Supports `ClientIP` and `None`. Enable client IP based session affinity via `ClientIP`.
## @param service.sessionAffinityConfig Contains the configuration of the session affinity. ## @param service.sessionAffinityConfig Contains the configuration of the session affinity.
## @param service.type Kubernetes service type for the traffic. ## @param service.type Kubernetes service type for the traffic.
@@ -383,6 +488,7 @@ service:
loadBalancerIP: "" loadBalancerIP: ""
loadBalancerSourceRanges: [] loadBalancerSourceRanges: []
port: 8080 port: 8080
scheme: http
sessionAffinity: "None" sessionAffinity: "None"
sessionAffinityConfig: {} sessionAffinityConfig: {}
type: "ClusterIP" type: "ClusterIP"