Skip to content

Instantly share code, notes, and snippets.

@jfuerlinger
Last active July 16, 2021 10:21
Show Gist options
  • Save jfuerlinger/e0b4eca486c311451e17dfebe354bd9a to your computer and use it in GitHub Desktop.
Save jfuerlinger/e0b4eca486c311451e17dfebe354bd9a to your computer and use it in GitHub Desktop.
Scripts to set up and manage the aks cluster
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
/subscriptions/01964263-bc84-4b67-b94a-2a65733186ef/resourceGroups/kubernetes-gettingstarted-rg/providers/Microsoft.ContainerRegistry/registries/crjfuerlinger
az container app up --acr crjfuerlinger --repository https://github.com/jfuerlinger/net6tutorial
az container app up --acr /subscriptions/01964263-bc84-4b67-b94a-2a65733186ef/resourceGroups/kubernetes-gettingstarted-rg/providers/Microsoft.ContainerRegistry/registries/crjfuerlinger --repository https://github.com/jfuerlinger/net6tutorial
groupId=$(az group show --name kubernetes-gettingstarted-rg --query id --output tsv)
az ad sp create-for-rbac --scope $groupId --role Contributor --sdk-auth
{
"clientId": "8647a535-740d-4036-9279-c1d222917485",
"clientSecret": "oHwXv323kRJvZdcuc572oQZ-n0CVbij1uM",
"subscriptionId": "01964263-bc84-4b67-b94a-2a65733186ef",
"tenantId": "4fa22c8d-4fb5-42ff-9e3d-1ff5770adce1",
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
"resourceManagerEndpointUrl": "https://management.azure.com/",
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
"galleryEndpointUrl": "https://gallery.azure.com/",
"managementEndpointUrl": "https://management.core.windows.net/"
}
$registryId=az acr show --name crjfuerlinger --query id --output tsv
az role assignment create --assignee 8647a535-740d-4036-9279-c1d222917485 --scope $registryId --role AcrPush
{
"canDelegate": null,
"condition": null,
"conditionVersion": null,
"description": null,
"id": "/subscriptions/01964263-bc84-4b67-b94a-2a65733186ef/resourceGroups/kubernetes-gettingstarted-rg/providers/Microsoft.ContainerRegistry/registries/crjfuerlinger/providers/Microsoft.Authorization/roleAssignments/a6ffaf8a-4b0f-4684-b024-49e72b3fe9c6",
"name": "a6ffaf8a-4b0f-4684-b024-49e72b3fe9c6",
"principalId": "c1f40f89-5fe3-42fc-acc6-8e9ec27bfa7d",
"principalType": "ServicePrincipal",
"resourceGroup": "kubernetes-gettingstarted-rg",
"roleDefinitionId": "/subscriptions/01964263-bc84-4b67-b94a-2a65733186ef/providers/Microsoft.Authorization/roleDefinitions/8311e382-0749-4cb8-b61a-304f252e45ec",
"scope": "/subscriptions/01964263-bc84-4b67-b94a-2a65733186ef/resourceGroups/kubernetes-gettingstarted-rg/providers/Microsoft.ContainerRegistry/registries/crjfuerlinger",
"type": "Microsoft.Authorization/roleAssignments"
}
az container show --resource-group kubernetes-gettingstarted-rg --name catalog-app --query {FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}" --output table
kubectl create secret docker-registry acr-secret --docker-server=crjfuerlinger.azurecr.io --docker-username=8647a535-740d-4036-9279-c1d222917485 --docker-password=oHwXv323kRJvZdcuc572oQZ-n0CVbij1uM
# https://fluxcd.io/legacy/flux/tutorials/get-started/
$GitHubUser='jfuerlinger'
fluxctl install --git-user=$GitHubUser --git-email=$GitHubUser@users.noreply.github.com --git-url=git@github.com:$GitHubUser/net6tutorial --git-path=namespaces,workloads --namespace=flux | kubectl apply -f -
kubectl -n flux rollout status deployment/flux
fluxctl identity --k8s-fwd-ns flux
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC+zSBMI8PHCGNJOu+YLVlCzrbqUq2G5Qp12lE+wMBc+dvbFg9A5bJcd6UFL2pEVDWbBq6XcEVu4w8XlabfmBgA5UKzSbJ7d+iYhlC66ad+YBoT0BYVDhd/bk5ifF3SJQrjcQE61gGI6gbx1bKIu0drnkvxmzQEjnZyqaGjq2gI7BrswOgKHmCxKYgFPh1PGfixmSLBfk+WbJglFoikhsv/ATUludzQVmTNho0im6GvbxOZfIzlNNIqug0NUVu5hYINwzZePs5ejehuwexaVZBiFdg+ZiRgfD0pqrfpCJE3vRLVm6FgEGzY/7+Uksl51+NMflNqulyS+1w6rXOwaq7a/VFTNCRxKov5ohUyQZFrSrreUQgk4JKwrqGw72+Xwy6wh97/Rd7N7Q2mvDDb66MLkDV5EwKxyDlEiGpH4+q9SubJppEMa76uIRFNVWjEELccgL4bfxe6ndOLLLwlDxjbJovaLgkJ1jn3wxI7cTV74mqGSpGIqTIEJ7mp0GaF14M= root@flux-589fd6d695-fjd8c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment