Skip to content

Commit

Permalink
feat: use restinthemiddle v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Jan 18, 2023
1 parent ecef86a commit 38881a4
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 37 deletions.
3 changes: 1 addition & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:[email protected]: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)
4 changes: 2 additions & 2 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
15 changes: 4 additions & 11 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
43 changes: 24 additions & 19 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ 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: []

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:[email protected]:4443/example/path

serviceAccount:
create: false
Expand All @@ -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

Expand All @@ -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

0 comments on commit 38881a4

Please sign in to comment.