Notes & How-To Guides

Shorter notes and how-tos: the commands I keep looking up and the setups I don’t want to figure out twice.

Categories

Container Technologies
Linux Administration
AI & GPU
OpenStack
Concepts & Thoughts
  • Defms - A 2018 essay on a distributed, encrypted and free mail system

Quick Reference

# Merge kubeconfig files
KUBECONFIG=~/.kube/config:~/new-cluster-config kubectl config view --flatten > ~/.kube/merged-config
export KUBECONFIG=~/.kube/merged-config

# Set console banner (ConsoleNotification, see the banner note)
oc apply -f - <<'EOF'
apiVersion: console.openshift.io/v1
kind: ConsoleNotification
metadata:
  name: banner
spec:
  text: This is a test environment
  location: BannerTop
  backgroundColor: '#0f4414'
  color: '#ffffff'
EOF
apiVersion: kubevirt.io/v1
kind: VirtualMachine
spec:
  template:
    spec:
      domain:
        devices:
          disks:
          - name: containerdisk
            disk:
              bus: virtio
          - name: cloudinitdisk
            disk:
              bus: virtio
# Run a container
podman run -d --name web -p 8080:80 nginx

# List containers
podman ps

# Build from Containerfile
podman build -t myapp .

# Quadlet: drop a .container file for systemd integration
# ~/.config/containers/systemd/myapp.container
# then: systemctl --user daemon-reload && systemctl --user start myapp