This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: demo-service | |
| labels: | |
| app: demo | |
| spec: | |
| ports: | |
| - protocol: TCP | |
| port: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: ns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: kustomize.config.k8s.io/v1beta1 | |
| kind: Kustomization | |
| resources: | |
| - namespace.yaml | |
| - service.yaml | |
| - deployment.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: demo-deployment | |
| labels: | |
| app: demo | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: demo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.awesomeprject; | |
| import javax.sql.DataSource; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.cloud.context.config.annotation.RefreshScope; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.boot.jdbc.DataSourceBuilder; | |
| import org.json.JSONTokener; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET aad_validate_oids_in_tenant = off; | |
| CREATE ROLE myuser WITH LOGIN PASSWORD '<YOU_IDENTITY_CLIENT_ID>' IN ROLE azure_ad_user; | |
| CREATE DATABASE my-sp-db; | |
| GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO myuser; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export DB_SERVER=my-sp-db-server | |
| export DB_RG=my-db-rg | |
| export DB_NAME=my-sp-db | |
| export PGSSLMODE=require | |
| az group create --name=my-database-rg --location eastus | |
| az postgres server create --resource-group ${DB_RG} --name ${DB_SERVER} --location eastus --admin-user myadmin --admin-password P@ssword123 --sku-name B_Gen5_1 | |
| az postgres db create -g ${DB_RG} -s ${DB_SERVER} -n ${DB_NAME} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export IDENTITY_CLIENT_ID="$(az identity show -g ${IDENTITY_RESOURCE_GROUP} -n ${IDENTITY_NAME} --query clientId -otsv)" | |
| export IDENTITY_RESOURCE_ID="$(az identity show -g ${IDENTITY_RESOURCE_GROUP} -n ${IDENTITY_NAME} --query id -otsv)" | |
| export RG_RESOURCE_ID="$(az group show -g ${RESOURCE_GROUP} --query id -otsv)" | |
| export NODE_GROUP=$(az aks show -g ${RESOURCE_GROUP} -n ${CLUSTER_NAME} --query nodeResourceGroup -o tsv) | |
| export NODES_RESOURCE_ID=$(az group show -n $NODE_GROUP -o tsv --query "id") | |
| az role assignment create --role "Reader" --assignee "$IDENTITY_CLIENT_ID" --scope $NODES_RESOURCE_ID | |
| az role assignment create --role "acrpull" --assignee "$IDENTITY_CLIENT_ID" --scope $RG_RESOURCE_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export IDENTITY_RESOURCE_GROUP="my-identity-rg" | |
| export IDENTITY_NAME="sp-application-identity" | |
| az group create --name ${IDENTITY_RESOURCE_GROUP} --location eastus | |
| az identity create --resource-group ${IDENTITY_RESOURCE_GROUP} --name ${IDENTITY_NAME} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| az feature register --name EnablePodIdentityPreview --namespace Microsoft.ContainerService | |
| az extension update --name aks-preview |