Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 2c3ccde

Browse files
committed
Cleanup
1 parent f492395 commit 2c3ccde

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Before starting the installation process, you need:
66

77
- A GCP account with Administrator access
8-
- [Create one now by clicking here](https://console.cloud.google.com/)
9-
- GCP credentials set up.
8+
- [Create one now by clicking here](https://console.cloud.google.com/freetrial)
9+
- GCP credentials set up. Install [gcloud](https://cloud.google.com/sdk/docs/install)
1010
- A `.env` file with basic details about the environment.
1111
- We provide an example of such file [here](.env.example).
1212
- [Docker](https://docs.docker.com/engine/install/) installed on your machine, or better, a Gitpod workspace :)
@@ -19,15 +19,15 @@ make install
1919

2020
The whole process takes around twenty minutes. In the end, the following resources are created:
2121

22-
- a GKE cluster running Kubernetes v1.21
23-
- GCP L4 load balancer
24-
- Cloud SQL Mysql database
25-
- Cloud DNS zone
26-
- In-cluster docker registry using [Cloud Storage](https://cloud.google.com/storage) as storage backend
27-
- [calico](https://docs.projectcalico.org) as CNI and NetworkPolicy implementation
28-
- [cert-manager](https://cert-manager.io/) for self-signed SSL certificates
29-
- [Jaeger operator](https://github.com/jaegertracing/helm-charts/tree/main/charts/jaeger-operator) - and Jaeger deployment for gitpod distributed tracing
30-
- [gitpod.io](https://github.com/gitpod-io/gitpod) deployment
22+
- a GKE cluster running Kubernetes v1.21 ([rapid channel](https://cloud.google.com/kubernetes-engine/docs/release-notes-rapid)).
23+
- GCP L4 load balancer.
24+
- Cloud SQL - Mysql database.
25+
- Cloud DNS zone.
26+
- In-cluster docker registry using [Cloud Storage](https://cloud.google.com/storage) as storage backend.
27+
- [calico](https://docs.projectcalico.org) as CNI and NetworkPolicy implementation.
28+
- [cert-manager](https://cert-manager.io/) for self-signed SSL certificates.
29+
- [Jaeger operator](https://github.com/jaegertracing/helm-charts/tree/main/charts/jaeger-operator) - and Jaeger deployment for gitpod distributed tracing.
30+
- [gitpod.io](https://github.com/gitpod-io/gitpod) deployment.
3131

3232
## Verify the installation
3333

@@ -52,8 +52,6 @@ ws-manager-bridge-79f7fcb5-7w4p5 1/1 Running 0 6m16s
5252
ws-proxy-7fc9665-rchr9 1/1 Running 0 5m57s
5353
```
5454

55-
TODO: add additional `kubectl log` commands
56-
5755
### Test Gitpod workspaces
5856

5957
When the provisioning and configuration of the cluster is done, the script shows the URL of the load balancer,

images/gitpod-login.png

93 KB
Loading

setup.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ function setup_mysql_database() {
104104
--replica-type=FAILOVER \
105105
--enable-bin-log
106106

107+
gcloud sql instances patch "${MYSQL_INSTANCE_NAME}" --database-flags \
108+
explicit_defaults_for_timestamp=off
109+
107110
echo "Creating gitpod Mysql database..."
108111
gcloud sql databases create gitpod --instance="${MYSQL_INSTANCE_NAME}"
109112
fi
@@ -355,6 +358,17 @@ function install() {
355358
setup_mysql_database
356359
install_jaeger_operator
357360
install_gitpod
361+
362+
LB_IP_ADDRESS=$(kubectl get ingress gitpod -o json | jq -r .status.loadBalancer.ingress[0].ip)
363+
if [ -n "${LB_IP_ADDRESS}" ];then
364+
printf '\nLoad balancer IP address: %s\n' "${LB_IP_ADDRESS}"
365+
fi
366+
367+
}
368+
369+
function setup_kubectl() {
370+
gcloud config set project "${PROJECT_NAME}"
371+
gcloud container clusters get-credentials --region="${REGION}" "${CLUSTER_NAME}"
358372
}
359373

360374
function uninstall() {
@@ -363,6 +377,7 @@ function uninstall() {
363377
read -p "Are you sure you want to delete: Gitpod (y/n)? " -n 1 -r
364378
if [[ $REPLY =~ ^[Yy]$ ]]; then
365379
set +e
380+
setup_kubectl
366381
echo "Deleting IAM service accounts credential files..."
367382
rm -rf dns-credentials.json gs-credentials.json mysql-credentials.json
368383
kubectl delete secret clouddns-dns01-solver-svc-acct gcloud-sql-token remote-storage-gcloud gitpod-image-pull-secret
@@ -379,7 +394,10 @@ function uninstall() {
379394
gcloud iam service-accounts delete "${OBJECT_STORAGE_SA_EMAIL}" --quiet
380395
gcloud iam service-accounts delete "${MYSQL_SA_EMAIL}" --quiet
381396

382-
printf "\n%s\n" "Please make sure to delete the project ${PROJECT_NAME}"
397+
printf "\n%s\n" "Please make sure to delete the project ${PROJECT_NAME} and services:"
398+
printf "%s\n" "- https://console.cloud.google.com/sql/instances?project=${PROJECT_NAME}"
399+
printf "%s\n" "- https://console.cloud.google.com/storage/browser?project=${PROJECT_NAME}"
400+
printf "%s\n" "- https://console.cloud.google.com/net-services/dns/zones?project=${PROJECT_NAME}"
383401
fi
384402
}
385403

@@ -390,8 +408,7 @@ function auth() {
390408
exit 1
391409
fi
392410

393-
gcloud config set project "${PROJECT_NAME}"
394-
gcloud container clusters get-credentials --region="${REGION}" "${CLUSTER_NAME}"
411+
setup_kubectl
395412

396413
echo "Using the auth providers configuration file: ${AUTHPROVIDERS_CONFIG}"
397414
# Patching the configuration with the user auth provider/s

0 commit comments

Comments
 (0)