> For the complete documentation index, see [llms.txt](https://docs.weka.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.weka.io/kubernetes/weka-operator-deployments/deploy-weka-clients-only-on-kubernetes.md). Agents can also search and read this documentation through its [MCP server](https://docs.weka.io/~gitbook/mcp).

# Deploy WEKA clients only on Kubernetes

Run WEKA clients in Kubernetes with the WEKA Operator and connect them to an existing WEKA cluster that runs outside Kubernetes.

Deploy only the WekaClient resource when the WEKA cluster already runs on dedicated servers and only the clients run in Kubernetes. The WekaClient joins the existing cluster through the `joinIpPorts` endpoints, the same way a native client joins through the backend containers. The operator then installs the embedded CSI plugin, so pods can use WEKA filesystems through PersistentVolumeClaims (PVCs).

The same procedure applies when the WEKA cluster runs as a WekaCluster in another Kubernetes cluster. Use the join endpoints and ports that cluster reports. If the WekaCluster runs in the same Kubernetes cluster, set `targetCluster` in the WekaClient instead of `joinIpPorts`. The operator then resolves the join endpoints and creates the StorageClasses for you.

| Task                                                                | Description                                                                                       |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [Prepare the worker nodes](#prepare-the-worker-nodes)               | Configure the kubelet, HugePages, ports, and node labels on every worker that runs a WEKA client. |
| [Prepare the WEKA cluster](#prepare-the-weka-cluster)               | Create two users and, if the cluster requires it, a join token, and collect the join endpoints.   |
| [Install the WEKA Operator](#install-the-weka-operator)             | Create the image pull secret and install the operator with embedded CSI.                          |
| [Create the cluster secret](#create-the-cluster-secret)             | Store the client and CSI credentials in two Kubernetes secrets.                                   |
| [Deploy the WekaClient](#deploy-the-wekaclient)                     | Apply the WekaClient resource and verify that the clients join the cluster.                       |
| [Create a StorageClass and a PVC](#create-a-storageclass-and-a-pvc) | Verify the CSI plugin and provision a volume.                                                     |

## Prepare the worker nodes

Prepare every Kubernetes worker that runs a WEKA client. The WEKA client uses dedicated CPU cores and HugePages on the node.

**Before you begin**

* The worker nodes run Kubernetes 1.25 or later (OpenShift 4.17 or later).
* The worker OS and kernel are supported for WEKA clients of the cluster's version. See [Prerequisites and compatibility](https://docs.weka.io/planning-and-installation/prerequisites-and-compatibility.md).
* Each worker has about 20 GiB of local disk plus 10 GiB per client core in `/opt/k8s-weka`. Use local disk only.
* The workers reach the WEKA backend containers on their ports (by default, 14000–14059 for drives and 14300–14359 for compute, TCP and UDP). The backend containers reach the workers on the client port range (starting at the `portRange.basePort` value that you set in the WekaClient, 45000 in this example, TCP and UDP).
* For DPDK, the worker data NIC is on the same data network as the backends, with the same MTU.
* No native WEKA client runs on the worker. If one does, unmount its filesystems and uninstall the agent before you label the node.

**Procedure**

1. Configure the kubelet with the static CPU manager policy and strict CPU reservation.\
   Follow [Configure Kubelet requirements](https://docs.weka.io/kubernetes/weka-operator-deployments/weka-operator-full-deployment-workflow.md#configure-kubelet-requirements) in WEKA Operator full deployment workflow. Changing `cpuManagerPolicy` on a running node requires draining the node and removing `/var/lib/kubelet/cpu_manager_state` while the kubelet is stopped.
2. Configure 2 MiB HugePages on the NUMA node of the WEKA data NIC.

Each WekaClient pod requests `coresNum × 1564` MiB of `hugepages-2Mi` (782 pages per core). Allocate at least that amount, plus about 10% headroom and anything else on the node that uses HugePages.

| `coresNum` | Pod request           | Recommended `nr_hugepages` |
| ---------- | --------------------- | -------------------------- |
| 1          | 1564 MiB (782 pages)  | 861                        |
| 2          | 3128 MiB (1564 pages) | 1721                       |
| 4          | 6256 MiB (3128 pages) | 3441                       |

Find the NIC's NUMA node with `cat /sys/class/net/<data-nic>/device/numa_node`. A value of `-1` means the node has a single NUMA node. Set the pages with `echo <pages> > /sys/devices/system/node/node<N>/hugepages/hugepages-2048kB/nr_hugepages`, and persist the setting across reboots. If you use the `hugepages=` kernel parameter instead, the kernel splits the pages evenly across NUMA nodes, so multiply the count by the number of NUMA nodes.

3. Reserve the client port range so the kernel does not assign it to other processes. Add the following line to `/etc/sysctl.d/99-weka.conf`, and then run `sysctl -p /etc/sysctl.d/99-weka.conf`:

```
net.ipv4.ip_local_reserved_ports = 45000-45999
```

4. Restart the kubelet, and then verify that the node reports the HugePages:

```bash
systemctl restart kubelet
kubectl describe node <node-name> | grep -A2 hugepages-2Mi
```

5. Hold the kernel packages on the worker.\
   WEKA client drivers are built for an exact kernel version. Change the kernel only as a planned step, after drivers for the new kernel are available.
6. Label each worker that runs a WEKA client:

```bash
kubectl label nodes <node-name> weka.io/supports-clients=true
```

Apply only the client label on these nodes. The `weka.io/supports-backends=true` label makes the operator schedule backend containers.

## Prepare the WEKA cluster

Create the credentials the WekaClient and the CSI plugin use, and collect the endpoints the clients join through. Run these commands on a backend server of the WEKA cluster.

**Procedure**

1. Create two local users, one for the WekaClient and one for the CSI plugin:

```bash
weka user add <client-user> regular <client-password>
weka user add <csi-user> csi <csi-password>
```

The `csi` role lets the CSI plugin provision, mount, and unmount filesystems through the API. The `regular` role lets the WekaClient join the cluster and mount filesystems.

2. If the cluster requires join secret authentication, generate a join token for the WekaClient. A WekaCluster created by the operator always requires it. A cluster installed on dedicated servers requires it only if join secret authentication is enabled, as described in [Secure cluster membership with join secret authentication](https://docs.weka.io/security/secure-cluster-membership-with-join-secret-authentication.md). Otherwise, skip this step.

```bash
weka cluster join-token add --access-token-timeout 52w
```

This command sets a 52-week lifetime. The default is 30 days. Before the token expires, replace it as described in [Rotate the WekaClient join token](https://docs.weka.io/kubernetes/weka-operator-day-2-operations/cluster-maintenance.md#rotate-the-wekaclient-join-token) in Cluster maintenance.

3. List the drives containers that are up, with their IP addresses and ports:

```bash
weka cluster container -F container=drives0 -F status=UP -o hostname,ips,port --no-header
```

Select drives containers on several backend servers, so the clients can join while one server is down. Use the management IP of each container, with its port. Use the port that the command returns: usually 14000 on dedicated servers, or a port from the operator-assigned range when the cluster runs as a WekaCluster in Kubernetes. These IP and port pairs are the join endpoints for the WekaClient and the CSI plugin.

4. Verify that the filesystem for the Kubernetes volumes exists:

```bash
weka fs
```

## Install the WEKA Operator

Install the operator with the embedded CSI plugin enabled.

**Before you begin**

* Obtain the Quay.io credentials (`QUAY_USERNAME` and `QUAY_PASSWORD`) from the operator page on get.weka.io.
* Install `kubectl` with cluster-admin rights and Helm 3 on the workstation you deploy from.

**Procedure**

1. Create the image pull secret in the `weka-operator-system` namespace:

```bash
kubectl create namespace weka-operator-system
kubectl create secret docker-registry quay-io-robot-secret \
  --docker-server=quay.io \
  --docker-username=$QUAY_USERNAME \
  --docker-password=$QUAY_PASSWORD \
  --docker-email=$QUAY_USERNAME \
  --namespace=weka-operator-system
```

2. Apply the operator CRDs. Replace `<operator-version>` with the operator version:

```bash
helm show crds oci://quay.io/weka.io/helm/weka-operator --version <operator-version> \
  | kubectl apply --server-side -f -
```

3. Install the operator with embedded CSI:

```bash
helm upgrade --install weka-operator oci://quay.io/weka.io/helm/weka-operator \
  --namespace weka-operator-system \
  --version <operator-version> \
  --set imagePullSecret=quay-io-robot-secret \
  --set csi.installationEnabled=true
```

4. Verify that the `weka-operator-controller-manager` pod is `Running`:

```bash
kubectl -n weka-operator-system get pods
```

5. Optional: If the workers cannot reach `https://drivers.weka.io`, configure local driver distribution.\
   Follow [WEKA Operator driver management](https://docs.weka.io/kubernetes/weka-operator-deployments/weka-operator-driver-management.md). Set the WekaPolicy image to the same WEKA version as the WekaClient.

## Create the cluster secret

Store the credentials in two Kubernetes secrets, one for each user. The WekaClient reads `username`, `password`, `org`, and `join-secret` from `weka-client`. The CSI plugin reads `username`, `password`, `organization`, `endpoints`, and `scheme` from `weka-csi`.

**Procedure**

1. Create `weka-cluster-secret.yaml`. Use `stringData` so the values need no base64 encoding:

<pre class="language-yaml" data-title="weka-cluster-secret.yaml"><code class="lang-yaml">apiVersion: v1
kind: Secret
metadata:
  name: weka-client
  namespace: weka-operator-system
type: Opaque
stringData:
  username: &#x3C;client-user>
  password: &#x3C;client-password>
  org: Root
<strong>  join-secret: &#x3C;join-token>
</strong><strong>---
</strong><strong>apiVersion: v1
</strong><strong>kind: Secret
</strong><strong>metadata:
</strong><strong>  name: weka-csi
</strong><strong>  namespace: weka-operator-system
</strong><strong>type: Opaque
</strong><strong>stringData:
</strong><strong>  username: &#x3C;csi-user>
</strong><strong>  password: &#x3C;csi-password>
</strong><strong>  organization: Root
</strong><strong>  endpoints: 10.0.1.11:14000,10.0.1.12:14000,10.0.1.13:14000,10.0.1.14:14000
</strong><strong>  scheme: https
</strong></code></pre>

* `username` and `password`: the client user in `weka-client` and the CSI user in `weka-csi`, as you created them in Prepare the WEKA cluster.
* `join-secret`: the join token, if you generated one. If the cluster does not require join secret authentication, remove this line.
* `endpoints`: the join endpoints, separated by commas.
* `scheme`: `https` if the cluster API uses TLS (check with `weka security tls status`), otherwise `http`.

2. Apply the secrets:

```bash
kubectl apply -f weka-cluster-secret.yaml
```

## Deploy the WekaClient

Apply the WekaClient resource. The operator runs one client pod on each labeled worker, the same as a DaemonSet.

**Before you begin**

* The image version is the same as the WEKA cluster version or older.
* For DPDK, the data interface has the same name on every labeled worker.

**Procedure**

1. Create `weka-client.yaml`:

{% code title="weka-client.yaml" %}

```yaml
apiVersion: weka.weka.io/v1alpha1
kind: WekaClient
metadata:
  name: k8s-clients
  namespace: weka-operator-system
spec:
  image: quay.io/weka.io/weka-in-container:<weka-version>
  imagePullSecret: quay-io-robot-secret
  driversDistService: https://drivers.weka.io
  nodeSelector:
    weka.io/supports-clients: "true"
  wekaSecretRef: weka-client
  joinIpPorts:
    - 10.0.1.11:14000
    - 10.0.1.12:14000
    - 10.0.1.13:14000
    - 10.0.1.14:14000
  coresNum: 2
  portRange:
    basePort: 45000
  network:
    ethDevice: <data-nic>
  upgradePolicy:
    type: rolling
```

{% endcode %}

* `joinIpPorts`: the join endpoints you collected in Prepare the WEKA cluster.
* `driversDistService`: `https://drivers.weka.io`, or the full `.svc.cluster.local` address of the local driver distribution service.
* `network`: for DPDK, set `ethDevice` to the data interface. For UDP mode, replace the `ethDevice` line with `udpMode: true`.
* `coresNum`: the number of dedicated cores for each client. The operator requests `coresNum × 1564` MiB of HugePages for each client pod, so size the worker HugePages from this value as described in Prepare the worker nodes.

For all fields, see the [WekaClient API reference](https://weka.github.io/weka-k8s-api/wekaclient/).

2. Apply the WekaClient:

```bash
kubectl apply -f weka-client.yaml
```

3. Verify that the WekaClient is `Running` and that each labeled worker has a client WekaContainer in `Running` state:

```bash
kubectl -n weka-operator-system get wekaclient
kubectl -n weka-operator-system get wekacontainer -o wide
```

4. On a backend server, verify that the Kubernetes workers appear as client containers in `UP` status:

```bash
weka cluster container --clients
```

## Create a StorageClass and a PVC

When the WekaClient is `Running`, the operator deploys the CSI plugin. It does not create StorageClasses for a WekaClient that joins through `joinIpPorts`, so create one that uses the CSI secret, and then provision a volume.

**Procedure**

1. Verify that the CSI driver is registered and the CSI pods are running:

```bash
kubectl get csidriver
kubectl -n weka-operator-system get pods | grep -i csi
```

The CSI driver `csi.weka.io` is listed, with one CSI node pod on each client worker. If you set `csiConfig.csiGroup` in the WekaClient, the driver is named `<csiGroup>.weka.io`. Use that name as the StorageClass provisioner.

2. Create `storageclass.yaml`. Replace `<filesystem-name>` with the filesystem for the volumes:

{% code title="storageclass.yaml" %}

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: wekafs-dir
provisioner: csi.weka.io
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
parameters:
  volumeType: dir/v1
  filesystemName: <filesystem-name>
  capacityEnforcement: HARD
  csi.storage.k8s.io/provisioner-secret-name: weka-csi
  csi.storage.k8s.io/provisioner-secret-namespace: weka-operator-system
  csi.storage.k8s.io/controller-publish-secret-name: weka-csi
  csi.storage.k8s.io/controller-publish-secret-namespace: weka-operator-system
  csi.storage.k8s.io/controller-expand-secret-name: weka-csi
  csi.storage.k8s.io/controller-expand-secret-namespace: weka-operator-system
  csi.storage.k8s.io/node-stage-secret-name: weka-csi
  csi.storage.k8s.io/node-stage-secret-namespace: weka-operator-system
  csi.storage.k8s.io/node-publish-secret-name: weka-csi
  csi.storage.k8s.io/node-publish-secret-namespace: weka-operator-system
```

{% endcode %}

3. Apply the StorageClass:

```bash
kubectl apply -f storageclass.yaml
```

4. Create a PVC that uses the StorageClass, and verify that its status is `Bound`.\
   For PVC examples, see [Dynamic and static provisioning](https://docs.weka.io/appendices/weka-csi-plugin/dynamic-and-static-provisioning.md).

**Related topics**

[WEKA Operator full deployment workflow](https://docs.weka.io/kubernetes/weka-operator-deployments/weka-operator-full-deployment-workflow.md)

[Deploy WEKA on cloud-managed Kubernetes services](https://docs.weka.io/kubernetes/weka-operator-deployments/deploy-the-weka-client-on-amazon-eks.md)

[WEKA Operator secrets management](https://docs.weka.io/kubernetes/weka-operator-deployments/weka-operator-secrets-management.md)

[Troubleshoot WEKA Operator deployments](https://docs.weka.io/kubernetes/weka-operator-deployments/troubleshoot-weka-operator-deployments.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.weka.io/kubernetes/weka-operator-deployments/deploy-weka-clients-only-on-kubernetes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
