Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paradocx96/express-app-k8s
https://github.com/paradocx96/express-app-k8s
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/paradocx96/express-app-k8s
- Owner: paradocx96
- Created: 2022-05-18T09:01:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-18T17:08:04.000Z (over 2 years ago)
- Last Synced: 2024-10-16T07:59:01.174Z (2 months ago)
- Language: JavaScript
- Homepage: https://hub.docker.com/repository/docker/paradocx96/express-app-k8s
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kubernetes - K8s
## Create Deployement and Yaml
```
kubectl create deploy {{app-name}} --image {{dockerhub-username}}/{{repo-name}}:{{version}} -o yaml
```
```
kubectl create deploy express-app --image paradocx96/express-app-k8s:v1 -o yaml
```## Create Service and Yaml
```
kubectl expose deploy {{app-name}} --port {{expose-port}} --target-port {{app-port}} --dry-run=client -o yaml
```
```
kubectl expose deploy express-app --port 3000 --target-port 3000 --dry-run=client -o yaml
```## Expose Service
```
kubectl port-forward svc/{{app-name}} {{expose-port}}:{{app-port}}
```
```
kubectl port-forward svc/express-app 3000:3000
```## Cluster Info
```
kubectl cluster-info
```## Check Cluster Role Admin is available
```
kubectl get clusterroles | grep cluster-admin
```## View Service Accounts
```
kubectl get serviceaccounts
```
```
kubectl get sa
```## Create Service Account
```
kubectl create sa {{account-name}}
```## Create Cluster role binding for new Service Account
```
kubectl create clusterrolebinding {{role-binding-name}} --clusterrole cluster-admin --serviceaccount default:{{new-sa-name}}
```## View Secrets
```
kubectl get secrets
```## View Service Account Secret as Base64
```
kubectl get secret -o json {{sa-secret-name}} | jq .data."token" -r | base64 -d
```## Create Kube Config in Azure
```
az aks get-credentials --resource-group {{resource-group}} --name {{cluster-name}} --admin
```## Check Kube Config
```
kubectl config current-context
```## View Kube Config as Base64
```
cat .kube/config | base64
```## View Running Pods
```
kubectl get pods
```
```
kubectl get pods -o wide
```## View Running Deployments
```
kubectl get deployment
```
```
kubectl get deployment -o wide
```## View Running Services
```
kubectl get svc
```
```
kubectl get svc -o wide
```## View All Running Resources
```
kubectl get all
```
```
kubectl get all -o wide
```## Describe Service
```
kubectl describe svc {{service-name}}
```## Kubectl Apply
```
kubectl apply -f ./deploy.yaml
```
```
kubectl apply -f https://github.com/paradocx96/nginx-app-k8s/blob/main/deploy.yaml
```
```
kubectl apply -f - <