Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit faa7546

Browse files
committed
Add option to use local images for k8s deployment
1 parent 17ab517 commit faa7546

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

k8s/helm/deploy-all.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Param(
1010
[parameter(Mandatory=$false)][string]$aksName="",
1111
[parameter(Mandatory=$false)][string]$aksRg="",
1212
[parameter(Mandatory=$false)][string]$imageTag="latest",
13-
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false
13+
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false,
14+
[parameter(Mandatory=$false)][bool]$useLocalImages=$false
1415
)
1516

1617
$dns = $externalDns
@@ -22,6 +23,12 @@ if ($useLocalk8s -eq $true) {
2223
$dns="localhost"
2324
}
2425

26+
$pullPolicy = "Always"
27+
28+
if ($useLocalImages -eq $true) {
29+
$pullPolicy = "IfNotPresent"
30+
}
31+
2532
if ($externalDns -eq "aks") {
2633
if ([string]::IsNullOrEmpty($aksName) -or [string]::IsNullOrEmpty($aksRg)) {
2734
Write-Host "Error: When using -dns aks, MUST set -aksName and -aksRg too." -ForegroundColor Red
@@ -82,7 +89,7 @@ if ($deployCharts) {
8289
}
8390
else {
8491
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
85-
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
92+
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$pullPolicy --name="$appName-$chart" $chart
8693
}
8794
}
8895
}

0 commit comments

Comments
 (0)