jenkinsci / kubernetes-cd-plugin

A Jenkins plugin to deploy to Kubernetes cluster
MIT License
140 stars 72 forks source link

Deploy config Map with spring multiple profile format issue #76

Open huyang opened 5 years ago

huyang commented 5 years ago

When deploy following configmap, only the first part got applied, the content after --- (which is the dev profile) got omitted.

---
kind: ConfigMap
apiVersion: v1
metadata:
  name: customer-service
  namespace: dev
data:
  kubernetes.yml: |-
    spring:
      autoconfigure:
        exclude: org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration
      redis:
        cluster:
          nodes: redis-cluster.default:6379
      cloud:
        kubernetes:
          reload:
            enabled: true
    # Common Library Settings
    common:
      metrics:
        enabled: true
      security:
        twowaytls:
          enabled: false
    management:
      endpoint:
        restart:
          enabled: true
    # Hystrix, Eureka, Ribbon and service URLs
    feign:
      hystrix:
        enabled: false
    ---
    spring:
      profiles: dev
      sleuth:
        enabled: false
        sampler:
          probability: 1.0
      zipkin:
        enabled: false
        baseUrl: http://test:9411/
      jpa:
        hibernate:
          ddl-auto: create
        properties:
          hibernate:
            show_sql: true
            format_sql: true
        database-platform: org.hibernate.dialect.DB2Dialect
huyang commented 5 years ago

The same yaml file works with kubectl command line