pomo
pomo

Reputation: 2301

how to deploy a private github repo to a GCE cluster

I'm trying to deploy my app to a google compute engine cluster. I followed the example which sets up the cluster and creates a start script for each vm instance.

The example start script doesn't use github though.

What I would like to do is have the start script check out the project from my private github repo (if it's not already there).

I have created a deployment ssh key which I've added to my git repo's "Deploy keys".

The problems I have are:

Upvotes: 2

Views: 809

Answers (1)

howie
howie

Reputation: 2685

Read this adding-removing-ssh-keys to setup project-wide public SSH keys from a Linux instance.

First, To allow project-wide public SSH keys, set the metadata value to FALSE

gcloud compute instances add-metadata [INSTANCE_NAME] --metadata block-project-ssh-keys=FALSE

In the command prompt, use the compute instances add-metadata command to set the instance-only ssh-key value. Include the --metadata-from-file flag and specify the path to the public key file list that you made.

gcloud compute instances add-metadata [INSTANCE_NAME] --metadata-from-file ssh-keys=[LIST_PATH]

For your second question: Non interactive git clone (ssh fingerprint prompt)

Upvotes: 1

Related Questions