-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying docker image as quick demo on GCE (#25)
* Added instructions to run Apigee kickstart with docker image on GCE
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,67 @@ Navigate to `localhost:8080` and you will see an Apigee Portal installed with de | |
|
||
Default admin credentials for the portal are: `[email protected]` and `pass`, but you can change these in `apigee.env`. | ||
|
||
## Demo Apigee Kickstart on Google Compute instance with docker image | ||
1. Setup variables | ||
``` | ||
export PROJECT_NAME=gcp-project-1 | ||
export ZONE=us-central1-a | ||
export VM_NAME=apigee-portal-server | ||
export FIREWALL_NAME=apigee-portal-server-fw | ||
``` | ||
2. Create a GCE VM instance with `container-optimized-os` image and create a firewall rule to allow HTTP traffic to this VM. | ||
``` | ||
gcloud compute instances create $VM_NAME \ | ||
--project=$PROJECT_NAME \ | ||
--zone=$ZONE \ | ||
--machine-type=e2-medium \ | ||
--network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default \ | ||
--no-restart-on-failure \ | ||
--maintenance-policy=TERMINATE \ | ||
--provisioning-model=SPOT \ | ||
--instance-termination-action=STOP \ | ||
--scopes=https://www.googleapis.com/auth/cloud-platform \ | ||
--tags=drupal-server,http-server \ | ||
--create-disk=auto-delete=yes,boot=yes,device-name=$VM_NAME,image=projects/cos-cloud/global/images/family/cos-stable,mode=rw,size=10,type=projects/$PROJECT_NAME/zones/$ZONE/diskTypes/pd-balanced \ | ||
--no-shielded-secure-boot \ | ||
--shielded-vtpm \ | ||
--shielded-integrity-monitoring \ | ||
--labels=goog-ec-src=vm_add-gcloud \ | ||
--reservation-affinity=any | ||
|
||
gcloud compute --project=$PROJECT_NAME firewall-rules create $FIREWALL_NAME --direction=INGRESS \ | ||
--priority=1000 --network=default --action=ALLOW --rules=tcp:80 --source-ranges=0.0.0.0/0 \ | ||
--target-tags=drupal-server | ||
|
||
``` | ||
|
||
3. SSH into the VM and run commands in next step | ||
``` | ||
gcloud compute ssh $VM_NAME --zone=$ZONE --project=$PROJECT_NAME | ||
``` | ||
|
||
4. Login into the GCE instance and run the following commands | ||
``` | ||
wget https://gist.githubusercontent.com/giteshk/35875a36decd24c61a9d0fb5c6afad42/raw/6c0ec1d4dc1c0d16e42d971404509f53628ec4da/startup.sh | ||
chmod +x startup.sh | ||
bash ./startup.sh | ||
``` | ||
|
||
5. Run through the Drupal installation wizard @ http://GCE-INSTANCE-EXTERNAL-IP | ||
External IP can be located using : | ||
``` | ||
gcloud compute instances describe $VM_NAME \ | ||
--format='get(networkInterfaces[0].accessConfigs[0].natIP)' \ | ||
--zone=$ZONE --project=$PROJECT_NAME | ||
``` | ||
|
||
6. Clean up commands: | ||
``` | ||
gcloud compute --project=$PROJECT_NAME firewall-rules delete $FIREWALL_NAME --quiet | ||
gcloud compute instances delete $VM_NAME --project=$PROJECT_NAME --zone=$ZONE --quiet | ||
``` | ||
|
||
|
||
## Disclaimer | ||
|
||
This is not an official Google Product. |