Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nayan32biswas/kubernetes-tutorial
https://github.com/nayan32biswas/kubernetes-tutorial
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nayan32biswas/kubernetes-tutorial
- Owner: nayan32biswas
- Created: 2023-10-18T14:28:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-19T16:46:51.000Z (about 1 year ago)
- Last Synced: 2023-10-19T17:44:10.407Z (about 1 year ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Kubernetes Examples
## Configuration
### Start the app
- `minikube start`
- `kubectl apply -f infra/`
- `kubectl get all` Make sure everything running.
- `kubectl get ingress mongodb-ingress` Get `IP_ADDRESS` address of running ingress.
- `sudo vi /etc/hosts` Add ` localhost-app.com` in the end of the file.
- [Visit the app](http://localhost-dashboard.com)**User:** `admin` **Pass:** `pass`
### Start Kubernetes Dashboard
- `minikube dashboard` Enable dashboard.
### Delete configuration
- `kubectl delete -f infra/`
## Basic command
### Minikube
- `minikube start`
- `minikube stop`
- `minikube addons enable ingress` Add default nginx-ingress. You can enable other implementation.### kubectl get
- `kubectl get all`
- `kubectl get all | grep ` Get all configuration with a single command.
- `kubectl get pod`
- `kubectl get deployment`
- `kubectl get service`
- `kubectl get secret`
- `kubectl get configmap`
- `kubectl get ns`
- `kubectl get ingress`### kubectl delete
- `kubectl delete pod`
- `kubectl delete deployment`
- `kubectl delete service`
- `kubectl delete secret`
- `kubectl delete configmap`
- `kubectl delete ns`
- `kubectl delete ingress`### Secret
- `kubectl apply -f ./infra/mongo-secret.yaml` Create secret.
- `kubectl get secret` To see created secret.
- `kubectl apply -f ./infra/mongo-configmap.yaml` Create secret.
- `kubectl get configmap` To see created configmap.### Deployment and Service
- `kubectl apply -f ./infra/mongo.yaml`
- `kubectl apply -f ./infra/mongo-express.yaml`
- `kubectl describe service mongodb-service` Get details of the create service. Note Endpoints IP.
- `kubectl get pod -o wide` Cross check if of the created pod and Endpoints IP of service.### Namespace
- `kubectl create namespace custom-namespace`
- `kubectl delete namespace custom-namespace`
- `kubectl config set-context --current --namespace=custom-namespace` Set as default namespace.
- `kubectl get pod -n kube-public` get all pods within the namespace. this command also possible for deployment, service, etc.