Skip to content

Commit

Permalink
fix: release oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
matmut7 committed May 6, 2024
1 parent cb24b1a commit 04ad83e
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 0 deletions.
7 changes: 7 additions & 0 deletions charts/oauth2-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: oauth2-proxy
version: 1.28.0
dependencies:
- name: common
version: ^1.28.0
repository: https://socialgouv.github.io/helm-charts
76 changes: 76 additions & 0 deletions charts/oauth2-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
component: {{ include "common.names.fullname" . }}
application: {{ include "common.names.fullname" . }}
name: {{ include "common.names.fullname" . }}
annotations:
{{ if .Values.annotations }}
{{ range $key, $val := .Values.annotations }}
"{{ $key }}": {{ $val | quote }}
{{ end }}
{{ end }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
component: {{ include "common.names.fullname" . }}
template:
metadata:
labels:
component: {{ include "common.names.fullname" . }}
spec:
containers:
- image: {{ .Values.image.name }}:{{ .Values.image.tag }}
args:
- --upstream
- {{ .Values.upstream }}
{{- if gt (len .Values.additionalArgs) 0 }}
{{- tpl (.Values.additionalArgs | toYaml) . | nindent 12 }}
{{- end }}
name: app
ports:
- containerPort: 4180
name: http
resources:
limits:
cpu: 0.5
memory: 256Mi
requests:
cpu: 0.2
memory: 128Mi
livenessProbe:
failureThreshold: 15
httpGet:
path: "/ping"
port: http
periodSeconds: 5
timeoutSeconds: 5
readinessProbe:
failureThreshold: 15
httpGet:
path: "/ping"
port: http
initialDelaySeconds: 1
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
startupProbe:
failureThreshold: 12
httpGet:
path: "/ping"
port: http
periodSeconds: 5
initialDelaySeconds: 30
env:
- name: "OAUTH2_PROXY_REDIRECT_URL"
value: https://{{ tpl (or .Values.host (print .Chart.Name "-" (or .Values.global.host ""))) . }}/oauth2/callback
{{- if gt (len .Values.env) 0 }}
{{- tpl (.Values.env | toYaml) . | nindent 12 }}
{{- end }}
envFrom:
{{- if gt (len .Values.envFrom) 0 }}
{{- tpl (.Values.envFrom | toYaml) . | nindent 12 }}
{{- end }}

38 changes: 38 additions & 0 deletions charts/oauth2-proxy/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{ if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ if .Values.ingress.annotations }}
{{ range $key, $val := (merge dict .Values.ingress.annotations) }}
"{{ $key }}": {{ $val | quote }}
{{ end }}
{{ end }}
labels:
component: {{ include "common.names.fullname" . }}
application: {{ include "common.names.fullname" . }}
name: {{ include "common.names.fullname" . }}
spec:
rules:
- host: >-
{{- tpl (or .Values.host (print .Chart.Name "-" (or .Values.global.host ""))) . | nindent 8 }}
http:
paths:
- backend:
service:
name: {{ include "common.names.fullname" . }}
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- >-
{{- tpl (or .Values.host (print .Chart.Name "-" (or .Values.global.host ""))) . | nindent 12 }}
{{- if .Values.certSecretName }}
secretName: {{ .Values.certSecretName }}
{{- else }}
secretName: {{ print .Chart.Name "-crt" }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/oauth2-proxy/templates/oauth2-proxy.configmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: ConfigMap
apiVersion: v1
metadata:
labels:
component: {{ include "common.names.fullname" . }}
application: {{ include "common.names.fullname" . }}
name: {{ include "common.names.fullname" . }}
annotations:
{{ if .Values.annotations }}
{{ range $key, $val := .Values.annotations }}
"{{ $key }}": {{ $val | quote }}
{{ end }}
{{ end }}
data:
{{ range $key, $value := .Values.config }}
{{ $key }}: {{ $value | quote }}
{{ end }}
16 changes: 16 additions & 0 deletions charts/oauth2-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
labels:
component: {{ include "common.names.fullname" . }}
application: {{ include "common.names.fullname" . }}
name: {{ include "common.names.fullname" . }}
annotations: {}
spec:
ports:
- name: http
port: 80
targetPort: 4180
selector:
component: {{ include "common.names.fullname" . }}
type: ClusterIP
16 changes: 16 additions & 0 deletions charts/oauth2-proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
env: []
envFrom: []

ingress:
enabled: true
host:
annotations: {}

upstream:

additionalArgs: []
replicas: 1

image:
name: quay.io/oauth2-proxy/oauth2-proxy
tag: v7.4.0

0 comments on commit 04ad83e

Please sign in to comment.