I had a little free time on hand and saw an e-mail by CSIT on a new mini-challenge. Since this topic is on Cloud Infrastructure, my domain, how could I miss it? 😄
The Challenge
Background
Tools for this challenge
This challenge is using killercoda for simulation where you get an environment for 1 hour to simulate the tasks. Cool!
Task 1: The Murder Weapon
The first task is pretty easy. Just use the command below to create a deployment. The -n default is kind of redundant as kubectl will default to the default namespace if -n is not specified.
kubectl create deployment investigation-unit --image=sachua/task-1:v0.0.1 -n default
Output:
The command to retrieve flag is already given, just copy and paste 😄
kubectl logs -n default deployment/investigation-unit | sed 's/.*: //'
Output:
Task 2: An Elusive Fingerprint
We will need to create 3 files for this Task:
- pv.yaml (Persistent Volume)
- pvc.yaml (Persistent Volume Claim)
- deployment.yaml (Deployment)
Then we need to create the resources:
kubectl apply -f pv.yaml
kubectl apply -f pvc.yaml
kubectl apply -f deployment.yaml
Output:
We will see the logs of this pod to see what's inside.
Output:
Task 3: Identify The Culprit
First, we will create a deployment named "command-center":
kubectl create deployment command-center --image=sachua/task-3:v0.0.1 -n default
Output:
Then, we need to create the service yaml files:
- investigation-unit-svc.yaml
- analysis-unit-svc.yaml
kubectl create svc clusterip investigation-unit --tcp=80:80 --dry-run=client -o yaml > investigation-unit-svc.yaml
kubectl create svc clusterip analysis-unit --tcp=80:80 --dry-run=client -o yaml > analysis-unit-svc.yaml
Then create the 2 services:
kubectl apply -f analysis-unit-svc.yaml
kubectl apply -f investigation-unit-svc.yaml
Output:
Retrieve the flag by running the command!
kubectl logs -n default deployment/command-center | grep -im 1 culprit | sed 's/.*: //'
Output: