This SD-Core NMS K8s Terraform module aims to deploy the sdcore-nms-k8s charm via Terraform.
The following software and tools needs to be installed and should be running in the local environment.
microk8sjuju 3.xterrafom
Install Microk8s:
sudo snap install microk8s --channel=1.27-strict/stable
sudo usermod -a -G snap_microk8s $USER
newgrp snap_microk8sEnable dns, storage, multus and metallb plugins for Microk8s.
sudo microk8s enable hostpath-storage multus
sudo microk8s enable metallb:10.0.0.2-10.0.0.4Install Juju:
sudo snap install juju --channel=3.1/stableInstall Terraform:
sudo snap install --classic terraformBootstrap Juju Controller:
juju bootstrap microk8sInitialise the provider:
terraform initCustomize the configuration inputs under terraform.tfvars file according to requirement.
Sample contents of terraform.tfvars file:
model_name ="test"Run Terraform plan by providing a var-file:
terraform plan -var-file="terraform.tfvars" Deploy the resources, skip the approval.
terraform apply -auto-approve After running above command, if you get the error below, run the `terraform apply -auto-approve` again.
`Unable to create application, got error: model "<model_name>" not found`
Run juju switch <juju model> to switch to the target Juju model and observe the status of the applications.
juju status --relationsThe output should be similar to the following:
Remove the applications:
terraform destroy -auto-approve