VOOZH about

URL: https://thenewstack.io/tutorial-configure-cloud-native-edge-infrastructure-with-k3s-calico-portworx/

⇱ Tutorial: Configure Cloud Native Edge Infrastructure with K3s, Calico, Portworx - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-09-18 10:10:45
Tutorial: Configure Cloud Native Edge Infrastructure with K3s, Calico, Portworx
tutorial,
Cloud Native Ecosystem / Edge Computing / Kubernetes

Tutorial: Configure Cloud Native Edge Infrastructure with K3s, Calico, Portworx

This tutorial will walk you through the steps involved in installing and configuring this software on an edge cluster, a set of Intel NUC mini PCs running Ubuntu 18.04. This infrastructure can be used for running reliable, scalable, and secure AI and IoT workloads at the edge.
Sep 18th, 2020 10:10am by Janakiram MSV
👁 Featued image for: Tutorial: Configure Cloud Native Edge Infrastructure with K3s, Calico, Portworx

In the previous part of this series, I introduced the core building blocks of cloud native edge computing stack: K3s, Project Calico, and Portworx.

This tutorial will walk you through the steps involved in installing and configuring this software on an edge cluster, a set of Intel NUC mini PCs running Ubuntu 18.04. This infrastructure can be used for running reliable, scalable, and secure AI and IoT workloads at the edge.

Customizing K3s Installation for Calico

By default, K3s will run with flannel as the Container Networking Interface (CNI), using VXLAN as the default backend. We will replace that with a CNI-compliant Calico.

To integrate Calico networking stack with K3s, we need to customize the installation to enable CNI support.

Note that you need at least three nodes running the K3s cluster at the edge for high availability.

On the first node designated as server, run the below commands.

export K3S_TOKEN="secret_edgecluster_token"
export INSTALL_K3S_EXEC="--flannel-backend=none --disable=traefik --cluster-cidr=172.16.2.0/24 --cluster-init"
curl -sfL https://get.k3s.io | sh -

If 172.16.2.0/24 is already in use within your network you must select a different pod network CIDR by replacing 172.16.2.0/24 in the above command.

On the remaining server nodes, run the following commands. Note that we added the --server switch to the installer pointing it to the IP address of the first node.

export K3S_TOKEN="secret_edgecluster_token"
export INSTALL_K3S_EXEC="--flannel-backend=none --disable=traefik --cluster-cidr=172.16.2.0/24 --server https://10.0.0.60:6443"
curl -sfL https://get.k3s.io | sh -

To configure worker nodes or agents, run the following commands:

export K3S_URL=https://10.0.0.60:6443
export K3S_TOKEN="secret_edgecluster_token"
curl -sfL https://get.k3s.io | sh -

Replace K3S_URL with the IP address of the K3s server.

At the end of this step, you should have a cluster with four nodes.

Since the network is not configured yet, none of these nodes are ready. As soon as we apply Calico specs to the cluster, the nodes will become ready.

👁 Image

Before proceeding to the next step, copy /etc/rancher/k3s/k3s.yaml from one of the server nodes to your local workstation and point the KUBECONFIG environment variable to that. Don’t forget to update the master URL in the YAML file. This provides remote access to the K3s cluster through kubectl CLI.

Installing Calico on the Multinode K3s Cluster

We will start by downloading the Calico manifests and modifying them.

wget https://docs.projectcalico.org/manifests/tigera-operator.yaml
wget https://docs.projectcalico.org/manifests/custom-resources.yaml

Open custom-resources.yaml file and change the CIDR to the same IP address range mentioned during the K3s installation.

Apply both the manifests to configure the Calico network for the K3s cluster.

kubectl create -f tigera-operator.yaml
kubectl create -f custom-resources.yaml

In a few minutes, the cluster becomes ready.

👁 Image

Finally, modify the cni-config configmap in calico-system namespace to enable IP forwarding.

kubectl edit cm cni-config -n calico-system

Change the value shown below to enable IP forwarding.

"container_settings": {
 "allow_ip_forwarding": true
 }

Verify that Calico is up and running with the below command:

kubectl get pods -n calico-system

👁 Image

Installing Portworx on K3s

Portworx 2.6 or above supports K3s distribution. The installation process on K3s is not different from other flavors of Kubernetes. Follow the steps mentioned in the tutorial on installing Portworx on a bare-metal cluster.

If you don’t have an etcd cluster handy, you can choose the built-in KVDB in the PX-Central installation wizard.

👁 Image

I chose the NVMe disk attached to each host for the storage option. Modify this based on your storage configuration.

👁 Image

One of the important prerequisites for K3s is the support for CSI. Make sure you select Enable CSI option in the last step.

👁 Image

Copy the specification and apply it to your cluster.

👁 Image

In a few minutes, the Portworx storage cluster on K3s will be up and running.

kubectl get pods -l name=portworx -n kube-system

👁 Image

The CSI driver is attached as a sidecar to each of the Pods in the DaemonSet which is why we see two containers in the Pods.

SSH into one of the nodes and check the Portworx cluster status with the below command.

sudo /opt/pwx/bin/pxctl status

👁 Image

We now have a fully configured edge infrastructure based on K3s, Calico, and Portworx. In the next part of this series, we will deploy an AIoT workload running at the edge.

Janakiram MSV’s Webinar series, “Machine Intelligence and Modern Infrastructure (MI2)” offers informative and insightful sessions covering cutting-edge technologies. Sign up for the upcoming MI2 webinar at http://mi2.live.

Portworx is a sponsor of The New Stack.

Feature Image by Uwe Baumann from Pixabay.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Enable.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.