goFrendiAsgard / alta-kube-experiment

Percobaan resource kube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to

Deploy resources

kubectl -n <namespace> apply -f <file>

See resources

kubectl -n <namespace> get <resource>

Delete resources

kubectl -n <namespace> delete <resource>

Example: Pod

kubectl -n gofrendiasgard apply -f mypod.yaml
kubectl -n gofrendiasgard get pods

Accessing pod without using service

kubectl port-forward pod/nginx 3000:80

Example: Replicaset

kubectl -n gofrendiasgard apply -f myreplicaset.yaml
kubectl -n gofrendiasgard get replicasets
kubectl -n gofrendiasgard get pods

Example: Deployment

kubectl -n gofrendiasgard apply -f mydeployment.yaml
kubectl -n gofrendiasgard get deployments
kubectl -n gofrendiasgard get replicasets
kubectl -n gofrendiasgard get pods

Example: Service

kubectl -n gofrendiasgard apply -f myservice.yaml
kubectl port-forward service/my-service 3000:80

About

Percobaan resource kube