Deploy on Ubuntu 20.04
- Create MySQL Database
CREATE DATABASE `ads` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
- set timezone
default_time_zone = +08:00
- init database tables
mysql -u user -p password ads < sql/ads.sql
- insert test data
INSERT INTO ads.solution (id,name,url) VALUES('vm-test','VM-test','https://github.com/hellof20/tf-tutorial.git');
INSERT INTO ads.parameters (id,name,solution_id,description,example,show_on_ui,`type`,default_value) VALUES('network','GCP Network','vm-test','GCP Network','default',1,'string',NULL),('project_id','Project ID','vm-test','GCP Project ID','pangu-test-1',1,'string',NULL);
INSERT INTO ads.permission (scope) VALUES ('openid'),('https://www.googleapis.com/auth/userinfo.email'),('https://www.googleapis.com/auth/compute'),('https://www.googleapis.com/auth/cloud-platform'),('https://www.googleapis.com/auth/drive'),('https://www.googleapis.com/auth/appengine.admin');
- Generate client_secret.json
- Put your client_secret.json to google-ads-solution folder
docker run -itd --name ads-dev -p 8080:8080 -v "$(pwd)/client_secret.json:/app/client_secret.json:ro" -v ads-volume:/data/pangu -e host=10.128.0.45 -e user=pwm -e password=szcb__123 -e db=ads hellof20/ads-dev:v0.9
modify the host, user and password
- create secret for client_secret.json
kubectl create configmap ads-dev-client-secret --from-file=client_secret.json
- create TLS (You need your tls certificate)
kubectl create secret tls joey618-top --key privkey.pem --cert fullchain.pem
- create mysql configmap
kubectl create configmap mysql-config --from-literal=host=192.168.158.3 --from-literal=user=root --from-literal=password=pangu__123 --from-literal=db=ads
- deploy
kubectl apply -f ads.yaml
- get external ip address
kubectl get ingress
-
domain resolve
-
add you redict url to client secret
https://your_dns_record/oauth2callback
- access https://your_dns_record