Skip to content
Snippets Groups Projects
Commit 98af559a authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

renamed chart to apps and moved http proxy configs to configmap

parent d6537530
Branches
No related tags found
No related merge requests found
FROM docker.io/nginx:1.21.0
COPY ./default.conf /etc/nginx/conf.d/default.conf
\ No newline at end of file
server {
listen 80;
server_name localhost;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://192.168.96.1:8006;
proxy_buffering off;
client_max_body_size 0;
proxy_connect_timeout 3600s;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
send_timeout 3600s;
}
}
\ No newline at end of file
apiVersion: v2
name: proxy
description: A Helm chart for https proxies
name: apps
description: A Helm chart for apps
type: application
version: 0.3.0
version: 0.5.0
appVersion: "1.0.0"
{{/*
Expand the name of the chart.
*/}}
{{- define "proxy.name" -}}
{{- define "apps.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
......@@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "proxy.fullname" -}}
{{- define "apps.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
......@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "proxy.chart" -}}
{{- define "apps.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "proxy.labels" -}}
helm.sh/chart: {{ include "proxy.chart" . }}
{{ include "proxy.selectorLabels" . }}
{{- define "apps.labels" -}}
helm.sh/chart: {{ include "apps.chart" . }}
{{ include "apps.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
......@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "proxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "proxy.name" . }}
{{- define "apps.selectorLabels" -}}
app.kubernetes.io/name: {{ include "apps.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "proxy.serviceAccountName" -}}
{{- define "apps.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "proxy.fullname" .) .Values.serviceAccount.name }}
{{- default (include "apps.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
......
{{ range .Values.apps }}
{{ range .Values.http_proxies }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .name }}-config
data:
nginx.conf: |-
server {
listen 80;
server_name localhost;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass {{ .proxy_pass }};
proxy_buffering off;
client_max_body_size 0;
proxy_connect_timeout 3600s;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
send_timeout 3600s;
}
}
---
apiVersion: v1
kind: Service
......@@ -33,7 +58,7 @@ spec:
spec:
containers:
- name: {{ .name }}
image: {{ .image }}
image: nginx:1.21.0
ports:
- containerPort: {{ .port }}
resources:
......@@ -43,5 +68,12 @@ spec:
limits:
memory: {{ .resources.limits.memory }}
cpu: {{ .resources.limits.cpu }}
volumeMounts:
- mountPath: /etc/nginx/conf.d
name: config
volumes:
- name: config
configMap:
name: {{ .name }}-config
{{ end }}
\ No newline at end of file
......@@ -23,14 +23,6 @@ spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
tls:
httpsRedirect: true
hosts:
- {{ .dns }}
- port:
number: 443
name: https
......
......@@ -23,10 +23,15 @@ proxies:
host: pve-nginx-proxy-service
port: 80
namespace: deploy
- name: pfsense
dns: pfsense.maze.sch.bme.hu
service:
host: pfsense-nginx-proxy-service
port: 80
namespace: deploy
apps:
http_proxies:
- name: pve-nginx-proxy
image: rlacko58/pve-nginx-proxy:1.0
replicas: 1
port: 80
namespace: deploy
......@@ -37,5 +42,16 @@ apps:
limits:
memory: "512Mi"
cpu: "300m"
proxy_pass: https://192.168.96.1:8006
- name: pfsense-nginx-proxy
replicas: 1
port: 80
namespace: deploy
resources:
requests:
memory: "256Mi"
cpu: "150m"
limits:
memory: "512Mi"
cpu: "300m"
proxy_pass: https://192.168.99.254
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment