-
Notifications
You must be signed in to change notification settings - Fork 4
CoverService local k8s
This is a raw guide to get the complete stack running inside docker-desktop kubernetes. The services all come with their own docker compose setup. So this is more to be able to test the complete setup locally and play with the setup without having to have cluster at one of the cloud providers.
This page assumes that you have helm and docker-desktop with kubernetes enabled and running.
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo add jetstack https://charts.jetstack.io
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl apply --validate=false -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml
kubectl create namespace cert-manager
helm install cert-manager --namespace cert-manager --version v0.13.1 jetstack/cert-manager
kubectl apply -f https://download.elastic.co/downloads/eck/1.0.0-beta1/all-in-one.yaml
We have some services and configuration that are shared between services and this helm chart will install that into the cluster.
kubectl create namespace cover-service
helm upgrade --install shared-config infrastructure/shared-config --namespace cover-service --set es.storage.class="hostpath" --set redis.storage.class="hostpath"
helm upgrade --install cover-service infrastructure/cover-service --namespace cover-service --set hpa.enabled=false --set ingress.enableTLS=false --set ingress.enabled=false
The frontend is installed without ingress, so you need to create a port forward to access it.
kubectl port-forward service/cover-service-service 8081:80
You should be able to access the frontend at: http://localhost:8081
Handle vendor/cover imports into CoverService
helm install cover-service-db bitnami/mysql --namespace cover-service --set root.password=password --set db.user=db --set db.password=password --set db.name=db --set slave.replicas=0 --set metrics.enabled=false --set master.securityContext.enabled=false --set image.tag=5.7
kubectl port-forward service/cover-service-db-mysql 3306
Husk at updater secret filen under stg med db creds
helm upgrade --install cover-service-imports infrastructure/cover-service-importers/ --namespace cover-service --set app.db.server=cover-service-db-mysql --set app.db.database=db --set env=stg
The application is configured to default validate TLS certificates in production mode. So you need to disable this verification to connect to the database in this setup.
Run a shell inside the pod: kubectl exec -it cover-service-imports-importers sh
Edit doctrine configuration config/packages/prod/doctrine.yaml
file and change MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
to equal false
Husk at updater secret filen under stg med db creds
helm upgrade --install cover-service-upload infrastructure/cover-service-upload/ --namespace cover-service --set app.db.server=cover-service-db-mysql --set app.db.database=upload --set ingress.enabled=false --set env=stg
@TODO: change the MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
to false
.
kubectl port-forward service/cover-service-upload-service 8082:80
@TODO
helm upgrade --install cover-service-faktor infrastructure/cover-service-faktor/ --set ingress.enabled=false --set env=stg