-
Notifications
You must be signed in to change notification settings - Fork 1
/
commands.txt
27 lines (17 loc) · 1.92 KB
/
commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Install monitoring metrics agent on vm instance
gcloud beta compute ssh metric-test-instance --project=steam-kingdom-311415 --zone=us-central1-a --command="curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh && sudo bash add-monitoring-agent-repo.sh && sudo apt-get update && sudo apt-get install stackdriver-agent && sudo service stackdriver-agent start"
# Get the associated roles to the service account
gcloud projects get-iam-policy steam-kingdom-311415 --flatten="bindings[].members" --format='table(bindings.role)' --filter="bindings.members:custom-metrics-sa@steam-kingdom-311415.iam.gserviceaccount.com"
## Result
```
ROLE
roles/editor
roles/monitoring.metricWriter
roles/secretmanager.secretAccessor
```
logName:("projects/steam-kingdom-311415/logs/compute.googleapis.com%2Fvpc_flows") AND resource.labels.subnetwork_id:(8603958913247682994)
docker run --name studyjamflaskapp -d -e GOOGLE_APPLICATION_CREDENTIALS=/home/george/Documents/study-jam-docs/cohort-team2/steam-kingdom-311415-d40b597ea6e4.json -v /home/george/Documents/study-jam-docs/cohort-team2/steam-kingdom-311415-d40b597ea6e4.json:/tmp/keys/steam-kingdom-311415-d40b597ea6e4.json:ro -p 80:80 gcr.io/steam-kingdom-311415/studyjamimage:v1
# Docker run command to mount multiple volumes
docker run --name studyjamflaskapp-withcert -d --network host -e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/steam-kingdom-311415-d40b597ea6e4.json -v /home/george/Documents/study-jam-docs/cohort-team2/steam-kingdom-311415-d40b597ea6e4.json:/tmp/keys/steam-kingdom-311415-d40b597ea6e4.json:ro -v /home/george/Documents/study-jam-docs/cohort-team2/round8/app/local.crt:/tmp/keys/local.crt:ro -v /home/george/Documents/study-jam-docs/cohort-team2/round8/app/local.key:/tmp/keys/local.key:ro gcr.io/steam-kingdom-311415/studyjamimage:v1
# Command to create self signed certificates on linux systems
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout local.key -out local.crt