Skip to content

Commit

Permalink
fix: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
DiCanio committed Mar 18, 2024
1 parent 2686b6a commit f3767d7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
10 changes: 5 additions & 5 deletions k8s/broker-db-statefulset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ spec:
requests:
memory: "256Mi"
limits:
memory: "512Mi"
cpu: "500m"
memory: "1Gi"
cpu: "1"
readinessProbe:
exec:
command:
Expand All @@ -55,8 +55,8 @@ spec:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
initialDelaySeconds: 10
timeoutSeconds: 15
initialDelaySeconds: 30
livenessProbe:
exec:
command:
Expand All @@ -67,7 +67,7 @@ spec:
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
timeoutSeconds: 15

volumeMounts:
- name: storage
Expand Down
10 changes: 7 additions & 3 deletions k8s/broker-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
secretKeyRef:
name: hub-auth
key: robot-secret
# DO NOT USE THIS IN PRODUCTION!!! This is just for internal testing purposes.
- name: NODE_TLS_REJECT_UNAUTHORIZED
value: "0"
resources:
requests:
memory: "256Mi"
Expand All @@ -61,11 +64,12 @@ spec:
httpGet:
path: "/health"
port: 8080
initialDelaySeconds: 5
initialDelaySeconds: 60
periodSeconds: 5
timeoutSeconds: 10
livenessProbe:
httpGet:
path: "/health"
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
periodSeconds: 10
timeoutSeconds: 10
28 changes: 17 additions & 11 deletions k8s/deploy-to-minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,23 @@
# - HUB_AUTH_ROBOT_ID
# - ROBOT_SECRET
# - NODE_MESSAGE_BROKER_HOST
# - NAMESPACE

BASE_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit 1 ; pwd -P )"

echo "${AUTH_JWKS_URL}"
echo "${HUB_AUTH_ROBOT_ID}"
echo "${ROBOT_SECRET}"
echo "${NODE_MESSAGE_BROKER_HOST}"

if [[ -z "${AUTH_JWKS_URL}" || -z "${HUB_AUTH_ROBOT_ID}" || -z "${ROBOT_SECRET}" || -z "${NODE_MESSAGE_BROKER_HOST}" ]]; then
if [[ -z "${AUTH_JWKS_URL}" || -z "${HUB_AUTH_ROBOT_ID}" || -z "${ROBOT_SECRET}" || -z "${NODE_MESSAGE_BROKER_HOST}" || -z "${NAMESPACE}" ]]; then
echo "One or more mandatory environment variables are not set!"
echo "Mandatory environment variables are:"
echo ""
echo " - AUTH_JWKS_URL"
echo " - HUB_AUTH_ROBOT_ID"
echo " - ROBOT_SECRET"
echo " - NODE_MESSAGE_BROKER_HOST"
echo " - NAMESPACE"
exit 1
fi

echo -n "Creating working directory..."
echo -n "Creating temporary working directory..."
WORK_DIR=`mktemp -d -p "${BASE_DIR}"`
if [ $? -ne 0 ]; then
echo "FAILED"
Expand Down Expand Up @@ -78,7 +75,7 @@ fi


echo -n "Deleting previous image..."
minikube image rm docker.io/flame/node-message-broker:latest
minikube image rm docker.io/flame/node-message-broker:latest >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "FAILED"
exit 7
Expand All @@ -87,7 +84,7 @@ else
fi

echo -n "Creating Docker image..."
minikube image build -t docker.io/flame/node-message-broker:latest "${BASE_DIR}/.."
minikube image build -t docker.io/flame/node-message-broker:latest "${BASE_DIR}/.." >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "FAILED"
exit 8
Expand All @@ -97,15 +94,24 @@ fi

echo -n "Applying manifest files..."
# TODO: make namespace adjustable!!!
kubectl --namespace=flame apply -f "${WORK_DIR}/hub-auth-secret.yml" \
kubectl --namespace "${NAMESPACE}" apply -f "${WORK_DIR}/hub-auth-secret.yml" \
-f "${WORK_DIR}/broker-db-service.yml" \
-f "${WORK_DIR}/broker-db-statefulset.yml" \
-f "${WORK_DIR}/broker-service.yml" \
-f "${WORK_DIR}/broker-deployment.yml" \
-f "${WORK_DIR}/ingress.yml"
-f "${WORK_DIR}/ingress.yml" >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "FAILED"
exit 9
else
echo "OK"
fi

echo -n "Deleting temporary working directory..."
rm -Rf "${WORK_DIR}"
if [ $? -ne 0 ]; then
echo "FAILED"
exit 10
else
echo "OK"
fi

0 comments on commit f3767d7

Please sign in to comment.