Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 86e3ee5

Browse files
author
jmusselwhite
committed
Fixing Jenkins related kubectl failures
1 parent 578cee8 commit 86e3ee5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

scripts/configs_and_secrets.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
# Here we are installing secrets into the Kubernetes cluster
1818
# Installing them into the cluster makes it very easy to access them from
1919
# the appliations in the cluster
20-
kubectl create secret generic cloudsql-sa-creds \
20+
kubectl --namespace default create secret generic cloudsql-sa-creds \
2121
--from-file=credentials.json=credentials.json
2222

23-
kubectl create secret generic pgadmin-console \
23+
kubectl --namespace default create secret generic pgadmin-console \
2424
--from-literal=user="$PG_ADMIN_CONSOLE_EMAIL" \
2525
--from-literal=password="$PG_ADMIN_CONSOLE_PASSWORD"
2626

@@ -30,5 +30,5 @@ CONNECTION_NAME=$(gcloud sql instances describe "$INSTANCE_NAME" \
3030
# You can also store non-sensitive information in the cluster
3131
# similar to a secret. In this case we are using a configMap, which
3232
# is also very easy to access from applications in the cluster
33-
kubectl create configmap connectionname \
33+
kubectl --namespace default create configmap connectionname \
3434
--from-literal=connectionname="$CONNECTION_NAME"

scripts/expose.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
# Cloud Load Balancer we are instead port-forwarding to the node and
1919
# exposing the pod port
2020

21-
POD_ID=$(kubectl get pods -o name | cut -d '/' -f 2)
22-
kubectl port-forward "$POD_ID" 8080:80
21+
POD_ID=$(kubectl --namespace default get pods -o name | cut -d '/' -f 2)
22+
kubectl --namespace default port-forward "$POD_ID" 8080:80

scripts/pgadmin_deployment.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
ROOT=$(dirname "${BASH_SOURCE[0]}")
2222

23-
kubectl create -f "$ROOT"/../manifests/pgadmin-deployment.yaml
23+
kubectl --namespace default create -f "$ROOT"/../manifests/pgadmin-deployment.yaml
2424

2525
# Waiting for the pod to actually deploy correctly
26-
kubectl rollout status -f "$ROOT"/../manifests/pgadmin-deployment.yaml
26+
kubectl --namespace default rollout status -f "$ROOT"/../manifests/pgadmin-deployment.yaml

validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fi
5353
# This method involves giving the 'get' command the same manifest used to
5454
# create the object. It will find an object matching
5555
# the description in the manifest
56-
if ! kubectl get -f "$ROOT"/manifests/pgadmin-deployment.yaml > /dev/null; then
56+
if ! kubectl --namespace default get -f "$ROOT"/manifests/pgadmin-deployment.yaml > /dev/null; then
5757
echo "FAIL: pgAdmin4 Deployment object does not exist"
5858
else
5959
echo "pgAdmin4 Deployment object exists"

0 commit comments

Comments
 (0)