Last active
August 5, 2022 01:13
-
-
Save vfarcic/37b3ef7afeaf9237aeb2b9a8065b10c3 to your computer and use it in GitHub Desktop.
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
# Source: https://gist.github.com/37b3ef7afeaf9237aeb2b9a8065b10c3 | |
cd k8s-specs | |
git pull | |
minikube start --vm-driver=virtualbox | |
kubectl config current-context | |
kubectl create \ | |
-f secret/jenkins-unprotected.yml \ | |
--save-config | |
kubectl rollout status deploy jenkins | |
open "http://$(minikube ip)/jenkins" | |
kubectl get secrets | |
kubectl describe pods | |
POD_NAME=$(kubectl get pods \ | |
-l service=jenkins,type=master \ | |
-o jsonpath="{.items[*].metadata.name}") | |
kubectl exec -it $POD_NAME -- ls \ | |
/var/run/secrets/kubernetes.io/serviceaccount | |
kubectl create secret \ | |
generic my-creds \ | |
--from-literal=username=jdoe \ | |
--from-literal=password=incognito | |
kubectl get secrets | |
kubectl get secret my-creds -o json | |
kubectl get secret my-creds \ | |
-o jsonpath="{.data.username}" \ | |
| base64 --decode | |
kubectl get secret my-creds \ | |
-o jsonpath="{.data.password}" \ | |
| base64 --decode | |
cat secret/jenkins.yml | |
kubectl apply -f secret/jenkins.yml | |
kubectl rollout status deploy jenkins | |
POD_NAME=$(kubectl get pods \ | |
-l service=jenkins,type=master \ | |
-o jsonpath="{.items[*].metadata.name}") | |
kubectl exec -it $POD_NAME \ | |
-- ls /etc/secrets | |
kubectl exec -it $POD_NAME \ | |
-- cat /etc/secrets/jenkins-user | |
open "http://$(minikube ip)/jenkins" | |
minikube delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment