kubectl runkubectl apply -f /vagrant/kubernetes-curso/first-app/helloworld.yml kubectl get pod -o wide kubectl describe pod nodehelloworld.example.com
kubectl expose pod nodehelloworld.example.com %%--%%type NodePort %%--%%name nodehelloword-service kubectl get service'' # información del servicio kubectl describe service nodehelloworld-service
kubectl exec -ti nodehelloworld.example.com %%--%% bash
kubectl logs nodehelloworld.example.com
kubectl get eventskubectl delete pod nodehelloworld.example.com kubectl delete pod -f /vagrant/kubernetes-curso/first-app/helloworld.yml kubectl delete service nodehelloworld-service
… –wait=false: devuelve el control al prompt sin esperar a ejecutar la ordenkubectl scale rc <controller> --replicas=3kubectl edit rc <controller>kubectl apply -f /vagrant/kubernetes-curso/replication-controller/helloworld-repl-controller.yml
kubectl get rc -o wide kubectl describe pod helloworld-controller-xxxxx kubectl delete pod helloworld-controller-xxxxx kubectl get pods --show-labels
kubectl scale --replicas=4 -f /vagrant/kubernetes-curso/replication-controller/helloworld-repl-controller.yml kubectl scale rc helloworld-controller --replicas=4
kubectl expose rc helloworld-controller --type=NodePort --name helloworld-controller-service kubectl get service kubectl describe service helloworld-controller-service
kubectl get rc kubectl delete rc helloworld-controller kubectl get pod,rc kubectl delete service helloworld-controller-service
kubectl get pods --show-labelskubectl get all -l app=helloworld (o --selector)kubectl fet pods -l 'env in (production,development)' --wait=falsekubectl apply -f /vagrant/kubernetes-labs2/labels/pod.yaml kubectl get pods --show-labels
kubectl label pods labelex owner=miempresa kubectl get pods --show-labels kubectl get pods --selector owner=miempresa kubectl get pods -l env=development
kubectl apply -f /vagrant/kubernetes-labs2/labels/anotherpod.yaml kubectl get pods -l 'env in (production, development)' kubectl delete pods -l 'env in (production, development)'
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
kubectl apply -f pod.yml kube expose pod nginx --type=NodePort nginx-service # no funciona, falta una etiqueta kube label pods nginx app=miapp kubectl expose pod nginx --type=NodePort nginx-service # el servicio se engancha a través de la etiqueta kubectl describe service nginx-service
kubectl run sise --image=mhausenblas/simpleservice:0.5.0 --port=9876
kubectl apply -f /vagrant/kubernetes-labs2/pods/pod.yaml kubectl exec twocontainers -c shell -i -t -- bash # muestra la información del POD (y los dos contenedores)
kubectl exec twocontainers -c shell -i -t -- bash
curl -s localhost:9876/info (desde shell)