K8S YAMLファイルにENV、秘密またはconfigmapとしてブール変数を渡します

受信:

私たちは、AKS上で実行するために私たちのJava春ブートアプリケーションのデプロイメントYAMLファイルの作成に取り組んでいます。

私は、次のapplication.propertiesを渡すことができENV、秘密やconfigmapとしてブール変数を追加する方法が必要です

azure.activedirectory.session-stateless=true

そのような私のポッド内の環境変数に

apiVersion: apps/v1
kind: Deployment
metadata:
  name: service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: svc-deployment
  template:
    spec:
      containers:
      - name: image
        image: acr/image:tag
        env:
        - name: azure.activedirectory.session-stateless
          value: true

「トゥーレ」 - - またはなしで、私はYAMLはそれが引用符のいずれかのブール値を解析することができないようだという読みください。任意の回避策はありますか?

whymatter:

application.propertiesで構成することができSPRING_APPLICATION_JSONたenv変数

apiVersion: apps/v1
kind: Deployment
metadata:
  name: service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: svc-deployment
  template:
    spec:
      containers:
      - name: image
        image: acr/image:tag
        env:
        - name: SPRING_APPLICATION_JSON
          value: '{"azure": {"activedirectory": {"session-stateless": true}}}'

参照:https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=280375&siteId=1