diff --git a/docs/assets/scripts/developer/k3d-dev.sh b/docs/assets/scripts/developer/k3d-dev.sh index 42dc7345b0167bae7e56c691bd40edaa52889d54..54860999bb1e24034803262ddb7e125ff5611986 100755 --- a/docs/assets/scripts/developer/k3d-dev.sh +++ b/docs/assets/scripts/developer/k3d-dev.sh @@ -434,6 +434,12 @@ k3d_command+=" --k3s-arg \"--disable=traefik@server:0\" --k3s-arg \"--disable=m # Port mappings to support Istio ingress + API access k3d_command+=" --port 80:80@loadbalancer --port 443:443@loadbalancer --api-port 6443" +K3S_IMAGE_TAG=${K3S_IMAGE_TAG:=""} +if [[ ! -z "$K3S_IMAGE_TAG" ]]; then + echo "Using custom K3S image tag $K3S_IMAGE_TAG..." + k3d_command+=" --image docker.io/rancher/k3s:$K3S_IMAGE_TAG" +fi + # Add MetalLB specific k3d config if [[ "$METAL_LB" == true ]]; then # create docker network for k3d cluster diff --git a/docs/developer/aws-k3d-script.md b/docs/developer/aws-k3d-script.md index 104d56411475f39554f897976b6492e53ee01776..b5034023f341a406a9a2030dfb918827577c12e6 100644 --- a/docs/developer/aws-k3d-script.md +++ b/docs/developer/aws-k3d-script.md @@ -58,18 +58,28 @@ k3d-dev.sh -b -p -m -d -h The script uses the default AWS profile and defaults the VPC id and AMI id. To change this default behavior you can export environment variables before running the script. -Run the script with a specific AWS profile by first exporting the AWS_PROFILE environment variable +Run the script with a specific AWS profile by first exporting the AWS_PROFILE environment variable: ```shell export AWS_PROFILE=my-aws-profile ``` -To run the script with a specific VPC +To run the script with a specific VPC: ```shell export VPC_ID=vpc-XXXXXXXXXXXX ``` -To run the script with a specific AMI +To run the script with a specific AMI: ```shell export AMI_ID=ami-XXXXXXXXXX ``` +To specify a specific Kubernetes version (the eligible choices are [here](https://hub.docker.com/r/rancher/k3s/tags)): +```shell +export K3S_IMAGE_TAG=sometag +``` + +You can also run these inline with the script, without exporting them to your environment. Example: + +```shell +K3S_IMAGE_TAG=v1.24.12-k3s1 ./docs/assets/scripts/developer/k3d-dev.sh +``` ## After Running The Script