Metric server install:
https://github.com/kubernetes-sigs/metrics-server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml| # https://www.baeldung.com/linux/use-command-line-arguments-in-bash-script | |
| # usage: <script> -u <username> -a <age> -f <fullname> | |
| while getopts u:a:f: flag | |
| do | |
| case "${flag}" in | |
| u) username=${OPTARG};; | |
| a) age=${OPTARG};; | |
| f) fullname=${OPTARG};; | |
| esac | |
| done |
Metric server install:
https://github.com/kubernetes-sigs/metrics-server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml| #!/bin/bash | |
| # Substitute variables here | |
| ORG_NAME="<ORG_NAME>" | |
| GITHUB_INSTANCE="<GITHUB_INSTANCE>" | |
| URL="https://${GITHUB_INSTANCE}/api/v3/orgs/${ORG_NAME}/repos" | |
| curl ${URL} | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["clone_url"]} ]}' |
| docker run -d \ | |
| -e POSTGRES_PASSWORD=SuperSecret \ | |
| -v ~/postgresql/13/data:/var/lib/postgresql/data \ # windows: -v d:/postgresql/13/data:/var/lib/postgresql/data | |
| -p 5432:5432 \ | |
| --name postgres \ | |
| postgres:13 | |
| docker run -p 5050:80 -d \ | |
| -e 'PGADMIN_DEFAULT_EMAIL=admin@domain.com' \ | |
| -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \ |
| mkdir -p /home/ubuntu/couchdb/data | |
| docker run -d \ | |
| --restart unless-stopped \ | |
| -v /home/ubuntu/couchdb/data:/opt/couchdb/data \ | |
| -e COUCHDB_USER=admin \ | |
| -e COUCHDB_PASSWORD=strongPassword \ | |
| -p 5984:5984 \ | |
| --name couchdb \ | |
| couchdb:latest |
| <ItemGroup> | |
| <Protobuf Include="..\Protos\greet.proto" GrpcServices="Server" Link="Protos\greet.proto" /> | |
| </ItemGroup> |
| public static class ServiceExtensions | |
| { | |
| /// <summary> | |
| /// Creates a custom configuration for easier development of Azure Functions. | |
| /// When environment is not Development, it adds support for keyvault | |
| /// </summary> | |
| /// <param name="builder"></param> | |
| /// <returns></returns> | |
| public static IConfiguration GetCustomConfiguration(this IFunctionsHostBuilder builder) | |
| { |
| # check to see if secret exists in keyvault, otherwise throw error | |
| $SecretName = "HttpClientConfiguration--ApiKey" | |
| $doesExist=$(az keyvault secret show ` | |
| --vault-name $KeyVaultName ` | |
| --name $SecretName ` | |
| --query id -o tsv) | |
| if ($doesExist) { | |
| echo "Secret '$SecretName' found in vault '$KeyVaultName' OK" | |
| } else { | |
| echo "Expecting secret '$SecretName' to be in vault '$KeyVaultName'" |
| builder.Services.Configure(delegate(ServiceBusOptions options) | |
| { | |
| options.MessageHandlerOptions.AutoComplete = false; | |
| }); |
| # Set other app settings | |
| $values = [System.IO.File]::ReadAllText($appSettings) | |
| $appSettingsList = $values.Split([System.Environment]::NewLine) | |
| echo "setting app settings: $appSettingsList" | |
| az functionapp config appsettings set ` | |
| --name $functionAppName ` | |
| --resource-group $resourceGroup ` | |
| --settings $appSettingsList |