microshift icon indicating copy to clipboard operation
microshift copied to clipboard

[BUG] Microshift does not honor /etc/microshift/config.yaml `roles` array

Open darthlukan opened this issue 3 years ago • 0 comments

What happened:

Microshift does not apply the roles listed in the config file defined at /etc/microshift/config.yaml despite documented behavior here.

Example:

[core@pi-master-0 ~]$ cat /etc/microshift/config.yaml 
---
dataDir: /var/lib/microshift
roles:
  - controlplane
  - node
nodeName: "pi-master-0"
cluster:
  clusterCIDR: "10.42.0.0/16"
  serviceCIDR: "10.43.0.0/16"
  dns: "10.43.0.10"
  domain: cluster.local

Result:

[core@pi-master-0 ~]$ oc get nodes
NAME          STATUS   ROLES    AGE   VERSION
pi-master-0   Ready    <none>   22h   v1.21.0

What you expected to happen:

That the ROLES column of oc get nodes would reflect controlplane,node:

[core@pi-master-0 ~]$ oc get nodes
NAME          STATUS   ROLES                  AGE   VERSION
pi-master-0   Ready     controlplane,node  22h     v1.21.0

How to reproduce it (as minimally and precisely as possible):

  1. Define /etc/microshift/config.yaml with roles array inclusive of the two documented acceptable roles controleplane and node
  2. Pull the documented for podman microshift.service systemd unit, enable it, and start it:
$ sudo curl -o /etc/systemd/system/microshift.service \
     https://raw.githubusercontent.com/redhat-et/microshift/main/packaging/systemd/microshift-containerized.service
$ sudo systemctl enable microshift.service
$ sudo systemctl start microshift.service
  1. Execute oc get nodes and note the ROLES column of the output

Environment:

  • Microshift version (use microshift version): latest
  • Hardware configuration: Raspberry Pi 400 (aarch64, 4GB RAM)
  • OS (e.g: cat /etc/os-release): Fedora CoreOS 35.20220327.3.0
  • Kernel (e.g. uname -a): Linux pi-master-0 5.16.16-200.fc35.aarch64 #1 SMP Sat Mar 19 13:35:51 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
  • Others: microshift.service in more readable form:
[core@pi-master-0 ~]$ cat /etc/systemd/system/microshift.service 
[Unit]
Description=MicroShift Containerized
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target crio.service
After=network-online.target crio.service
RequiresMountsFor=%t/containers

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/usr/bin/mkdir -p /var/lib/kubelet ; /usr/bin/mkdir -p /var/hpvolumes
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/bin/podman run \
  --cidfile=%t/%n.ctr-id \
  --cgroups=no-conmon \
  --rm \
  --replace \
  --sdnotify=container \
  --label io.containers.autoupdate=registry \
  --network=host \
  --privileged \
  -d \
  --name microshift \
  -v /var/hpvolumes:/var/hpvolumes:z,rw,rshared \
  -v /var/run/crio/crio.sock:/var/run/crio/crio.sock:rw,rshared \
  -v microshift-data:/var/lib/microshift:rw,rshared \
  -v /var/lib/kubelet:/var/lib/kubelet:z,rw,rshared \
  -v /var/log:/var/log \
  -v /etc:/etc quay.io/microshift/microshift:latest
ExecStop=/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all

[Install]
WantedBy=multi-user.target default.target

darthlukan avatar Apr 15 '22 06:04 darthlukan