Notes & How-To Guides¶
This section contains technical notes, tips, and how-to guides on various topics including Linux and container technologies.
Featured Notes¶
Customize virtual machines by modifying libvirt domain XML using sidecar containers
Learn how to use the sidecar pattern to customize and extend virtual machines running on OpenShift Virtualization. This guide covers the complete process from setup to implementation.
Categories¶
OpenShift Virtualization Sidecar - How to customize virtual machines with sidecar containers
Merging kubeconfig Files - How to merge multiple kubeconfig files for Kubernetes and OpenShift
OpenShift Console Banner - Set a console banner in OpenShift
Podman - Notes on Podman container runtime and commands
Linux File Permissions and ACLs - Working with complex permissions and Access Control Lists
Defms - 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
oc patch consoles.operator.openshift.io cluster --patch '{"spec":{"customization":{"customLogoFile":"","customProductName":"","customBannerText":"This is a test environment"}}}' --type=merge
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 Dockerfile
podman build -t myapp .
# Generate systemd unit file
podman generate systemd --name mycontainer > ~/.config/systemd/user/mycontainer.service