Skip to content

Commit

Permalink
Also deploy workflow-gen with bicep template.
Browse files Browse the repository at this point in the history
Current bicep template does not register or deploys the workflow-gen
app. This fixes that.

Signed-off-by: Tiago Alves Macambira <[email protected]>
  • Loading branch information
tmacam committed Sep 18, 2023
1 parent 58fdaa3 commit a88cc49
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 10 deletions.
80 changes: 80 additions & 0 deletions deploy/aks/apps/workflow-gen-deploy.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@secure()
param kubeConfig string
param kubernetesNamespace string

import '[email protected]' with {
namespace: 'default'
kubeConfig: kubeConfig
}

resource coreService_workflowGen 'core/Service@v1' = {
metadata: {
name: 'workflow-gen'
labels: {
app: 'workflow-gen'
}
namespace: kubernetesNamespace
}
spec: {
selector: {
app: 'workflow-gen'
}
ports: [
{
protocol: 'TCP'
port: 9988
targetPort: 9988
}
]
type: 'ClusterIP'
}
}

resource appsDeployment_workflowGenApp 'apps/Deployment@v1' = {
metadata: {
name: 'workflow-gen-app'
labels: {
app: 'workflow-gen'
}
namespace: kubernetesNamespace
}
spec: {
replicas: 1
selector: {
matchLabels: {
app: 'workflow-gen'
}
}
template: {
metadata: {
labels: {
app: 'workflow-gen'
}
annotations: {
'dapr.io/enabled': 'true'
'dapr.io/app-id': 'workflow-gen'
'dapr.io/log-as-json': 'true'
'prometheus.io/scrape': 'true'
'prometheus.io/port': '9988'
}
}
spec: {
containers: [
{
name: 'workflow-gen'
image: 'daprtests.azurecr.io/workflow-gen:dev'
ports: [
// This app does NOT expose an HTTP application port (so no 80 or 3000 port mapping here)
// This app exposes a Prometheus metrics endpoint on port 9988
{
name: 'prom'
containerPort: 9988
}
]
imagePullPolicy: 'Always'
}
]
}
}
}
}
36 changes: 26 additions & 10 deletions deploy/aks/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,8 @@ module hashtagCounter 'apps/hashtag-counter-deploy.bicep' = {
]
}



module pubsubWorkflowApp 'apps/pubsub-workflow-deploy.bicep' = {
name: '${clusterName}--app--pubsub-workflow'
module snapshotApp 'apps/snapshot-deploy.bicep' = {
name: '${clusterName}--app--snapshot'
params: {
kubeConfig: aks.listClusterAdminCredential().kubeconfigs[0].value
kubernetesNamespace: longhaulNamespace.outputs.kubernetesNamespace
Expand All @@ -296,11 +294,27 @@ module pubsubWorkflowApp 'apps/pubsub-workflow-deploy.bicep' = {
daprExtension
longhaulNamespace
pubSubComponent
hashtagActor
]
}

module snapshotApp 'apps/snapshot-deploy.bicep' = {
name: '${clusterName}--app--snapshot'
module validationWorker 'apps/validation-worker-deploy.bicep' = {
name: '${clusterName}--app--validation-worker'
params: {
kubeConfig: aks.listClusterAdminCredential().kubeconfigs[0].value
kubernetesNamespace: longhaulNamespace.outputs.kubernetesNamespace
}
dependsOn: [
daprExtension
longhaulNamespace
snapshotApp
]
}

// The pub-sub workflow application is independent from the others

module pubsubWorkflowApp 'apps/pubsub-workflow-deploy.bicep' = {
name: '${clusterName}--app--pubsub-workflow'
params: {
kubeConfig: aks.listClusterAdminCredential().kubeconfigs[0].value
kubernetesNamespace: longhaulNamespace.outputs.kubernetesNamespace
Expand All @@ -309,19 +323,21 @@ module snapshotApp 'apps/snapshot-deploy.bicep' = {
daprExtension
longhaulNamespace
pubSubComponent
hashtagActor
]
}

module validationWorker 'apps/validation-worker-deploy.bicep' = {
name: '${clusterName}--app--validation-worker'

// The Workflow Generation application is independent from the others

module workflowGenApp 'apps/workflow-gen-deploy.bicep' = {
name: '${clusterName}--app--workflow-gen'
params: {
kubeConfig: aks.listClusterAdminCredential().kubeconfigs[0].value
kubernetesNamespace: longhaulNamespace.outputs.kubernetesNamespace
}
dependsOn: [
daprExtension
longhaulNamespace
snapshotApp
statestoreComponent
]
}

0 comments on commit a88cc49

Please sign in to comment.