Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also deploy workflow-gen with bicep template. #192

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
]
}