Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
737b4b2
Added Helm chart for frontend
rieglerthomas May 27, 2024
ebcfe53
Fixed apiVersion for frontend deployment manifest
rieglerthomas May 27, 2024
3ad8940
Fixed typo
rieglerthomas May 27, 2024
06a8a2a
Added namesapce
rieglerthomas May 27, 2024
70381a2
Small changes
rieglerthomas May 27, 2024
0f7b298
Added imagePullPolicy
rieglerthomas May 27, 2024
30ad34b
Added empty Helm chart for api
rieglerthomas May 27, 2024
fb67dcb
Basic local environment setup
rieglerthomas May 27, 2024
3d89936
Added MetalLB and general improvements to Makefile
rieglerthomas May 27, 2024
00d3d70
Added README
rieglerthomas May 28, 2024
c368b03
Removed pacman folders
rieglerthomas May 29, 2024
500ef9e
Improvements to Makefile
rieglerthomas May 29, 2024
dffc224
Added API Helm chart
rieglerthomas May 29, 2024
51cea8b
Changed frontend image name
rieglerthomas May 29, 2024
f0a3b34
Added empty operator helm chart
rieglerthomas May 29, 2024
4507c67
Moved MySQL dependency to own chart
rieglerthomas May 29, 2024
de62cb6
Ignore helm /charts directories
rieglerthomas May 29, 2024
b9d030c
Improvements to MySQL deployment
rieglerthomas May 29, 2024
f32f9b3
Added dev values file for operator
rieglerthomas May 29, 2024
2890956
Added environment variables to api
rieglerthomas May 30, 2024
0368ee0
Added MySQL using Helm chart
rieglerthomas May 30, 2024
8623752
Added Oracle MySQL operator and InnoDB cluster
rieglerthomas Jun 2, 2024
48413b1
Added STUNner to local deployment
rieglerthomas Jun 2, 2024
4b465a0
Small bug fix
rieglerthomas Jun 2, 2024
d903fef
Add latest tag to all image builds
rieglerthomas Jun 2, 2024
85297f5
Fixed label mess
rieglerthomas Jun 2, 2024
fe8fe1d
Updated README
rieglerthomas Jun 2, 2024
65d333c
Added runtime configuration for frontend
rieglerthomas Jun 2, 2024
c4ee9d6
Output and set API url properly
rieglerthomas Jun 2, 2024
d4bc2c6
Add API port to README
rieglerthomas Jun 2, 2024
6b2369f
Properly set API url in frontend
rieglerthomas Jun 2, 2024
4172729
Redeploying frontend after API was redeployed
rieglerthomas Jun 2, 2024
691f3be
db_state table now has primary key
rieglerthomas Jun 2, 2024
933179d
Added comments to Makefile
rieglerthomas Jun 2, 2024
2224fc4
Adding STUNner repo
rieglerthomas Jun 2, 2024
fb93aee
Improved help
rieglerthomas Jun 2, 2024
3812b9d
Small bug fixes
rieglerthomas Jun 2, 2024
effdfb2
Properly wait for MySQL to be ready
rieglerthomas Jun 2, 2024
a596618
Fix proper handling of app config in frontend
rieglerthomas Jun 2, 2024
9d12fb6
Reading in port using kubectl status
rieglerthomas Jun 3, 2024
46cdb7f
Increase wait timeout for metallb wait
rieglerthomas Jun 3, 2024
79e0a79
Added Note to README
rieglerthomas Jun 3, 2024
db981bd
Changed install order
rieglerthomas Jun 3, 2024
912ecde
Fixed mistake in MySQL uninstall
rieglerthomas Jun 3, 2024
862b7df
Waiting for MySQL router to be ready instead of pod
rieglerthomas Jun 3, 2024
7ad839c
Potential fix for waiting for the MySQL router
rieglerthomas Jun 3, 2024
05f4eb1
Improve waiting for MySQL even further
rieglerthomas Jun 3, 2024
2593b5a
Removed Note in README
rieglerthomas Jun 3, 2024
291ed52
Fixed typo in README
rieglerthomas Jun 3, 2024
b745da7
Frontend defaults to development config if no external config provided
rieglerthomas Jun 3, 2024
939347c
Removed environment.ts
rieglerthomas Jun 3, 2024
b1021e1
Remove unneeded folders
rieglerthomas Jun 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
api/.idea/
api/internal/
.idea/

helm/*/charts
2 changes: 1 addition & 1 deletion api/migrations/0_init.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS db_state (
migrations int
migrations int NOT NULL primary key
);

CREATE TABLE IF NOT EXISTS games (
Expand Down
20 changes: 18 additions & 2 deletions frontend/indiestream/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
import {ApplicationConfig, importProvidersFrom} from '@angular/core';
import {APP_INITIALIZER, ApplicationConfig, importProvidersFrom} from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';
import { provideHttpClient } from "@angular/common/http";
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import {provideAnimations} from "@angular/platform-browser/animations";
import { AppConfigService } from './services/app-config.service';

export function initConfig(appConfig: AppConfigService) {
return () => appConfig.loadConfig();
}

export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes), provideHttpClient(), provideAnimationsAsync(), provideAnimations()]
providers: [
provideRouter(routes),
provideHttpClient(),
provideAnimationsAsync(),
provideAnimations(),
{
provide: APP_INITIALIZER,
useFactory: initConfig,
deps: [AppConfigService],
multi: true
}
]
};
4 changes: 0 additions & 4 deletions frontend/indiestream/src/app/environment.ts

This file was deleted.

36 changes: 36 additions & 0 deletions frontend/indiestream/src/app/services/app-config.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { firstValueFrom, lastValueFrom } from 'rxjs';

export interface AppConfig {
production: boolean;
apiUrl: string;
}

@Injectable({
providedIn: 'root'
})
export class AppConfigService {
private config: AppConfig = {
production: false,
apiUrl: "http://localhost:8080"
};

constructor(private http: HttpClient) {}

loadConfig(): Promise<void> {
return firstValueFrom(
this.http.get<AppConfig>('/assets/app.config.json')
).then( data => {
console.log("Config file loaded successfully", data)
this.config = data;
}).catch( err => {
console.error(err);
console.log("Defaulting to development config", this.config)
});
}

getConfig(): AppConfig {
return this.config;
}
}
8 changes: 5 additions & 3 deletions frontend/indiestream/src/app/services/games.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import { Injectable } from "@angular/core";
import {HttpClient, HttpEvent} from '@angular/common/http';
import { Games, Game } from '../modules/games';
import { Observable } from "rxjs";
import { environment } from "../environment";
import { AppConfigService } from "./app-config.service";

@Injectable({
providedIn: 'root'
})
export class GamesService {
private apiUrl = environment.apiUrl
constructor(private http: HttpClient) { }
private apiUrl = this.configService.getConfig().apiUrl;
constructor(private http: HttpClient, private configService: AppConfigService) {
console.log(this.configService.getConfig())
}

getGames(): Observable<Games> {
return this.http.get<Games>(this.apiUrl + "/games/");
Expand Down
23 changes: 23 additions & 0 deletions helm/api/.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/
24 changes: 24 additions & 0 deletions helm/api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: api
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
File renamed without changes.
38 changes: 38 additions & 0 deletions helm/api/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.appName }}
namespace: {{ .Values.appName }}
labels:
app: {{ .Values.appName }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ .Values.appName }}
template:
metadata:
labels:
app: {{ .Values.appName }}
spec:
containers:
- name: {{ .Values.appName }}
image: {{ .Values.image.name }}:{{ .Values.image.label }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.port }}
env:
- name: PORT
value: {{ .Values.port | quote }}
- name: GIN_MODE
value: {{ .Values.env.ginMode | quote }}
- name: MYSQL_DATABASE
value: {{ .Values.env.mysqlDatabase | quote }}
- name: MYSQL_ROOT_USER
value: {{ .Values.env.mysqlRootUser | quote }}
- name: MYSQL_ROOT_PASSWORD
value: {{ .Values.env.mysqlRootPassword | quote }}
- name: MYSQL_HOST
value: {{ .Values.env.mysqlHost | quote }}
- name: MYSQL_PORT
value: {{ .Values.env.mysqlPort | quote }}
6 changes: 6 additions & 0 deletions helm/api/templates/api-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.appName }}
labels:
name: {{ .Values.appName }}
15 changes: 15 additions & 0 deletions helm/api/templates/api-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.appName }}
namespace: {{ .Values.appName }}
labels:
app: {{ .Values.appName }}
spec:
type: LoadBalancer
selector:
app: {{ .Values.appName }}
ports:
- protocol: TCP
port: {{ .Values.port }}
targetPort: {{ .Values.port }}
8 changes: 8 additions & 0 deletions helm/api/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
image:
name: indiegamestream/api
label: localenv
pullPolicy: Never

env:
ginMode: debug
mysqlRootPassword: root
15 changes: 15 additions & 0 deletions helm/api/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appName: api
replicas: 1
port: 8080

image:
name: ghcr.io/austriandatalab/indiegamestream/api
label: v1.0.0 # Change to proper version tag
pullPolicy: IfNotPresent

env:
ginMode: release
mysqlDatabase: api
mysqlRootUser: root
mysqlHost: mysql.mysql.svc.cluster.local
mysqlPort: 3306
23 changes: 23 additions & 0 deletions helm/frontend/.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/
24 changes: 24 additions & 0 deletions helm/frontend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: frontend
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
File renamed without changes.
8 changes: 8 additions & 0 deletions helm/frontend/templates/frontend-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.appName }}-config
namespace: {{ .Values.appName }}
data:
app.config.json: |-
{{ toJson .Values.appConfig | indent 4 }}
34 changes: 34 additions & 0 deletions helm/frontend/templates/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.appName }}
namespace: {{ .Values.appName }}
labels:
app: {{ .Values.appName }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ .Values.appName }}
template:
metadata:
labels:
app: {{ .Values.appName }}
spec:
containers:
- name: {{ .Values.appName }}
image: {{ .Values.image.name }}:{{ .Values.image.label }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.port }}
volumeMounts:
- name: "{{ .Values.appName }}-config-volume"
mountPath: "{{ .Values.webRootDirectory }}/assets"
readOnly: true
volumes:
- name: "{{ .Values.appName }}-config-volume"
configMap:
name: "{{ .Values.appName }}-config"
items:
- key: app.config.json
path: app.config.json
6 changes: 6 additions & 0 deletions helm/frontend/templates/frontend-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.appName }}
labels:
name: {{ .Values.appName }}
15 changes: 15 additions & 0 deletions helm/frontend/templates/frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.appName }}
namespace: {{ .Values.appName }}
labels:
app: {{ .Values.appName }}
spec:
type: LoadBalancer
selector:
app: {{ .Values.appName }}
ports:
- protocol: TCP
port: {{ .Values.port }}
targetPort: {{ .Values.port }}
7 changes: 7 additions & 0 deletions helm/frontend/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
image:
name: indiegamestream/frontend
label: localenv
pullPolicy: Never

appConfig:
production: false
13 changes: 13 additions & 0 deletions helm/frontend/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
appName: frontend
replicas: 1
port: 80

image:
name: ghcr.io/austriandatalab/indiegamestream/frontend
label: v1.0.0 # Change to proper version tag
pullPolicy: IfNotPresent

webRootDirectory: /usr/share/nginx/html

appConfig:
production: true
8 changes: 8 additions & 0 deletions helm/mysql/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
credentials:
root:
password: root

serverInstances: 1

tls:
useSelfSigned: true
File renamed without changes.
Loading