Skip to content

Commit 8ef5675

Browse files
authored
Make kCTF use a private cluster (google#41)
1 parent ab33850 commit 8ef5675

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

infrastructure/kctf/config/daemon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
effect: NoSchedule
2020
containers:
2121
- name: ctf-daemon
22-
image: google/apparmor-loader:latest
22+
image: eu.gcr.io/google_containers/apparmor-loader
2323
securityContext:
2424
privileged: true
2525
command: ["sh", "-c", "while true; do for f in /profiles/*; do echo \"loading $f\"; apparmor_parser -r $f; sleep 30; done; done"]

infrastructure/kctf/scripts/cluster/start.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ MAX_NODES="8"
1111
NUM_NODES="4"
1212
MACHINE_TYPE="n1-standard-1"
1313

14-
gcloud container clusters create --enable-network-policy --enable-autoscaling --min-nodes ${MIN_NODES} --max-nodes ${MAX_NODES} --num-nodes ${NUM_NODES} --enable-autorepair --preemptible --machine-type ${MACHINE_TYPE} ${CLUSTER_NAME}
14+
gcloud container clusters create --enable-network-policy --enable-autoscaling --min-nodes ${MIN_NODES} --max-nodes ${MAX_NODES} --num-nodes ${NUM_NODES} --create-subnetwork name=kctf-${CLUSTER_NAME}-subnet --no-enable-master-authorized-networks --enable-ip-alias --enable-private-nodes --master-ipv4-cidr 172.16.0.32/28 --enable-autorepair --preemptible --machine-type ${MACHINE_TYPE} ${CLUSTER_NAME}
15+
16+
gcloud compute routers create kctf-${CLUSTER_NAME}-nat-router --network=default --region ${ZONE::-2}
17+
gcloud compute routers nats create kctf-${CLUSTER_NAME}-nat-config --router-region europe-west4 --router kctf-${CLUSTER_NAME}-nat-router --nat-all-subnet-ip-ranges --auto-allocate-nat-external-ips
1518

1619
get_cluster_creds
1720

infrastructure/kctf/scripts/cluster/stop.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ source "${DIR}/scripts/lib/config.sh"
77
load_config
88

99
gcloud container clusters delete ${CLUSTER_NAME}
10+
gcloud compute routers delete kctf-${CLUSTER_NAME}-nat-router --region ${ZONE::-2}

infrastructure/kctf/scripts/setup/config-create.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ mkdir -p "${CONFIG_DIR}"
1010

1111
CHAL_DIR=""
1212
PROJECT=""
13-
ZONE="europe-west3-c"
14-
CLUSTER_NAME="ctf-cluster-eu"
13+
ZONE="europe-west4-b"
14+
CLUSTER_NAME="kctf-cluster"
1515
DOMAIN_NAME=""
1616

1717
config=""

0 commit comments

Comments
 (0)