User Tools

Site Tools


kubernetes

Show kubernetes

microk8s kubectl get pod -o wide

Show yaml

microk8s kubectl get deployment nginx-deployment -o yaml

Show services

microk8s kubectl get service

Install ingress

minikube addons enable ingress
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=120s

Deploy nginx

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 2 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

Proxmox / LXC

# Allow running Docker inside LXC
lxc.aa_profile = unconfined
lxc.cap.drop = mac_override sys_time sys_module sys_rawio

Note: this affect security!

Docker

Data directory

/var/lib/docker
/var/lib/docker/vfs/dir
/var/lib/docker/volumes

Show info

docker info

Get image from repository

docker pull centos

Run image in background

docker run -d -e VARIABLE=CONTENT -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 222:22 centos
--rm remove after
--name INSTANCE_NAME
-it interactive

Show running / images / stats

docker ps
docker ps -a
docker images
docker stats {container}

Return info about container in JSON

docker inspect {container}

Enter / Stop / Start Container

docker attach {container}
docker stop {container}
docker start {container}

Map directory

-v /home/user:/home/user:ro -u 500:500
kubernetes.txt · Last modified: 2021/06/29 12:53 by Jan Forman