All infrastructure scripts/automation will be organized here.
- Deploy networking, worker, controller VMs and setup application load balancer object to front data traffic.
- Setup k8s on controller and worker VMs
- Deploy application manifest on cluster
- gcloud cli tool
- gcloud ssh keys
- terraform
Run this command locally to provide access to API client library.
gcloud auth application-default login
- Edit setup.sh and modify the global variables on top
- Execute script using
bash setup.sh- script will provide name of the log file which you can track
tail -f run-*.log
- script will provide name of the log file which you can track
terraform destroy -var-file=deployment.tfvars -auto-approve
- access psql cli
sudo -u postgres psql - create pastav user
CREATE USER pastav WITH PASSWORD '***'; ALTER USER pastav WITH SUPERUSER; - change port and listen on all addresses
sudo -u postgres vim /etc/postgresql/12/main/postgresql.conflisten_addresses = '*' port = 8086 - allow login for user and from all IPs
sudo -u postgres vim /etc/postgresql/12/main/pg_hba.conflocal all pastav md5 host all all 0.0.0.0/0 md5
- add password
sudo -u redis vim /etc/redis/redis.conf- add
requirepass *** - change
bind 127.0.0.1 ::1tobind 0.0.0.0
- add
(routing-engine)
(api-server) (redis) (postgresql)
----------------- k8s -------------- -------- DB --------
[WORKER] [CONTROLLER] [DB VM]
+++++++++++++++++++++++++++++++++++ FW ++++++++++++++++++++++++++++++++++
================================GCP======================================
80 30000
user_req -> ALB -> [WORKER]
6969 8080 8080
(api-server) -> $routing-engine-svc$ -> (routing-enging)
sudo ss -tlnp
sudo systemctl status postgresql
sudo systemctl status redis
kubectl get pods
kubectl get svc
kubectl describe pod <pod-name>
kubectl logs <pod-name>
kubectl delete -f servers.yaml
kubectl apply -f servers.yaml