Skip to content

Commit a9ca46d

Browse files
committed
upding kubectl
1 parent 71cd1f5 commit a9ca46d

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ A place to quickly lookup commands ( bash, Vim, git, AWS, Docker, Terraform, Ans
99
- [x] [Docker](/docker.sh)
1010
- [x] [Terraform](/terraform.sh)
1111
- [x] [Ansible](/ansible.sh)
12-
- [x] [Kubernetes](/k8s.sh)
12+
- [x] [Kubernetes](/kubectl.sh) (Includes steps for running a simple container)
13+
- [ ] Chaos Experiments (Litmus)
1314
- [x] [Hacking tool cheat sheet from compass security](https://blog.compass-security.com/2019/10/hacking-tools-cheat-sheet/)
1415

1516
## Additional Resources

k8s.sh renamed to kubectl.sh

+15
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,18 @@ kubectl cluster-info dump --output-directory=/path/to/cluster-state # Dump cur
236236
kubectl taint nodes foo dedicated=special-user:NoSchedule
237237

238238

239+
######################
240+
#Running a simple container
241+
######################
242+
1. Create a deployment: > kubectl create deployment --image nginx <name>
243+
2. List pods: > kubectl get pods
244+
3. View Deployment: > kubectl get deployment
245+
4. Scale Deployment: > kubectl scale deployment --replicas 2 <name>
246+
5. List pods to check they are running: > kubectl get pods
247+
6. Expose to internet: kubectl expose deployment <name> --port=80 --type=LoadBalancer
248+
7. View Service created: > kubectl get services or > kubectl get service -o wide
249+
8. If External-IP is <pending> state run: > kubectl describe svc <service-name> check under events. If none run a patch: > kubectl patch svc test -p '{"spec":{"type": "LoadBalancer","externalIPs":["127.0.0.1"]}}'
250+
9. Configure Cloud controller Manager to see External IP #TODO
251+
10. Cleanup deployments: > kubectl delete deployment <name>
252+
11. Cleanup Services: > kubectl delete svc <name>
253+

litmus.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
######################
2+
#Demo Litmus experiment on nginx pod
3+
######################
4+
1.

0 commit comments

Comments
 (0)