Skip to content

Instantly share code, notes, and snippets.

@guillaumerose
Last active October 29, 2021 15:52
Show Gist options
  • Save guillaumerose/66417a29135cc980ca4181bec8f2f2a5 to your computer and use it in GitHub Desktop.
Save guillaumerose/66417a29135cc980ca4181bec8f2f2a5 to your computer and use it in GitHub Desktop.
Microshift with podman machine

5 minutes to OpenShift on a Mac with podman machine and microshift.

Steps:

  1. brew install podman
  2. podman machine init
  3. podman machine start
  4. podman machine ssh

(in the ssh session)

  1. sudo setsebool -P container_manage_cgroup true
  2. sudo podman volume create ushift-vol
  3. sudo podman run -d --rm --name ushift --privileged -v /lib/modules:/lib/modules -v ushift-vol:/var/lib --hostname ushift -p 6443:6443 quay.io/microshift/microshift:4.7.0-0.microshift-2021-08-31-224727-aio-linux-amd64

(wait ~3-4min, then exit the ssh session and return to the host)

  1. podman machine ssh sudo podman exec ushift cat /var/lib/microshift/resources/kubeadmin/kubeconfig > kubeconfig
  2. kubectl get pods -A --kubeconfig ./kubeconfig
NAMESPACE                       NAME                                  READY   STATUS    RESTARTS   AGE
kube-system                     kube-flannel-ds-pzjw4                 1/1     Running   0          5m40s
kubevirt-hostpath-provisioner   kubevirt-hostpath-provisioner-hs6sp   1/1     Running   0          5m41s
openshift-dns                   dns-default-pvt6d                     3/3     Running   0          5m40s
openshift-ingress               router-default-6d8c9d8f57-75nnx       1/1     Running   0          5m40s
openshift-service-ca            service-ca-64547678c6-2bv65           1/1     Running   0          5m43s

Links

https://github.com/redhat-et/microshift/tree/main/hack/all-in-one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment