Add option to use local images for k8s deployment
This commit is contained in:
parent
17ab5170f1
commit
faa7546e17
@ -10,7 +10,8 @@ Param(
|
||||
[parameter(Mandatory=$false)][string]$aksName="",
|
||||
[parameter(Mandatory=$false)][string]$aksRg="",
|
||||
[parameter(Mandatory=$false)][string]$imageTag="latest",
|
||||
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false
|
||||
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false,
|
||||
[parameter(Mandatory=$false)][bool]$useLocalImages=$false
|
||||
)
|
||||
|
||||
$dns = $externalDns
|
||||
@ -22,6 +23,12 @@ if ($useLocalk8s -eq $true) {
|
||||
$dns="localhost"
|
||||
}
|
||||
|
||||
$pullPolicy = "Always"
|
||||
|
||||
if ($useLocalImages -eq $true) {
|
||||
$pullPolicy = "IfNotPresent"
|
||||
}
|
||||
|
||||
if ($externalDns -eq "aks") {
|
||||
if ([string]::IsNullOrEmpty($aksName) -or [string]::IsNullOrEmpty($aksRg)) {
|
||||
Write-Host "Error: When using -dns aks, MUST set -aksName and -aksRg too." -ForegroundColor Red
|
||||
@ -82,7 +89,7 @@ if ($deployCharts) {
|
||||
}
|
||||
else {
|
||||
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
|
||||
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
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user