Skip to content

Instantly share code, notes, and snippets.

@sixeyed
Last active July 9, 2024 18:45
Show Gist options
  • Save sixeyed/15f25dbbd6454f665fba58fde11299f9 to your computer and use it in GitHub Desktop.
Save sixeyed/15f25dbbd6454f665fba58fde11299f9 to your computer and use it in GitHub Desktop.
Snippets
az aks nodepool add -g $rgName --cluster-name $aksName `
-n $nodePoolName `
--mode User `
--enable-cluster-autoscaler `
--node-count 1 `
--min-count 0 `
--max-count $nodeMaxCount `
--node-osdisk-size $aksNodeDiskSize `
--node-vm-size $nodeVmSize `
--vnet-subnet-id $subnetId `
--zones $zones `
--labels app-role=$role app-environment=$environmentValue `
--node-taints "app-role=$($role):NoSchedule,app-environment=$($environmentValue):NoSchedule"
az aks create --resource-group istio-test `
--location eastus `
--name istio-test `
--kubernetes-version 1.29.4 `
--enable-azure-service-mesh `
--node-count 2 `
--node-vm-size Standard_D2pls_v5
$aks=az aks show -g $rgName -n $aksName | ConvertFrom-Json
$myIp=curl -sSL ifconfig.me
$allowedIps = $aks.apiServerAccessProfile.authorizedIpRanges + $myIp
az aks update -g $rgName -n $aksName --api-server-authorized-ip-ranges $(${allowedIps} -join ',')
$aks=az aks show -g $rgName -n $aksName | ConvertFrom-Json
$myIp=curl -sSL ifconfig.me
$allowedIps = $aks.apiServerAccessProfile.authorizedIpRanges | where {-not $_.StartsWith($myIp)}
az aks update -g $rgName -n $aksName --api-server-authorized-ip-ranges $(${allowedIps} -join ',')
az aks wait -g $rgName -n $aksName --updated --timeout 1800
az aks wait -g $rgName -n $aksName --custom "powerState.code=='Running'" --timeout 1800
$versionedSecretId = $(az keyvault certificate show -n $tlsCertName --vault-name $keyVaultName --query "sid" -o tsv)
$unversionedSecretId = $versionedSecretId.Substring(0, $versionedSecretId.LastIndexOf('/'))
az network application-gateway ssl-cert create --gateway-name $appgwName -g $rgName -n $tlsCertName --key-vault-secret-id $unversionedSecretId
$info = docker version -f json | ConvertFrom-Json
$env:DOCKER_BUILD_OS = $info.Server.Os.ToLower()
$env:DOCKER_BUILD_CPU = $info.Server.Arch.ToLower()
docker compose `
-f docker-compose.yml `
-f docker-compose-build-tags.yml `
build
# in build-tags.yaml:
# image: sixeyed/app:1.0-${DOCKER_BUILD_OS}-${DOCKER_BUILD_CPU}
FROM build AS pkg
ARG VERSION_NUMBER=0.1
ARG BUILD_COUNTER=0
RUN dotnet publish -c Release -o /out /property:Version=${VERSION_NUMBER}.${BUILD_COUNTER}.0 App.csproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment