【问题标题】:Containerized logic app not working when deployed to AKS容器化逻辑应用在部署到 AKS 时无法正常工作
【发布时间】:2023-02-01 05:10:33
【问题描述】:

我们正在尝试将逻辑应用程序部署为 AKS 中的容器化工作负载。以下是我们的 Docker 文件:

FROM mcr.microsoft.com/azure-functions/dotnet:3.0.14492-appservice

ENV AzureWebJobsStorage=<StorageAccount connection string>
ENV AZURE_FUNCTIONS_ENVIRONMENT Development
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
ENV FUNCTIONS_V2_COMPATIBILITY_MODE=true

COPY ./bin/release/netcoreapp3.1/publish/ /home/site/wwwroot

以下是我们的部署清单文件:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: pfna-pgt-sf-pdfextract
  namespace: canary
  labels:
    app: pfna-pgt-sf-pdfextract
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pfna-pgt-sf-pdfextract
  template:
    metadata:
      labels:
        app: pfna-pgt-sf-pdfextract
    spec:
      nodeSelector:
        beta.kubernetes.io/os: linux
      containers:
        - name: pfna-pgt-sf-pdfextract
          image: "image_link"
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 250m
              memory: 256Mi
          ports:
            - containerPort: 80
          env:
            - name: AzureBlob_connectionString
              value: <connection_string>
            - name: AzureWebJobsStorage
              value: <connection_string>
      imagePullSecrets:
        - name: sbx-acr-secret
---
apiVersion: v1
kind: Service
metadata:
  name: pfna-pgt-sf-pdfextract
  namespace: canary
  labels:
    app: pfna-pgt-sf-pdfextract
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http-pfna-pgt-sf-pdfextract
  selector:
    app: pfna-pgt-sf-pdfextract

以下是 connections.json:

{
  "serviceProviderConnections": {
    "AzureBlob": {
      "parameterValues": {
        "connectionString": "@appsetting('AzureWebJobsStorage')"
      },
      "serviceProvider": {
        "id": "/serviceProviders/AzureBlob"
      },
      "displayName": "localAzureBlob"
    }
  },
  "managedApiConnections": {}
}

以下是 host.json:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
    "version": "[1.*, 2.0.0)"
  },
  "extensions": {
    "workflow": {
       "settings": {
          "Runtime.Backend.VariableOperation.MaximumStatelessVariableSize": "5000000"
       }
    }
 }
}

该图像在 docker 桌面中成功运行,但当部署到 AKS 时,我们得到“功能主机未运行”。

请帮助解决这个问题。

【问题讨论】:

    标签: kubernetes azure-logic-apps


    【解决方案1】:

    您还需要指定 WEBSITE_HOSTNAME (不管它是什么,只需要指定)

    话虽这么说,截至今天还有另一个问题导致函数主机无法启动 (lib advapi32.dll)。

    【讨论】:

      猜你喜欢
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      • 2017-11-06
      • 1970-01-01
      • 2020-08-15
      • 2019-06-09
      • 2018-03-09
      • 1970-01-01
      相关资源
      最近更新 更多