Skip to content

Commit

Permalink
add api-gateway deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jusa3 committed May 14, 2024
1 parent 9c91da4 commit d450e8b
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 0 deletions.
23 changes: 23 additions & 0 deletions k8s/api-gateway/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions k8s/api-gateway/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: api-gateway
description: A Helm chart to deploy the api-gateway.
type: application
version: 0.0.1
appVersion: "1.0.0"
4 changes: 4 additions & 0 deletions k8s/api-gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Install API-Gateway
```
helm install my-test ./api-gateway
```
25 changes: 25 additions & 0 deletions k8s/api-gateway/templates/api-gateway-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-api-gateway
spec:
selector:
matchLabels:
name: {{ .Release.Name }}-api-gateway
template:
metadata:
labels:
name: {{ .Release.Name }}-api-gateway
spec:
containers:
- name: api-gateway
image: {{ .Values.images.frontend }}
resources:
limits:
memory: 500Mi
requests:
memory: 100Mi
ports:
- containerPort: 8080
imagePullSecrets:
- name: api-gateway-dockerconfigjson-gitlab
33 changes: 33 additions & 0 deletions k8s/api-gateway/templates/api-gateway-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.ingress.dns }}
{{- $relname := .Release.Name -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
{{ if .Values.ingress.enableSSL }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
cert-manager.io/issuer: {{ .Values.ingress.certIssuer | quote}}
{{ end }}
nginx.ingress.kubernetes.io/proxy-buffer-size: 12k
spec:
{{ if .Values.ingress.enableSSL }}
tls:
- hosts:
- {{ .Values.ingress.dns }}
secretName: {{ .Release.Name }}-ssl-secret
{{ end }}
rules:
- host: {{ .Values.ingress.dns }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-api-gateway
port:
number: 80
{{- end }}
11 changes: 11 additions & 0 deletions k8s/api-gateway/templates/api-gateway-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-api-gateway
spec:
ports:
- name: "80"
port: 80
targetPort: 8080
selector:
name: {{ .Release.Name }}-api-gateway
6 changes: 6 additions & 0 deletions k8s/api-gateway/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ingress:
dns: api-gateway.qa.km.k8s.zbmed.de
enableSSL:
certIssuer:
images:
frontend: ghcr.io/zbmed/api-gateway:latest

0 comments on commit d450e8b

Please sign in to comment.