# Node Offline, Replacement, Deletion This guide is helpful for kubernetes node offline testing. ## Create a kubernetes cluster with a control-plane and 2 lanes ```shell k3d registry create k3d.localhost --port 21700 # We can associate our local registry node in case you need it later k3d cluster create ien-0 --registry-use k3d-k3d.localhost:21700 \ --k3s-node-label "node.ncr.com/class=server@server:0" \ --k3s-node-label "node.ncr.com/lane=0@server:0" \ --k3s-node-label "node.ncr.com/role=control-plane@server:0" \ --k3s-node-label "node.ncr.com/hostname=ien-0@server:0" \ k3d node create -c ien-0 ien-1 --k3s-node-label node.ncr.com/class=touchpoint,node.ncr.com/lane=1,node.ncr.com/role=worker,node.ncr.com/hostname=ien-1 k3d node create -c ien-0 ien-2 --k3s-node-label node.ncr.com/class=touchpoint,node.ncr.com/lane=2,node.ncr.com/role=worker,node.ncr.com/hostname=ien-2 ``` ## Connect it to Edge > You may need to suspend some pallets as currently not all DSDS pieces work. ```shell edge beta connect \ --banner=mailmen \ --organization=edge-dev1-retail-b526aa \ --store= \ --kubeconfig=$HOME/.kube/config \ --kubeconfig-context=k3d-ien-0 \ --cluster-type=dsds \ --api-endpoint=https://dev1.edge-preprod.dev/api/v2 \ --username= \ --password= ``` ## CouchDB Image issue There is an issue where for some reason, couchdb hosted on our repositories does not run on kind or k3d cluster. ```shell kubectl patch UnpackedPallet -p '{"spec": {"suspend": true}}' --type=merge couchdb- ``` * Replace couchdb image tag with `couchdb:3.3.1` in CouchDB StatefulSet Persistence ## Taking a node offline ```shell # example taking the 2nd touchpoint offline docker network disconnect k3d-ien k3d-ien-2-0 ``` ## Taking a node offline ```shell # example taking the 2nd touchpoint offline docker network disconnect k3d-ien k3d-ien-2-0 ``` ## Node Replacement There is document on to perform graceful node replacement [here](https://docs.edge-infra.dev/edge/sds/nodereinstallation/). ```shell k3d node delete k3d-ien-2-0 ``` ## Edge OS We will to take a closer look at the sds [cluster provisioning doc](https://docs.edge-infra.dev/edge/sds/clusterprovisioning/) Bootstrapping a dsds cluster scripts can be found [here](https://github.com/ncrvoyix-swt-retail/ien-iac/wiki)