New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed "Deploy to Sandbox" scenario. #303
base: main
Are you sure you want to change the base?
Conversation
…tly into terraform file.
# Update and upgrade APT reop | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get -y update | ||
apt-get -y upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that we want to update all packages on startup? This is going to make the build less reproducible...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without update all packages, will cause the error on installation of some packages in later steps. This could be improved by updating newer version of OS image itself in future.
terraform/gce-vm/startup-script.sh
Outdated
echo "Installing prerequisites..." | ||
if ! command -v "kubectl" >/dev/null 2>&1; then | ||
echo "Installing kubectl..." | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | ||
else | ||
echo "kubectl already been installed. skip..." | ||
fi | ||
|
||
if ! command -v "gcloud" >/dev/null 2>&1; then | ||
echo "Installing gcloud..." | ||
apt-get install -y apt-transport-https ca-certificates gnupg | ||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list | ||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - | ||
apt-get update -y && apt-get install -y google-cloud-cli | ||
echo "gcloud installation completed" | ||
else | ||
echo "gcloud already been installed. skip..." | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the containerized versions for which we already have shell functions defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we can not use docker on this env because later anthos setup step will install container runtime by own. However there are few thoughts came out to mind that I can improve this step. Will revisit on next PR.
Hi @fakeskimo ! thanks for this PR. I added a couple of comments, but I didn't fully review this yet :) |
@ferrarimarco Just found that this PR should be made from different branch in the repo rather then from my fork. Should I closing this PR and create it from different branch in origin repo? or keep this PR? |
Fixed multiple issues on scripts and document for "Deploy to Sandbox" scenario.
Details in commit note, please let me know if you have further questions. Thanks - Junho