Skip to content

Instantly share code, notes, and snippets.

@rootfs
Last active April 11, 2023 16:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rootfs/8f849ece6f151f4253a62ed316d0c4ca to your computer and use it in GitHub Desktop.
Save rootfs/8f849ece6f151f4253a62ed316d0c4ca to your computer and use it in GitHub Desktop.

Background

Using podman to start containerized microshift can ensure timely image update to pick up the latest Microshift release. Additionally, using crio service on host allows workload continunity during Microshift upgrade.

image

Start containerized microshift

podman run --privileged --ipc=host --network=host  \
         -d --rm \
        -v /var/run:/var/run \
        -v /sys:/sys:ro \
         -v /var/lib:/var/lib:rw,rshared \
         -v /lib/modules:/lib/modules \
         -v /etc:/etc \
         -v /run/containers:/run/containers \
         -v /var/log:/var/log \
         quay.io/microshift/microshift:4.7.0-0.microshift-2021-08-31-224727-linux-amd64 

Demo

Check pods via kubectl:

[root@rhel microshift]# export KUBECONFIG=/var/lib/microshift/resources/kubeadmin/kubeconfig
[root@rhel microshift]# kubectl get pods -A
NAMESPACE                       NAME                                  READY   STATUS    RESTARTS   AGE
kube-system                     kube-flannel-ds-xlj66                 1/1     Running   0          38s
kubevirt-hostpath-provisioner   kubevirt-hostpath-provisioner-bfjvw   1/1     Running   0          39s
openshift-dns                   dns-default-s624v                     3/3     Running   0          38s
openshift-ingress               router-default-6d8c9d8f57-8n5qs       1/1     Running   0          38s
openshift-service-ca            service-ca-64547678c6-fd4bq           1/1     Running   0          39s

Check containerized microshift via podman:

[root@rhel microshift]# podman ps
CONTAINER ID  IMAGE                                                                           COMMAND     CREATED             STATUS                 PORTS       NAMES
428a0bfb8b5f  quay.io/microshift/microshift:4.7.0-0.microshift-2021-08-31-224727-linux-amd64  run         About a minute ago  Up About a minute ago              fervent_kare

Check crio pods:

[root@rhel microshift]# crictl ps
CONTAINER           IMAGE                                                                                                           CREATED             STATE               NAME                            ATTEMPT             POD ID
e1343381ab088       ebb673575b8b1081b417eb000208b5818cd7031ccbf7fdc583d003611a8f98f4                                                4 minutes ago       Running             dns-node-resolver               0                   58d75053d6191
21e6deca5b878       18248adc08dc2d2dbf1a7c192dc0a707bbc81766aecf8b9b615b8769d7cc3f8a                                                4 minutes ago       Running             kube-rbac-proxy                 0                   58d75053d6191
c4c9ac7080ac3       d3704d0b0df2e397b83dccbf31f0405b74a578e19eb16618adb04a7910d608ed                                                4 minutes ago       Running             dns                             0                   58d75053d6191
d1a6fab76e06e       52866d4b65279ebbba6c33b48d7aa08be85624a71d845b56ade6646749c8236a                                                4 minutes ago       Running             router                          0                   202b48eab1812
be1f092238e58       cfbfdcba5a82ceff418e260fbde0131a711e03a762a1e6f4062302ca6987fb4e                                                4 minutes ago
       Running             service-ca-controller           0                   825821bf835dc
99df18e71c3a0       quay.io/kubevirt/hostpath-provisioner@sha256:8cf5c2186a0357a70b835f2ef76430306e91da5743f375f87693f61a470ac75f   4 minutes ago       Running             kubevirt-hostpath-provisioner   0                   1cbc645342688
50be83ccf9e10       8522d622299ca431311ac69992419c956fbaca6fa8289c76810c9399d17c69de                                                4 minutes ago       Running             kube-flannel                    0                   6a8b86de590d2
@svalluru
Copy link

svalluru commented Mar 6, 2023

Hi have a question on how we can know about the args I need to set when running podman image. Is there any doc somewhere that explains on things we need to supply to podman run command ? I ran on mac and see that it complains about "/run/containers: no such file", that could be expected.

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