-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide guidance how to use Azure AD Pod Identity with KEDA (#22)
- Loading branch information
1 parent
e201644
commit 88630d1
Showing
20 changed files
with
666 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Push Docker Images | ||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
shipments: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Docker Login | ||
uses: docker/login-action@v1.6.0 | ||
with: | ||
registry: ghcr.io | ||
username: kedacore | ||
password: ${{ secrets.CONTAINER_REGISTRY_KEY }} | ||
- name: Build the Docker image | ||
run: docker build ./src/ --file ./src/Keda.Samples.Dotnet.OrderProcessor/Dockerfile --tag ghcr.io/kedacore/sample-dotnet-worker-servicebus-queue:latest | ||
- name: Push the Docker image | ||
run: docker push ghcr.io/kedacore/sample-dotnet-worker-servicebus-queue:latest |
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: TriggerAuthentication | ||
metadata: | ||
name: trigger-auth-service-bus-orders | ||
spec: | ||
podIdentity: | ||
provider: azure | ||
--- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: order-scaler | ||
spec: | ||
scaleTargetRef: | ||
name: order-processor | ||
# minReplicaCount: 0 Change to define how many minimum replicas you want | ||
maxReplicaCount: 10 | ||
triggers: | ||
- type: azure-servicebus | ||
metadata: | ||
namespace: <namespace-name> | ||
queueName: orders | ||
messageCount: '5' | ||
authenticationRef: | ||
name: trigger-auth-service-bus-orders |
47 changes: 47 additions & 0 deletions
47
deploy/managed-identity/deploy-app-with-managed-identity.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: aadpodidentity.k8s.io/v1 | ||
kind: AzureIdentity | ||
metadata: | ||
name: <app-identity-name> | ||
annotations: | ||
aadpodidentity.k8s.io/Behavior: namespaced | ||
spec: | ||
type: 0 # 0 means User-assigned MSI | ||
resourceID: <app-identity-resource-id> | ||
clientID: <app-identity-id> | ||
--- | ||
apiVersion: aadpodidentity.k8s.io/v1 | ||
kind: AzureIdentityBinding | ||
metadata: | ||
name: <app-identity-name>-binding | ||
spec: | ||
azureIdentity: <app-identity-name> | ||
selector: order-processor | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: order-processor | ||
labels: | ||
app: order-processor | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: order-processor | ||
template: | ||
metadata: | ||
labels: | ||
app: order-processor | ||
aadpodidbinding: order-processor | ||
spec: | ||
containers: | ||
- name: order-processor | ||
image: ghcr.io/kedacore/sample-dotnet-worker-servicebus-queue:latest | ||
env: | ||
- name: KEDA_SERVICEBUS_AUTH_MODE | ||
value: ManagedIdentity | ||
- name: KEDA_SERVICEBUS_HOST_NAME | ||
value: <namespace-name>.servicebus.windows.net | ||
- name: KEDA_SERVICEBUS_QUEUE_NAME | ||
value: orders | ||
- name: KEDA_SERVICEBUS_IDENTITY_USERASSIGNEDID | ||
value: <app-identity-id> |
16 changes: 16 additions & 0 deletions
16
deploy/managed-identity/deploy-autoscaling-infrastructure.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: aadpodidentity.k8s.io/v1 | ||
kind: AzureIdentity | ||
metadata: | ||
name: <autoscaler-identity-name> | ||
spec: | ||
type: 0 # 0 means User-assigned MSI | ||
resourceID: <autoscaler-identity-resource-id> | ||
clientID: <autoscaler-identity-id> | ||
--- | ||
apiVersion: aadpodidentity.k8s.io/v1 | ||
kind: AzureIdentityBinding | ||
metadata: | ||
name: <autoscaler-identity-name>-binding | ||
spec: | ||
azureIdentity: <autoscaler-identity-name> | ||
selector: app-autoscaler |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.