Kubernetes入門メモ

$ alias kubectl='sudo k3s kubectl --namespace=<namespace名>'

$ kubectl get all

$ kubectl run hello-world --image=hello-world -it --restart=Never

$ cat | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.12

$ cat | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
    name: web-deploy
spec:
    replicas: 3
    selector:
        matchLabels:
            app: web
    template:
        metadata:
            labels:
                app: web
        spec:
            containers:
            - name: nginx
              image: nginx:1.12