Skip to content

Instantly share code, notes, and snippets.

@jaredhocutt
Forked from shpaz/microshift-on-jetson.md
Created April 11, 2023 14:29
Show Gist options
  • Save jaredhocutt/5c089b4e1ee6697b86fba110a5738f60 to your computer and use it in GitHub Desktop.
Save jaredhocutt/5c089b4e1ee6697b86fba110a5738f60 to your computer and use it in GitHub Desktop.

How To Install MicroShift On NVIDIA Jetson Xavier

In this procedure, we'll walkthrough the installation of MicroShift on an Jetson Xavier server. This procedure holds all the prerequisites and instructions in order to get your MicroShift server up and running.

Prerequisites

Before you start, make sure that you have the following prereqs met:

  • Jetson Xavier (Should be connected to some network)
  • Ubuntu 18.04 (L4T, AKA Linux For Tegra, Should come with the Jetson itself by default)

Preparation

Install all the needed dependencies using the apt-get install command. (If you have any problems with the installation of one of those packages, you can use the apt-get install --fix-broken command:

Dependency Installation

$ apt install -y curl jq runc iptables conntrack nvidia-container-runtime nvidia-container-toolkit

CRI-O Installation

$ curl https://raw.githubusercontent.com/cri-o/cri-o/main/scripts/get | bash 

CRI-O Configuration

Use the following guidance in order to configure some CRI-O level values:

$ rm /etc/crio/crio.conf.d/*

$ cat << EOF > /etc/cni/net.d/100-crio-bridge.conf
{
    "cniVersion": "0.4.0",
    "name": "crio",
    "type": "bridge",
    "bridge": "cni0",
    "isGateway": true,
    "ipMasq": true,
    "hairpinMode": true,
    "ipam": {
        "type": "host-local",
        "routes": [
            { "dst": "0.0.0.0/0" }
        ],
        "ranges": [
            [{ "subnet": "10.42.0.0/24" }]
        ]
    }
}
EOF

MicroShift Installation

$ export ARCH=arm64

$ export VERSION=4.8.0-0.microshift-2022-04-20-182108

$ curl -LO https://github.com/redhat-et/microshift/releases/download/$VERSION/microshift-linux-${ARCH}

$ mv microshift-linux-${ARCH} /usr/local/bin/microshift; chmod 755 /usr/local/bin/microshift

MicroShift Configuration

Create a systemd service that will allow you to use execute systemctl command on your MicroShift server:

cat << EOF > /usr/lib/systemd/system/microshift.service
[Unit]
Description=MicroShift
After=crio.service

[Service]
WorkingDirectory=/usr/local/bin/
ExecStart=/usr/local/bin/microshift run
Restart=always
User=root

[Install]
WantedBy=multi-user.target
EOF

Enable CRI-O and MicroShift systemd

$ systemctl enable crio --now

$ systemctl enable microshift.service --now

Installing The Kubernetes CLI

$ export ARCH=arm64

$ curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${ARCH}/kubectl" 

$ chmod +x ./kubectl

$ mv ./kubectl /usr/local/bin/kubectl 

Use the created kubeconfig file in order to start interacting with the MicroShift API:

$ export KUBECONFIG=/var/lib/microshift/resources/kubeadmin/kubeconfig

Test MicroShift

Once microshift is up, these pods should be up:

$ kubectl get pods -A

NAMESPACE                       NAME                                  READY   STATUS      RESTARTS   AGE
kube-system                     kube-flannel-ds-rc85f                 1/1     Running     1          3d1h
kubevirt-hostpath-provisioner   kubevirt-hostpath-provisioner-bnrz2   1/1     Running     0          3d1h
openshift-dns                   dns-default-p2cc5                     2/2     Running     0          3d1h
openshift-dns                   node-resolver-wd7mx                   1/1     Running     1          3d1h
openshift-ingress               router-default-85bcfdd948-4nx7k       1/1     Running     0          3d1h
openshift-service-ca            service-ca-76674bfb58-fbp4p           1/1     Running     0          3d1h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment