-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Victor Yang
committed
Jul 10, 2021
1 parent
59d0afa
commit 5919806
Showing
3 changed files
with
68 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
# "---------------------------------------------------------" | ||
# "- -" | ||
# "- Create starts a GKE Cluster -" | ||
# "- -" | ||
# "---------------------------------------------------------" | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
set -x | ||
|
||
|
||
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )" | ||
source "$PROJECT_ROOT"/common/functions.sh | ||
|
||
export GCP_REGION="us-west1" | ||
export GKE_CLUSTER_NAME="west1-001" | ||
export GKE_CLUSTER_CHANNEL="None" | ||
export NETWORK_NAME="ignw-pod" | ||
|
||
|
||
# enable APIs | ||
gcloud services enable compute.googleapis.com \ | ||
container.googleapis.com | ||
|
||
# create cluster | ||
gcloud container --project $PROJECT_ID clusters create $GKE_CLUSTER_NAME \ | ||
--region $GCP_REGION \ | ||
--num-nodes 1 \ | ||
--enable-ip-alias \ | ||
--release-channel $GKE_CLUSTER_CHANNEL | ||
|
||
gcloud container clusters get-credentials "$GKE_CLUSTER_NAME" --region $GCP_REGION |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
# "---------------------------------------------------------" | ||
# "- -" | ||
# "- check audit log -" | ||
# "- -" | ||
# "---------------------------------------------------------" | ||
|
||
set -euo pipefail | ||
|
||
|
||
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )" | ||
source "$PROJECT_ROOT"/common/functions.sh | ||
|
||
# get k8s.io audit log | ||
# gcloud logging read \ | ||
# "logName=projects/${PROJECT_ID}/logs/cloudaudit.googleapis.com%2Factivity AND protoPayload.serviceName="k8s.io" " \ | ||
# --limit 2 --freshness 300d | ||
|
||
set -x | ||
gcloud logging read \ | ||
"logName=projects/${PROJECT_ID}/logs/cloudaudit.googleapis.com%2Factivity resource.type=k8s_cluster \ | ||
protoPayload.resourceName:certificates.k8s.io/v1beta1/certificatesigningrequests" \ | ||
--limit 2 --freshness 300d |