-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes and instructions for Todolist + log4shell on K8s
- Loading branch information
Eric Smalling
committed
Dec 21, 2021
1 parent
c9735dd
commit 47172b1
Showing
13 changed files
with
165 additions
and
9 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 @@ | ||
todolist-goof/k8s/eks-calico.sh |
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,10 @@ | ||
#!/usr/bin/env bash | ||
TOP_LEVEL_MYDIR=$(dirname $0) | ||
if [[ "$1" == "" ]]; then | ||
read -e -i "${DOCKER_ACCOUNT}" -p "Please enter your DockerHub user/account name: " input | ||
name="${input:-$DOCKER_ACCOUNT}" | ||
else | ||
DOCKER_ACCOUNT=$1 | ||
fi | ||
$TOP_LEVEL_MYDIR/todolist-goof/k8s/quickstart.sh $DOCKER_ACCOUNT | ||
$TOP_LEVEL_MYDIR/log4shell-goof/log4shell-server/k8s/quickstart.sh $DOCKER_ACCOUNT |
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,4 @@ | ||
#!/usr/bin/env bash | ||
TOP_LEVEL_MYDIR=$(dirname $0) | ||
$TOP_LEVEL_MYDIR/todolist-goof/k8s/shutdown.sh | ||
$TOP_LEVEL_MYDIR/log4shell-goof/log4shell-server/k8s/shutdown.sh |
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,13 @@ | ||
#!/usr/bin/env bash | ||
LOG4SHELL_MYDIR=$(dirname $0) | ||
if [[ "$1" == "" ]]; then | ||
read -e -i "${DOCKER_ACCOUNT}" -p "Please enter your DockerHub user/account name: " input | ||
name="${input:-$DOCKER_ACCOUNT}" | ||
else | ||
DOCKER_ACCOUNT=$1 | ||
fi | ||
|
||
$LOG4SHELL_MYDIR/imagebuild.sh $DOCKER_ACCOUNT | ||
$LOG4SHELL_MYDIR/startup.sh $DOCKER_ACCOUNT | ||
|
||
|
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
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,3 @@ | ||
#!/bin/bash | ||
kubectl apply -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/config/master/calico-operator.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/config/master/calico-crs.yaml |
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
#!/usr/bin/env bash | ||
read -e -i "${DOCKER_ACCOUNT}" -p "Please enter your DockerHub user/account name: " input | ||
name="${input:-$DOCKER_ACCOUNT}" | ||
MYDIR=$(dirname $0) | ||
if [[ "$1" == "" ]]; then | ||
read -e -i "${DOCKER_ACCOUNT}" -p "Please enter your DockerHub user/account name: " input | ||
name="${input:-$DOCKER_ACCOUNT}" | ||
else | ||
DOCKER_ACCOUNT=$1 | ||
fi | ||
|
||
echo "📦 Building image ${DOCKER_ACCOUNT}/java-goof:latest ..." | ||
docker build -t ${DOCKER_ACCOUNT}/java-goof:latest . | ||
docker build -t ${DOCKER_ACCOUNT}/java-goof:latest $MYDIR/.. | ||
echo | ||
echo "🚚 Pushing image to DockerHub..." | ||
docker push ${DOCKER_ACCOUNT}/java-goof:latest |
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,42 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: goof | ||
name: goof | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: goof | ||
template: | ||
metadata: | ||
labels: | ||
app: goof | ||
spec: | ||
containers: | ||
- image: ${DOCKER_ACCOUNT}/java-goof:latest | ||
imagePullPolicy: Always | ||
name: java-goof | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 65534 #nobody | ||
runAsGroup: 65534 #nobody | ||
restartPolicy: Always | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: goof | ||
name: goof | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: goof |
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,13 @@ | ||
#!/usr/bin/env bash | ||
TODO_MYDIR=$(dirname $0) | ||
if [[ "$1" == "" ]]; then | ||
read -e -i "${DOCKER_ACCOUNT}" -p "Please enter your DockerHub user/account name: " input | ||
name="${input:-$DOCKER_ACCOUNT}" | ||
else | ||
DOCKER_ACCOUNT=$1 | ||
fi | ||
|
||
$TODO_MYDIR/imagebuild.sh $DOCKER_ACCOUNT | ||
$TODO_MYDIR/startup.sh $DOCKER_ACCOUNT | ||
|
||
|
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