How to deploy xCAT
Helm and Docker resources
The Helm resources are stored on ClusterFactory Git Repository.
The Dockerfile is described in the git repository SquareFactory/xcat-rocky.
An Docker image can be pulled with:
docker pull ghcr.io/squarefactory/xcat-rocky:latest
1. Deploy Namespace and AppProject
kubectl apply -f argo/provisioning/
2. Creating a StorageClass
or PersistentVolume
We will use NFS. Feel free to use another type of storage. We recommend at least 100 GB since the storage is used to store the root file system of the operating system images.
- StorageClass (dynamic)
- PersistentVolume (static)
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: xcat-nfs
namespace: provisioning
labels:
app: xcat
topology.kubernetes.io/region: <FILL ME> # <country code>-<city>
topology.kubernetes.io/zone: <FILL ME> # <country code>-<city>-<index>
provisioner: nfs.csi.k8s.io
parameters:
server: <FILL ME> # IP or host
share: <FILL ME> # /srv/nfs/k8s/xcat
mountPermissions: '0775'
mountOptions:
- hard
- nfsvers=4.1
- noatime
- nodiratime
volumeBindingMode: Immediate
reclaimPolicy: Retain
allowedTopologies:
- matchLabelExpressions:
- key: topology.kubernetes.io/region
values:
- <FILL ME> # <country code>-<city>
kubectl apply -f argo/provisioning/volumes/storage-class.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: xcat-pv
namespace: provisioning
labels:
app: xcat
topology.kubernetes.io/region: <FILL ME> # <country code>-<city>
topology.kubernetes.io/zone: <FILL ME> # <country code>-<city>-<index>
spec:
capacity:
storage: 100Gi
mountOptions:
- hard
- nfsvers=4.1
- noatime
- nodiratime
csi:
driver: nfs.csi.k8s.io
readOnly: false
volumeHandle: <unique id> # uuidgen
volumeAttributes:
server: <FILL ME> # IP or host
share: <FILL ME> # /srv/nfs/k8s/xcat
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
kubectl apply -f argo/provisioning/volumes/persistent-volume.yaml
The label app=xcat
will be used by the PersistentVolumeClaim.
3. Editing xcat-app.yaml
to use the fork
source:
# You should have forked this repo. Change the URL to your fork.
repoURL: git@github.com:<your account>/ClusterFactory.git
# You should use your branch too.
targetRevision: HEAD
path: helm/xcat
helm:
releaseName: xcat
valueFiles:
- values-production.yaml
4. Adding custom values
Read the values.yaml
to see all the default values.
4.a. Add the values file to the chart
Create values-production.yaml
inside the helm/xcat/
directory.
4.b. Selecting a zone
xCAT will use the host network. Make sure that xCAT stays on the same network by using the nodeSelector
.
Your nodes should be annotated with topology.kubernetes.io/region
and topology.kubernetes.io/zone
.
nodeSelector:
topology.kubernetes.io/region: <FILL ME> # <country code>-<city>
topology.kubernetes.io/zone: <FILL ME> # <country code>-<city>-<index>
4.c. Network configuration
xCAT will be connected to the host network using the IPVLAN CNI plugin. Make sure that Multus CNI is already installed.
Check with:
> kubectl get daemonset -n kube-system kube-multus-ds
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-multus-ds 1 1 1 1 1 <none> 28d
If it isn't already deployed, you can deploy Multus with:
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick-plugin.yaml
Similar to configuring the network interface of a Virtual Machine, you must change these fields:
# ...
net:
# Kubernetes host interface
masterInterface: eth0
mode: l2
type: ipvlan
# https://www.cni.dev/plugins/current/ipam/static/
ipam:
type: static
addresses:
- address: 192.168.0.3/24
gateway: 192.168.0.1
routes:
- dst: 0.0.0.0/0
# https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
dns:
nameservers:
- 127.0.0.1
Use IPAM static
since xCAT has a ISC DHCP server.
4.d. Volume configuration
- StorageClass (dynamic)
- PersistentVolume (static)
Edit the values accordingly:
# ...
persistence:
storageClassName: 'xcat-nfs'
accessModes: ['ReadWriteOnce']
size: 50Gi
# ...
persistence:
storageClassName: ''
accessModes: ['ReadWriteOnce']
size: 50Gi
selectorLabels:
app: xcat
topology.kubernetes.io/region: <FILL ME> # <country code>-<city>
topology.kubernetes.io/zone: <FILL ME> # <country code>-<city>-<index>
5. Deploy xCAT
Commit and push:
git add .
git commit -m "Added xCAT application and values"
git push
And deploy:
kubectl apply -f argo/provisioning/apps/xcat-app.yaml