Skip to content
2 changes: 1 addition & 1 deletion k8s/03-collab-db-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
containerPort: 5432
volumeMounts:
- name: collab-db-vol
mountPath: /data/collab-db
mountPath: /data
volumeClaimTemplates:
- metadata:
name: collab-db-vol
Expand Down
2 changes: 1 addition & 1 deletion k8s/03-question-db-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
containerPort: 5432
volumeMounts:
- name: question-db-vol
mountPath: /data/question-db
mountPath: /data
volumeClaimTemplates:
- metadata:
name: question-db-vol
Expand Down
2 changes: 1 addition & 1 deletion k8s/03-user-db-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
containerPort: 5432
volumeMounts:
- name: user-db-vol
mountPath: /data/user-db
mountPath: /data
volumeClaimTemplates:
- metadata:
name: user-db-vol
Expand Down
2 changes: 1 addition & 1 deletion k8s/04-collab-svc-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
name: cpu
target:
type: Utilization
averageUtilization: 30
averageUtilization: 70
2 changes: 1 addition & 1 deletion k8s/04-question-svc-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
name: cpu
target:
type: Utilization
averageUtilization: 30
averageUtilization: 70
2 changes: 1 addition & 1 deletion k8s/04-user-svc-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
name: cpu
target:
type: Utilization
averageUtilization: 30
averageUtilization: 70
2 changes: 1 addition & 1 deletion k8s/05-frontend-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
name: cpu
target:
type: Utilization
averageUtilization: 30
averageUtilization: 60
13 changes: 13 additions & 0 deletions k8s/gcloud/01-web-ssl-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Placeholder Secret to store TLS keys

apiVersion: v1
kind: Secret
metadata:
name: web-ssl
namespace: peerprep
labels:
project: peerprep
type: kubernetes.io/tls
stringData:
tls.key: ""
tls.crt: ""
15 changes: 15 additions & 0 deletions k8s/gcloud/02-issuer-le-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# issuer-lets-encrypt-production.yaml
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-production
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: <email-address> # ❗ Replace this with your email address
privateKeySecretRef:
name: letsencrypt-production
solvers:
- http01:
ingress:
name: peerprep-ingress
14 changes: 14 additions & 0 deletions k8s/gcloud/02-issuer-le-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: <email-address> # ❗ Replace this with your email address
privateKeySecretRef:
name: letsencrypt-staging
solvers:
- http01:
ingress:
name: peerprep-ingress
33 changes: 33 additions & 0 deletions k8s/gcloud/03-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: peerprep-ingress
namespace: peerprep
labels:
project: peerprep
peerprep.service: app-ingress
annotations:
# This tells Google Cloud to create an External Load Balancer to realize this Ingress
kubernetes.io/ingress.class: gce
# This enables HTTP connections from Internet clients
kubernetes.io/ingress.allow-http: "true"
# This tells Google Cloud to associate the External Load Balancer with the static IP which we created earlier
kubernetes.io/ingress.global-static-ip-name: web-ip
cert-manager.io/issuer: letsencrypt-production
spec:
tls:
- secretName: web-ssl
hosts:
- $DOMAIN_NAME
rules:
- host: peerprep-g16.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 3000
2 changes: 1 addition & 1 deletion scripts/k8s-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ create_secret() {
kubectl -n $ns \
create secret generic \
"$scrt_name" \
--from-env-file /dev/stdin
--from-env-file="$envFolder$secretName/.env.compose"
else
echo "Secret $scrt_name already exists"
fi
Expand Down