Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

fakeskimo
Copy link

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

@fakeskimo fakeskimo added bug Something isn't working terraform Pull requests that update Terraform code labels Mar 7, 2024
# Update and upgrade APT reop
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y upgrade
Copy link
Member

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...

Copy link
Author

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.

Comment on lines 25 to 43
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
Copy link
Member

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?

Copy link
Author

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.

@ferrarimarco
Copy link
Member

Hi @fakeskimo ! thanks for this PR.

I added a couple of comments, but I didn't fully review this yet :)

@fakeskimo
Copy link
Author

fakeskimo commented Mar 7, 2024

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working terraform Pull requests that update Terraform code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants