This message was deleted.
# elemental
a
This message was deleted.
f
Since the system is immutable, this would require you to build a derivative custom image. We have a little doc here: https://elemental.docs.rancher.com/next/custom-images
If your needed tools can run in a container however, you can also considering provisioning a k3s cluster for example, and running a nfs-client container as DaemonSet.
p
I've created a custom image this way: Base image docker root folder/ repos/repo-oss.repo
Copy code
[repo-oss]
name=Main Repository
enabled=1
autorefresh=1
#baseurl=<http://download.opensuse.org/distribution/leap/15.6/repo/oss/>
baseurl=<http://mirror.aarnet.edu.au/pub/opensuse/opensuse/distribution/leap/15.6/repo/oss/>
path=/
type=rpm-md
keeppackages=0
/grub2/x86_64-efi/ (copied from the default iso created in elemental extension) ./Dockerfile
Copy code
# The version of Elemental to modify
FROM registry.suse.com/suse/sle-micro/5.5:2.0.2

# Custom commands
COPY grub2/x86_64-efi /usr/share/grub2/x86_64-efi
COPY repos/* /etc/zypp/repos.d/
RUN zypper --no-gpg-checks --gpg-auto-import-keys install -y cifs-utils bind-utils telnet && \
    zypper clean --all

# IMPORTANT: /etc/os-release is used for versioning/upgrade. The
# values here should reflect the tag of the image currently being built
ARG IMAGE_REPO='myrepo\/somename\/elemental-img'
ARG IMAGE_TAG='v1.1.1'

RUN \
    sed -i -e "s/^IMAGE_REPO=.*/IMAGE_REPO=\"${IMAGE_REPO}\"/g" /etc/os-release && \
    sed -i -e "s/^IMAGE_TAG=.*/IMAGE_TAG=\"${IMAGE_TAG}\"/g" /etc/os-release && \
    sed -i -e "s/^IMAGE=.*/IMAGE=\"${IMAGE_REPO}:${IMAGE_TAG}\"/g" /etc/os-release
Custom ISO iso_root folder/ /overlay/ livecd-cloud-config.yaml (you can get this from the registraion endpoint)
Copy code
elemental:
    registration:
        url: <https://my-reg.url.com/elemental/registration/><reg_token>
        ca-cert: |-
            -----BEGIN CERTIFICATE-----
            -----END CERTIFICATE-----
            -----BEGIN CERTIFICATE-----
            
            -----END CERTIFICATE-----
        auth: tpm
/overlay/iso-config/ cloud-config.yaml (with custom run commands etc for example)
Copy code
#cloud-config
runcmd:
- echo "1.1.1.1 some.host.com" >> /etc/hosts
write_files:
- content: ""
  path: /usr/local/cloud-config/fstab.yaml
  permissions: "0755"
./Dockerfile
Copy code
FROM myrepo/somename/elemental-img:v1.1.1 AS os
FROM myrepo/somename/elemental-img:v1.1.1 AS builder
LABEL stage=builder
ARG TARGETARCH=x86_64
WORKDIR /iso
COPY --from=os / rootfs
COPY overlay overlay
RUN echo "1.1.1.1 some.host.com" >> rootfs/etc/hosts && \
  echo "nameserver ip-address" >> rootfs/etc/resolv.conf && \
  echo "options eth0 trust-ad" >> rootfs/etc/resolv.conf && \
  echo "search ." >> rootfs/etc/resolv.conf

RUN --mount=type=bind,source=./,target=/output,rw \
      elemental build-iso \
        dir:rootfs \
        --bootloader-in-rootfs \
        --squash-no-compression \
        --overlay-iso /iso/overlay \
        -o /output -n "elemental-${TARGETARCH}"
That outputs a custom ISO you can use to build - or add nodes to a cluster - I haven't got the first node building with a custom ISO direct yet, but you can use default ISO to seed the initial cluster and add nodes using the above ISO for other nodes to add to the cluster...