Skip to content
Snippets Groups Projects
Commit 2a6b65fb authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

fix: #be tune k8s manifests and document required versions

parent 5cdd2ff7
Branches
Tags
No related merge requests found
Pipeline #23143 failed
......@@ -18,6 +18,17 @@ PORT=8080 npm run serve
The webserver will be abailable at `http://localhost:8080`.
### Deployment
**CAVEAT:** the cluster has `k8s 1.10.11` but **you must use `kubectl 1.11.0`**, otherwise the schema validation breaks since `1.10.11` schemas aren't around anymore.
```bash
# Please validate before deploying (1.11.0 is the closest available schema version)
kustomize build backend/k8s/overlays/ENV/ | kubeval --kubernetes-version 1.11.0
# We're on an old version and there's no -k flag:
kustomize build backend/k8s/overlays/ENV/ | kubectl apply -f -
```
## Frontend
The frontend is a `phaser` webapp built `parcel`.
......@@ -36,12 +47,3 @@ Also, remember to
This operation permits the ui to call the backend at `http://localhost:8080/oetzi_words/` instead of to the relative path.
The webapp will be abailable at `http://localhost:1234`.
## Deployment
```bash
# Please validate before deploying (note the cluster is 1.10.11 but 1.11.0 is the nearest one that works):
kustomize build backend/k8s/overlays/ENV/ | kubeval --kubernetes-version 1.11.0
# We're on an old version and there's no -k flag:
kustomize build backend/k8s/overlays/ENV/ | kubectl apply -f -
```
......@@ -8,7 +8,7 @@ spec:
http:
paths:
- path: PLACEHOLDER
pathType: Prefix
# pathType: Prefix # requires k8s>=v1.18
backend:
serviceName: service
servicePort: 80
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
commonLabels:
eurac.edu/environment: dev
app.kubernetes.io/part-of: oetzi
app.kubernetes.io/managed-by: kustomize
patchesStrategicMerge:
- database.deployment.yaml
- webserver.deployment.yaml
images:
- name: oetzi-webserver-image
# NOTE: use `minikube image load oetzi:latest` to push into container runtime
newName: oetzi
newTag: latest
secretGenerator:
- literals:
- username=db_user
- password=db_pass
- database=db_name
- url=postgres://db_user:db_pass@oetzi-database-service/db_name
name: oetzi-database-credentials
type: Opaque
patchesJSON6902:
- target:
group: extensions
version: v1beta1
kind: Ingress
name: oetzi-webserver-ingress
path: webserver.ingress.patch.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
commonLabels:
eurac.edu/environment: dev
app.kubernetes.io/part-of: oetzi
app.kubernetes.io/managed-by: kustomize
patchesStrategicMerge:
- database.deployment.yaml
- webserver.deployment.yaml
images:
- name: oetzi-webserver-image
# NOTE: use `minikube image load oetzi:latest` to push into container runtime
newName: oetzi
newTag: latest
secretGenerator:
- literals:
- username=db_user
- password=db_pass
- database=db_name
- url=postgres://db_user:db_pass@oetzi-database-service/db_name
name: oetzi-database-credentials
type: Opaque
patchesJSON6902:
- target:
group: extensions
version: v1beta1
kind: Ingress
name: oetzi-webserver-ingress
path: webserver.ingress.patch.yaml
- op: replace
path: /metadata/annotations/nginx.ingress.kubernetes.io~1rewrite-target
value: /$2
- op: replace
path: /spec/rules/0/host
value: minikube.localhost
- op: replace
path: /spec/rules/0/http/paths/0/path
value: /oetzi(/|$)(.*)
- op: replace
path: /metadata/annotations/nginx.ingress.kubernetes.io~1rewrite-target
value: /$2
- op: replace
path: /spec/rules/0/host
value: minikube.localhost
- op: replace
path: /spec/rules/0/http/paths/0/path
value: /oetzi(/|$)(.*)
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: kommul-dev
commonLabels:
eurac.edu/environment: stg
app.kubernetes.io/part-of: oetzi
app.kubernetes.io/managed-by: kustomize
patchesStrategicMerge:
- database.deployment.yaml
- webserver.deployment.yaml
images:
- name: oetzi-webserver-image
newName: gitlab.inf.unibz.it:4567/commul/oetzi/backend
newTag: latest
secretGenerator:
# TODO: avoid using literals
- literals:
- username=db_user
- password=db_pass
- database=db_name
- url=postgres://db_user:db_pass@oetzi-database-service/db_name
name: oetzi-database-credentials
type: Opaque
patchesJSON6902:
- target:
group: extensions
version: v1beta1
kind: Ingress
name: oetzi-webserver-ingress
path: webserver.ingress.patch.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: kommul-dev
commonLabels:
eurac.edu/environment: stg
app.kubernetes.io/part-of: oetzi
app.kubernetes.io/managed-by: kustomize
patchesStrategicMerge:
- database.deployment.yaml
- webserver.deployment.yaml
images:
- name: oetzi-webserver-image
newName: gitlab.inf.unibz.it:4567/commul/oetzi/backend
newTag: latest
secretGenerator:
# TODO: avoid using literals
- literals:
- username=db_user
- password=db_pass
- database=db_name
- url=postgres://db_user:db_pass@oetzi-database-service/db_name
name: oetzi-database-credentials
type: Opaque
patchesJSON6902:
- target:
group: extensions
version: v1beta1
kind: Ingress
name: oetzi-webserver-ingress
path: webserver.ingress.patch.yaml
- op: replace
path: /metadata/annotations/nginx.ingress.kubernetes.io~1rewrite-target
value: /$2
- op: replace
path: /spec/rules/0/host
value: kommul-dev.eurac.edu
- op: replace
path: /spec/rules/0/http/paths/0/path
value: /oetzi(/|$)(.*)
- op: replace
path: /metadata/annotations/nginx.ingress.kubernetes.io~1rewrite-target
value: /$2
- op: replace
path: /spec/rules/0/host
value: kommul-dev.eurac.edu
- op: replace
path: /spec/rules/0/http/paths/0/path
value: /oetzi(/|$)(.*)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment