functions/Stack/InstallStackInKubernetes.ps1
<#
.SYNOPSIS InstallStackInKubernetes .DESCRIPTION InstallStackInKubernetes .INPUTS InstallStackInKubernetes - The name of InstallStackInKubernetes .OUTPUTS None .EXAMPLE InstallStackInKubernetes .EXAMPLE InstallStackInKubernetes #> function InstallStackInKubernetes() { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $namespace , [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $package , [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $packageUrl , [bool] $isOnPrem = $false ) Write-Verbose 'InstallStackInKubernetes: Starting' [hashtable]$Return = @{} if ([string]::IsNullOrWhiteSpace($(kubectl get namespace $namespace --ignore-not-found=true))) { Write-Information -MessageData "namespace $namespace does not exist so creating it" kubectl create namespace $namespace } if ($namespace -ne "kube-system") { CleanOutNamespace -namespace $namespace } InstallHelmPackage ` -namespace $namespace ` -package $package ` -packageUrl $packageUrl ` -isOnPrem $isOnPrem Write-Verbose 'InstallLoadBalancerHelmPackage: Done' WaitForPodsInNamespace -namespace $namespace -interval 5 -Verbose # read tcp ports and update ngnix with those ports SetTcpPortsForStack -namespace $namespace -Verbose Write-Verbose 'InstallStackInKubernetes: Done' return $Return } Export-ModuleMember -Function "InstallStackInKubernetes" |