diff --git a/Chart.yaml b/Chart.yaml index 7bea9f4..8d5f51b 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,5 +2,4 @@ apiVersion: v2 name: restinthemiddle description: HTTP logging proxy type: application -version: 0.2.0 -appVersion: "1.3.0" +version: 0.3.0 diff --git a/README.md b/README.md index fb68b9e..93f243b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,61 @@ -# restinthemiddle-helm +# restinthemiddle -Helm chart for restinthemiddle +![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) + +HTTP logging proxy + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| applicationName | string | `"restinthemiddle"` | | +| autoscaling.enabled | bool | `false` | Handle with care! Autoscaling will make sense only if you have centralized logging. | +| autoscaling.maxReplicas | int | `2` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| config.exclude | string | `""` | | +| config.excludePostBody | string | `""` | | +| config.excludeResponseBody | string | `""` | | +| config.headers | object | `{}` | | +| config.listenIp | string | `"0.0.0.0"` | | +| config.listenPort | string | `"8000"` | | +| config.logPostBody | bool | `true` | | +| config.logResponseBody | bool | `true` | | +| config.loggingEnabled | bool | `true` | | +| config.setRequestId | bool | `false` | | +| config.targetHostDsn | string | `"https://username:password@example.com:4443/example/path"` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.registry | string | `"docker.io"` | | +| image.repository | string | `"jdschulze/restinthemiddle"` | | +| image.tag | string | `"2.0.0-alpha.11"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"restinthemiddle.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| namespace | string | `"default"` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podSecurityContext | object | `{}` | | +| replicaCount | int | `1` | Leave this at 1 if you do not have centralized logging. | +| resources | object | `{"limits":{"cpu":"100m","memory":"64Mi"},"requests":{"cpu":"10m","memory":"32Mi"}}` | Adjust those values to your needs. These values are only suggestions! | +| securityContext.capabilities.drop[0] | string | `"ALL"` | | +| securityContext.readOnlyRootFilesystem | bool | `true` | | +| securityContext.runAsGroup | int | `1000` | | +| securityContext.runAsNonRoot | bool | `true` | | +| securityContext.runAsUser | int | `1000` | | +| service.portOverride | string | `""` | Use this only if you have to override config.listenPort because you want to use a privileged port. | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index b53feaa..7669c0c 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -36,8 +36,8 @@ Common labels {{- define "restinthemiddle.labels" -}} helm.sh/chart: {{ include "restinthemiddle.chart" . }} {{ include "restinthemiddle.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- if .Values.image.tag }} +app.kubernetes.io/version: {{ .Values.image.tag | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} diff --git a/templates/configmap.yaml b/templates/configmap.yaml index 7d01b27..e207d4e 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -1,17 +1,10 @@ +{{- if .Values.config -}} apiVersion: v1 kind: ConfigMap metadata: name: restinthemiddle-config namespace: {{ .Release.Namespace }} data: - config.yaml: |+ - targetHostDsn: {{ .Values.config.targetHostDsn }} - listenIp: {{ .Values.config.listenIp }} - listenPort: {{ .Values.config.listenPort | quote }} - headers: - {{- range $name, $value := .Values.config.headers }} - {{ $name }}: {{ $value }} - {{- end }} - loggingEnabled: {{ .Values.config.loggingEnabled }} - setRequestId: {{ .Values.config.setRequestId }} - exclude: {{ .Values.config.exclude | quote }} + config.yaml: | + {{- toYaml .Values.config | nindent 4 }} +{{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 5e6334a..383cb05 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -32,7 +32,7 @@ spec: - name: {{ template "restinthemiddle.name" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: {{ .Values.config.listenPort }} diff --git a/values.yaml b/values.yaml index 2073b7d..07d8906 100644 --- a/values.yaml +++ b/values.yaml @@ -2,9 +2,10 @@ namespace: default applicationName: restinthemiddle image: - repository: docker.io/jdschulze/restinthemiddle + registry: docker.io + repository: jdschulze/restinthemiddle pullPolicy: IfNotPresent - tag: "" + tag: "2.0.0-alpha.11" imagePullSecrets: [] @@ -12,14 +13,17 @@ nameOverride: "" fullnameOverride: "" config: - targetHostDsn: https://example.com:4443 - listenIp: 0.0.0.0 # Usually you shouldn’t change this value - listenPort: "8000" # Non-privileged ports only! Use service.portOverride if you want to use a privileged port. - headers: - User-Agent: Rest in the middle logging proxy - loggingEnabled: true # You know, for Logging - setRequestId: false # Add an X-Request-Id header if not already present - exclude: "" # Exclude requests that match this URL RegEx + exclude: "" # Exclude requests that match this URL RegEx + excludePostBody: "" # Do not log the Request body if the URL path matches this RegEx + excludeResponseBody: "" # Do not log the Response body if the URL path matches this RegEx + headers: {} + listenIp: 0.0.0.0 # Usually you shouldn’t change this value + listenPort: "8000" # Non-privileged ports only! Use service.portOverride if you want to use a privileged port. + logPostBody: true # Log the Request body + logResponseBody: true # Log the Response body (if it is not chunked) + loggingEnabled: true # You know, for Logging + setRequestId: false # Add an X-Request-Id header if not already present + targetHostDsn: https://username:password@example.com:4443/example/path serviceAccount: create: false @@ -42,36 +46,37 @@ securityContext: service: type: ClusterIP - portOverride: "" # Use this only if you have to override config.listenPort because you want to use a privileged port. + # -- Use this only if you have to override config.listenPort because you want to use a privileged port. + portOverride: "" ingress: enabled: false className: "" annotations: {} -# kubernetes.io/ingress.class: nginx -# kubernetes.io/tls-acme: "true" hosts: - host: restinthemiddle.local paths: - path: / pathType: ImplementationSpecific tls: [] -# - secretName: chart-example-tls +# - secretName: restinthemiddle-tls # hosts: -# - chart-example.local +# - restinthemiddle.local +# -- Adjust those values to your needs. These values are only suggestions! resources: limits: cpu: 100m memory: 64Mi requests: - cpu: 100m - memory: 64Mi + cpu: 10m + memory: 32Mi autoscaling: + # -- Handle with care! Autoscaling will make sense only if you have centralized logging. enabled: false minReplicas: 1 - maxReplicas: 100 + maxReplicas: 2 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 @@ -81,5 +86,5 @@ tolerations: [] affinity: {} -# Probably you should leave this untouched +# -- Leave this at 1 if you do not have centralized logging. replicaCount: 1