Before start check your path.
cd files-beyond-kubernetes/
# Create a new deployment
kubectl create deployment my-webserver --image=nginxdemos/hello
# Create a service with a command
# The service listens on :8080, but the container (our app) does on :80
kubectl expose deployment/my-webserver --name my-webserver --port=8080 --target-port=80
# Not required, but just to check it works, let’s port-forward it temporarily
# The service listened on :8080, but we will port-forward it through the :7777
kubectl port-forward service/my-webserver 7777:8080
Go to: http://127.0.0.1:7777/
kubectl apply -f my-demo-ingress.yaml
kubectl get ingress
Go to: http://localhost:8080
kubectl apply -f my-pvc.yaml
kubectl get pvc
kubectl apply -f my-pod-pvc.yaml
kubectl apply -f my-job.yaml
kubectl get jobs
kubectl apply -f my-cronjob.yaml
kubectl get cronjobs
kubectl get job
kubectl apply -f my-pod-init.yaml
kubectl get pods
kubectl apply -f my-cm.yaml
Equivalent:
kubectl create configmap mysql --from-literal=replication-mode=master --from-literal=replication-user=master
check:
kubectl get configmap mysql -o jsonpath='{.data}'
kubectl apply -f my-pod-cm-env.yaml
kubectl apply -f my-pod-cm-vol.yaml
kubectl apply -f my-secret.yaml
Equivalent:
kubectl create secret generic mysql --from-literal=password=root
Check:
kubectl get secret mysql -o go-template='{{.data.password | base64decode}}'
kubectl apply -f my-pod-secret.yaml