snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Kubernetes extension does not generate init containers properly #192

Closed iocanel closed 4 years ago

iocanel commented 4 years ago

Describe the bug When io.quarkus:quarkus-smallrye-health dependency is in the classpath and an init container added to the application.properties file, it generates liveness and readiness probes for the init container which is wrong as per https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#differences-from-regular-containers and generated kubernetes.[yml|json] cannot be applied.

Expected behavior There shouldn't be any probes defined for the init container

...
      initContainers:
      - command:
        - sh
        - -c
        - echo The init container is running! && sleep 3600'
        image: busybox:1.28
        imagePullPolicy: IfNotPresent
        name: migrate-db
      serviceAccount: code-with-quarkus
...

Actual behavior Readiness and liveness probes are defined for the init container

...
      initContainers:
      - command:
        - sh
        - -c
        - echo The init container is running! && sleep 3600'
        image: busybox:1.28
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: ""
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 0
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 10
        name: migrate-db
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: ""
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 0
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 10
      serviceAccount: code-with-quarkus
...

To Reproduce

reproducer.zip

Steps to reproduce the behavior:

  1. Extract the reproducer
  2. ./gradlew clean build
  3. Inspect the build/kubernetes/kubernetes.[yml|json]

Configuration

# Add your application.properties here, if applicable.
quarkus.kubernetes.init-containers.migrate-db.image=busybox:1.28
quarkus.kubernetes.init-containers.migrate-db.command=sh,-c,echo The init container is running! && sleep 3600'

Screenshots (If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Additional context

This issue does not appear on 1.8.3.Final version


https://github.com/quarkusio/quarkus/issues/12824


$upstream:12824$