Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/run/cos/active doesn't correctly size based on the ISO #1942

Closed
cog-nick opened this issue Oct 23, 2023 · 3 comments
Closed

/run/cos/active doesn't correctly size based on the ISO #1942

cog-nick opened this issue Oct 23, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@cog-nick
Copy link

Kairos version:

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

CPU architecture, OS, and Version:

Linux controller 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug

When I use a custom base Docker Image (Ubuntu + Packages), /run/cos/active runs out of size (the loopback) on the initial install. This is likely due to it not being sized correctly w.r.t to the ISO

To Reproduce

Docker Image:

FROM quay.io/kairos/kairos-ubuntu-22-lts:v2.3.1-k3sv1.26.6-k3s1
RUN add-apt-repository ppa:rmescandon/yq && apt-get update && apt-get upgrade -y && apt-get install -y zip unzip fdisk rsyslog python2 python2-dev yq dkms lsscsi git build-essential ntp ntpstat htop tree autossh libusb-1.0-0-dev libpcap-dev libaudit-dev libcupti-dev bridge-utils lm-sensors ifenslave iotop traceroute smartmontools nmap nut nut-client nut-server \
  && apt-get clean && rm -rf /var/lib/apt/lists/*
# Add latest Kairos Agent
ADD kairos-agent /usr/bin/kairos-agent
# Add helm charts
COPY ingress-nginx*.tgz /var/lib/rancher/k3s/server/static/charts/
COPY cert-manager*.tgz /var/lib/rancher/k3s/server/static/charts/
COPY rancher-*.tgz /var/lib/rancher/k3s/server/static/charts/
COPY harbor-*.tgz /var/lib/rancher/k3s/server/static/charts/
COPY rabbitmq-*.tgz /var/lib/rancher/k3s/server/static/charts/
COPY kyverno-*.tgz /var/lib/rancher/k3s/server/static/charts/

I think you'll see the same issue without the Helm charts since until adding packages from apt, packaging helm charts for air gap install worked without a hitch.

Cloud Init:

#cloud-config
​
users:
- name: "user"
  passwd: "user"
  lock_passwd: false
  no-create-home: false
  shell: /bin/bash
  homedir: "/home/user"
  groups: ["admin"]
  ssh_authorized_keys: []
​
install:
  device: "/dev/sda"
  reboot: true
  auto: true
  partitions:
    oem:
      size: 4096
      fs: ext4
    state:
      size: 20480
      fs: ext4
    recovery:
      size: 12288
      fs: ext4
  system:
    size: 8192
  passive:
    size: 8192
  recovery-system:
    size: 8192

Expected behavior

That it successfully installs by correct sizing /run/cos/active to be larger than a 3.0GB loopback device.

Logs

I can't capture it when from the target device, but it's your standard "out of space" error when you fill a disk on Linux.

Additional context

@cog-nick cog-nick added the bug Something isn't working label Oct 23, 2023
@Itxaka
Copy link
Member

Itxaka commented Oct 23, 2023

Looks like its ignoring the size set on the config file:
image

@mauromorales mauromorales added the triage Add this label to issues that should be triaged and prioretized in the next planning call label Oct 23, 2023
@Itxaka
Copy link
Member

Itxaka commented Oct 23, 2023

this is kairos 2.3.1 which ships agent v2.1.12 which doesnt have a lot of the improvements required for the auto-size or override of system size via cloud-config values.

talked to @cog-nick in slack and recommended bumping the agent to latest stable version which should fix this.

If this doesnt work or bumping the agent doesnt work for you we can still workaround this.

The old method was to have a /etc/elemental/config.yaml file with those values, which kairos-agent read and use for setting several values. We can override those values by creating a file under that path with the following values:

/etc/elemental/config.yaml

install:
  system:
    size: 8192
  passive:
    size: 8192
  recovery-system:
    size: 8192

Notice that this file does not need the #cloud-config stanza at the top, this is a legacy way of setting things based of elemental-cli: https://github.com/rancher/elemental-cli/blob/main/config.yaml.example

@mauromorales mauromorales removed the triage Add this label to issues that should be triaged and prioretized in the next planning call label Oct 30, 2023
@Itxaka
Copy link
Member

Itxaka commented Apr 29, 2024

This seems like it would be fixed based on the feedback and improvements to the size calculation. Feel free to reopen if needed.

@Itxaka Itxaka closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants