Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Oct 10, 2023
1 parent 064b0c1 commit f823579
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 51 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test-on-kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ jobs:
- name: Set up ingress controller
run: |
helm repo add traefik https://traefik.github.io/charts && helm repo update
helm install --namespace ingress-traefik --create-namespace traefik traefik/traefik --values ./infra/kube/kind/traefik-values.yml
helm upgrade \
--install \
--wait \
--namespace traefik \
--create-namespace \
--values ./infra/kube/kind/traefik-values.yml \
traefik traefik/traefik
- name: Add hosts to /etc/hosts
run: |
Expand Down
8 changes: 0 additions & 8 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ http {
try_files $uri $uri/ /index.html;
}

location /api/ {
proxy_pass http://basegun-backend:5000/;
client_max_body_size 5M;
proxy_read_timeout 1800;
proxy_connect_timeout 1800;
proxy_send_timeout 1800;
}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
Expand Down
49 changes: 17 additions & 32 deletions infra/kube/helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "basegun.chart" . -}}
{{- $svcPort := .Values.frontend.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- $svcPortFrontend := .Values.frontend.service.port -}}
{{- $svcPortBackend := .Values.backend.service.port -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: "basegun-ingress"
Expand All @@ -23,9 +12,7 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -41,21 +28,19 @@ spec:
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: "basegun-frontend"
port:
number: {{ $svcPort }}
{{- else }}
serviceName: "basegun-frontend"
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
- path: /
pathType: Prefix
backend:
service:
name: basegun-frontend
port:
number: {{ $svcPortFrontend }}
- path: /api/
pathType: Prefix
backend:
service:
name: basegun-backend
port:
number: {{ $svcPortBackend }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 0 additions & 4 deletions infra/kube/helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ spec:
ports:
- port: {{ .Values.frontend.service.port }}
targetPort: {{ .Values.frontend.service.containerPort }}
protocol: TCP
name: http
selector:
{{- include "basegun.FrontSelectorLabels" . | nindent 4 }}
---
Expand All @@ -25,7 +23,5 @@ spec:
ports:
- port: {{ .Values.backend.service.port }}
targetPort: {{ .Values.backend.service.containerPort }}
protocol: TCP
name: http
selector:
{{- include "basegun.BackSelectorLabels" . | nindent 4 }}
8 changes: 4 additions & 4 deletions infra/kube/helm/values-dso.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ backend:
repository: harbor.apps.c6.numerique-interieur.com/mi-basegun-test/basegun-backend
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: feature-adapt-infra-for-dso-env
tag: 195-rediriger-vers-lapi-via-lingress-k8s
imagePullSecrets: []
podAnnotations: {}
podSecurityContext: {}
Expand All @@ -49,7 +49,7 @@ backend:
logs:
repository: ghcr.io/datalab-mi/basegun/filebeat-rootless
tag: 6.5.4
pullPolicy: IfNotPresent
pullPolicy: Always
service:
type: ClusterIP
port: 5000
Expand Down Expand Up @@ -86,9 +86,9 @@ frontend:
replicaCount: 1
image:
repository: harbor.apps.c6.numerique-interieur.com/mi-basegun-test/basegun-frontend
pullPolicy: IfNotPresent
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: feature-adapt-infra-for-dso-env
tag: 195-rediriger-vers-lapi-via-lingress-k8s
imagePullSecrets: []
podAnnotations: {}
podSecurityContext: {}
Expand Down
4 changes: 2 additions & 2 deletions infra/kube/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ backend:
memory: 256Mi
service:
type: ClusterIP
port: 5000
port: 80
containerPort: 5000
autoscaling:
enabled: false
Expand Down Expand Up @@ -111,7 +111,7 @@ frontend:

service:
type: ClusterIP
port: 8080
port: 80
containerPort: 8080
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down

0 comments on commit f823579

Please sign in to comment.