-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend Kubernetes #37
Open
Hustenbonbon
wants to merge
14
commits into
main
Choose a base branch
from
kube-nexy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b3fb883
Add todo planning
Hustenbonbon ef7c734
Add k9s to dependencies
Hustenbonbon 57db1f7
WIP frontend deployment
Hustenbonbon 91cb9a9
Add frontend/target to gitignore
Hustenbonbon 23419ca
add dockerfile for frontend
Konsti-s b4f79ec
Log todo
Hustenbonbon 27e7417
Add helm deployment for frontend quick n dirty
Hustenbonbon 9d9881b
Add ghcr (you will need tokens to push)
Hustenbonbon ca52122
Try CI stuff
Hustenbonbon d1de2a1
Add ingress for backend
Hustenbonbon e8e2a05
add https support on eks
Hustenbonbon a15e173
Update planings
Hustenbonbon 9aa19de
Specify nginx version
Hustenbonbon bbb1de3
Try tilt instead of skaffold
Hustenbonbon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Frontend Docker image | ||
run: docker build . --file packages/frontend/Dockerfile --tag otto-frontend:$(date +%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
helm/otto/templates/deployment.yaml → helm/otto/templates/backend-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "otto.fullname" . }}-frontend | ||
labels: | ||
{{- include "otto.labels" . | nindent 4 }} | ||
spec: | ||
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.frontend.replicaCount }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "otto.selectorLabelsFrontend" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "otto.selectorLabelsFrontend" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "otto.serviceAccountName" . }} | ||
containers: | ||
- name: {{ .Chart.Name }}-frontend | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.frontend.service.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: http | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "otto.fullname" . }}-frontend | ||
labels: | ||
{{- include "otto.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.frontend.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "otto.selectorLabelsFrontend" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
todos | ||
|
||
frontend: | ||
- build: | ||
- openapi anders? | ||
buildpacks? | ||
direkt docker? | ||
über maven? | ||
deploy | ||
nginx prod vs dev container? | ||
- postgres: wir stellen code für dev bereit, den leute optional für prod hernehmen könnten, wir rechnen aber nicht damit | ||
|
||
setup | ||
- minikube (1.02 GB) durch kind/k3s ersetzen? (Install-Größe und Performanz) | ||
- Findings: | ||
- Kind ist unwesentlich kleiner (823 MB), und es ist deutlich umständlicher, ein Kubernetes-Dashboard zum laufen zu bekommen | ||
- k3s läuft nicht auf MacOS | ||
- k3d wesentlich kleiner in images: 161 + 39 + 18 MB, schnell | ||
-> k3d könnte sich lohnen, wenn aufsetzen reibungslos geht | ||
|
||
skaffold-zeug: | ||
- FileSync, damit nicht immer neu gebaut werden muss | ||
|
||
backend: | ||
- Warum funktionieren probes nicht? | ||
- liquibase in initcontainer | ||
- https://redhat-scholars.github.io/spring-boot-k8s-tutorial/spring-boot-tutorial/03-kubernetes.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
generated-sources | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,5 @@ coverage | |
|
||
test-results/ | ||
playwright-report/ | ||
|
||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM openapitools/openapi-generator-cli:v6.4.0 AS openapigenerator_builder | ||
|
||
RUN mkdir -p /app/generated-sources/client | ||
COPY packages/api-spec/openapi.yml /app/openapi.yml | ||
WORKDIR /app/generated-sources/client | ||
RUN /usr/local/bin/docker-entrypoint.sh \ | ||
generate -i /app/openapi.yml -g typescript-axios -o . \ | ||
--additional-properties=npmName=rest-client,withInterface=true,supportsES6=true | ||
|
||
# https://openapi-generator.tech/docs/generators/typescript-axios/ | ||
# https://openapi-generator.tech/docs/installation#docker | ||
|
||
FROM node:alpine3.17 AS frontend_builder_prod | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
# copy the generated openapi-client | ||
COPY --from=openapigenerator_builder /app/generated-sources/client /app/generated-sources/client | ||
|
||
# install npm dependencies | ||
COPY packages/frontend/package*.json ./ | ||
RUN npm install | ||
|
||
# build frontend | ||
WORKDIR /app | ||
COPY packages/frontend ./ | ||
RUN npm run build | ||
|
||
|
||
FROM nginx:latest as webserver_prod | ||
|
||
COPY --from=frontend_builder_prod /app/dist /usr/share/nginx/html | ||
EXPOSE 80 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest noch durch version ersetzen