# create infra
cd infra/
cdk deploy --require-approval never
# connect k3s node
aws ssm start-session ${INSTANCE_ID}
K3s Manual create cluster via k3d
# add /usr/local/bin/ to $PATH
export PATH=$PATH:/usr/local/bin/
# Download kubectl
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kuebctl /usr/local/bin/
# install k3d
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
# k3d create cluster named portainer
k3d cluster create portainer \
--api-port 6443 \
--servers 1 \
--agents 1 \
-p 30000-32767:30000-32767@server[0]
# Create portainer
curl -LO https://raw.githubusercontent.com/portainer/portainer-k8s/master/portainer-nodeport.yaml | kubectl apply -f -
k3d node list
NAME ROLE CLUSTER STATUS
k3d-portainer-agent-0 agent portainer running
k3d-portainer-server-0 server portainer running
k3d-portainer-serverlb loadbalancer portainer running
k3d cluster delete portainer
cdk destroy -f