Assets VM#
If you chose to use the EDA Assets VM for all or some of the hosting services required to host the downloaded assets in the air-gapped environment, you need to deploy and configure the Assets VM in the air-gapped environment.
The Assets VM runs the container registry, Git server, and web server that host the downloaded assets in the air-gapped environment.
A single Assets VM can be used for multiple deployments and versions of EDA, as the assets for multiple versions of EDA can be uploaded to the same Assets VM.
Prerequisites#
The downloaded assets are transferred to the air-gapped environment.
Loading the Kpt Setters image#
Note
These steps are to be executed in the air-gapped environment.
The procedures for setting up the Assets VM and installing EDA use Kpt - a package manager for Kubernetes. Kpt relies on the kpt-apply-setters container to be present in the local Docker image cache of the air-gapped system to be able to perform its operations.
The container image is part of the eda-bundle-tools bundle. If you downloaded the default bundle list, which includes eda-bundle-tools, you will have that bundle on your air-gapped system. If you do not have it yet, download the default bundle list on a system with Internet access using make -C bundles/ save-default-bundles.
To load the kpt-apply-setters image from the eda-bundle-tools bundle, follow these steps:
-
Ensure you have changed into the directory of the cloned
edaadmrepository. -
Import the image into the local Docker image cache.
The bundle and
kpt-apply-settersversions may change in future releases. In that case, replace2-0-0and0-1-1with the appropriate versions.
Deploying the VM#
Caution
These steps are meant to be executed in the air-gapped environment.
The procedure for deploying the Assets VM is similar to deploying the Nokia EDA Talos Kubernetes cluster nodes and uses the edaadm CLI to manage the deployment process.
Preparing the Assets VM EDAADM Configuration File#
The EDAADM configuration file declaratively defines the machine/VM configuration and the Kubernetes cluster parameters and is an abstraction on top of the Talos machine config. You will find the edaadm configuration for the Assets VM very similar to the config file used for Nokia EDA Kubernetes nodes with a few minor differences:
- It is a config file for a single machine.
- The
clusterNamemust be unique and different from the Nokia EDA Kubernetes cluster. -
The following additional fields must be present in the Assets VM edaadm config:
Notes
- Consult the full list of edaadm configuration file options to customize your Assets VM configuration: EDAADM Configuration file fields.
- The Assets VM needs only one network interface, preferably on the planned OAM network for the Nokia EDA Kubernetes cluster. It must be reachable from that OAM network during EDA installation.
- The
edaadmtool still expects the definition of a storage disk in the machine definition, but this can be a reference to a non-existing disk.
Consider an example edaadm configuration for an Assets VM that you can use as a reference when creating your own configuration file:
eda-assets-deployment.yamlversion: 26.4.1 #(1)!
clusterName: eda-airgap-assets #(2)!
machines:
- name: eda-assets
endpoint: 192.0.2.228
enableImageCache: true
localPathProvisioner: "/var/local-path-provisioner"
interfaces:
- name: eth0
dhcp: false
interface: eth0
addresses:
- 192.0.2.228/23
routes:
- network: 0.0.0.0/0
gateway: 192.0.2.1
mtu: 9000 #(4)!
disks:
os: /dev/vda
storage: /dev/vdb #(3)!
k8s:
stack: ipv4
primaryNode: eda-assets
endpointUrl: https://192.0.2.228:6443
allowSchedulingOnControlPlanes: true
control-plane:
- eda-assets
time:
disabled: false
servers:
- 192.0.2.253
- 192.0.2.254
nameservers:
servers:
- 192.0.2.254
- 192.0.2.253
- Nokia EDA version string. Not relevant for the Assets VM, but required by edaadm.
- The Kubernetes cluster name for the Assets VM must be unique and different from the names specified for the Nokia EDA Kubernetes cluster.
- The storage disk definition is required by edaadm, but the disk does not need to exist on the Assets VM. Can be set to any value.
- Pay attention to the configured MTU, as the Linux bridges, interfaces, and networks between the Assets VM and the Nokia EDA Kubernetes cluster nodes must support the same MTU.
Assuming you are in the edaadm repository root, save the configuration file as eda-assets-deployment.yaml.
Generating the Talos machine configuration files#
After creating the Assets VM EDAADM configuration file, the next step is to generate all the configuration files that are necessary to deploy the Kubernetes environment for the Assets VM.
Use the edaadm tool to generate the Talos configuration out of the EDAADM configuration file:
The output should look similar to the following (a portion has been removed):
ConfigFile is eda-assets-deployment.yaml
...
[1/6] Validating Machines
[1/6] Validated Machines
[2/6] Validating Primary Node
[2/6] Validated Primary Node
[3/6] Validating Endpoint URL
[3/6] Validated Endpoint URL
[4/6] Validating Stack
[4/6] Validated Stack
[5/6] Validating Virtual IP
[5/6] Validated Virtual IP
[6/6] Validating Storage
[6/6] Validated Storage
[ OK ] Spec is validated
[ INFO ] Existing secrets file found - loading:eda-airgap-assets/secrets.yaml
[ INFO ] Loaded secrets bundle eda-airgap-assets/secrets.yaml
generating PKI and tokens
Created eda-airgap-assets/eda-assets.yaml
Created eda-airgap-assets/talosconfig.yaml
Created eda-airgap-assets/rook-ceph-operator-values.yaml
Created eda-airgap-assets/rook-ceph-cluster-values.yaml
The generated Talos configuration files will be available in the eda-airgap-assets folder which is named after the clusterName specified in the EDAADM configuration file.
The machine config file for the Assets VM is named eda-assets.yaml after the name field specified in the machines section of the EDAADM configuration file.
Creating the Assets VM on KVM#
Caution
This procedure is executed on the KVM Hypervisor which will host the Assets VM.
-
Ensure that the
virt-installtool is installed on the KVM hypervisor.If you need to install the tools, use the following command:
or
-
Verify that the Assets VM ISO image is available.
The Assets VM ISO image was generated in the Downloading the EDA Assets VM components procedure (KVM tab) and should be available in the air-gapped environment after you transfer the assets from the public environment.
-
Prepare Assets VM cloud-init files.
The next step is to create the cloud-init ISO file with the machine configuration file and the necessary metadata.
Use the
edaadmtool to generate the cloud-init files for the Assets VM using the edaadm configuration file:The
eda-assets-data.iso1 file will be created in theeda-airgap-assetsfolder containing the cloud-init information for the Assets VM:meta-datafile containing the instance-id and local-hostname values set to.machines[*].namenetwork-configfile containingversion: 2key/value pair. Device types are not specified and will be defined by Talos.user-datafile containing the Talos machine configuration file for the Assets VM.
-
Create the virtual machine. This step uses both the cloud-init ISO created by
edaadm make-iso(eda-assets-data.iso) and the Assets VM boot ISO generated bycreate-asset-vm-nocloud-boot-iso(asset-vm-nocloud-amd64.iso).virt-install -n eda-assets \ --description "EDA Assets VM for EDA" \ --noautoconsole --os-variant=generic \ #(1)! --memory 16384 --vcpus 4 --cpu host \ --disk eda-assets-rootdisk.qcow2,format=qcow2,bus=virtio,size=300 \ --cdrom ./bundles/eda-cargo/talos-asset-vm-boot-imgs/asset-vm-nocloud-amd64.iso \ --disk eda-assets-data.iso,device=cdrom \ --network bridge=br0,model=virtio- Depending on the
virt-installversion, the--os-variant=genericoption might not be supported. In that case use--os-type=genericinstead.
Warning
Pay attention to the MTU value. The Linux bridges, interfaces, and networks between the Assets VM and the Nokia EDA Kubernetes cluster nodes must all allow for the same MTU size.
- Depending on the
Creating the Assets VM on VMware vSphere#
Caution
This procedure is executed in the air-gapped environment for a VMware vSphere deployment.
-
Ensure that the
ovftoolis installed.To deploy the Assets VM OVA image on VMware vSphere, the
ovftoolmust be installed on the system from which you will create the deployment. -
Deploy Assets VM OVA image.
From the root of the
edaadmrepository, create a base64-encoded string from the Talos machine configuration for the Assets VM. If you used the example configuration file above, run:Deploy the Assets VM OVA image generated in the Downloading the EDA Assets VM components procedure (VMware vSphere tab) using the
ovftoolcommand:ovftool --acceptAllEulas --noSSLVerify \ -dm=thin \ -ds=DATASTORE \ -n=eda-assets \ --net:"VM Network=OAM" \ --prop:talos.config="${NODECONFIG}" \ ./bundles/eda-cargo/talos-asset-vm-boot-imgs/asset-vm-vmware-amd64.ova \ vi://admin%[email protected]/My-DC/host/Cluster/Resources/My-Resource-Group -
Adjust the Assets VM resources.
After deploying the VM using the OVA image:
- Increase the number of vCPUs to 4.
- Increase the memory to 16G.
- Increase the main disk size to 300G. On boot, Talos automatically extends the file system.
- Enable 100% resource reservation for the CPU, memory and disk.
Bootstrap the Assets VM#
The Assets VM runs Talos Kubernetes and needs to be bootstrapped using the edaadm tool. Use the edaadm configuration file created previously to bootstrap the Assets VM.
Obtaining the Kubernetes config file#
Once the Assets VM Kubernetes cluster is bootstrapped, use the edaadm command to fetch the Kubernetes configuration file (kubeconfig) for use with kubectl.
-
Obtain the Kubernetes configuration file.
Execute the following command in the folder with the
eda-assets-deployment.yamlEDAADM configuration file. -
Configure the Kubernetes configuration file in your environment.
You can configure your environment to use the
kubeconfigfile with thekubectlcommand. -
Verify that the Assets VM node is up and running.
You can use the typical
kubectlcommands.
When the node is up and ready, continue with deploying the Assets VM services.
Assets host services#
The Assets VM is a single-node Kubernetes cluster used to run the assets host services, such as the container registry, Git server, and web server. These services are not baked into the Assets VM image, but are deployed as applications on top of the Kubernetes cluster.
Customizing the assets host services#
The deployed assets host services can be customized by providing custom values for the services in the kpt/config/kpt-setters.yaml file of the cloned edaadm repository. To list the available custom keys, use the following command:
The output will list the available custom keys and their current values.
Populate the kpt/config/kpt-setters.yaml file with the desired values and run the following command to apply the configuration:
Deploying the assets host services#
To deploy the assets host services, run:
This command deploys the container registry, Git server, and web server on the Kubernetes cluster running on the Assets VM.
Once the Assets VM is deployed and the hosting services are running, you need to upload the assets to the Assets Host.
-
Where
eda-assetsis the name of the machine defined in the EDAADM configuration file. ↩