Skip to content

Commit

Permalink
add volume when creating cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed Feb 26, 2024
1 parent cb30f74 commit 026ddb3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/create-k3d-cluster.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ param(
# When set to true, the cluster will be deleted first
[switch]$DeleteClusterFirst = $false,
# When set to true, the cluster will be deleted without asking for confirmation
[switch]$ForceDelete = $false
[switch]$ForceDelete = $false,
# Host Volume Path for PersistentVolume
[Parameter(Mandatory=$true)]
[string]$HostVolumePath = "D:/k3dvolume"

)

# $clusterName="k3dcluster"
Expand Down Expand Up @@ -46,6 +50,9 @@ k3d cluster create $ClusterName `
--agents $NumAgents `
--k3s-arg="--tls-san=${hostIp}@server:0" `
--k3s-arg="--tls-san=precision5820@server:0" `
-p "${IngressHostPort}:80@loadbalancer"
--port "${IngressHostPort}:80@loadbalancer" `
--port "8443:443@loadbalancer" `
--volume ${HostVolumePath}:/k3dvolume@all
#--volume ${HostVolumePath}:/tmp/k3dvolume@all

Write-Host "Cluster '$ClusterName' created."

0 comments on commit 026ddb3

Please sign in to comment.