The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Kubernetes エクステンション

Quarkusは、 dekorate を使用して、妥当なデフォルトとユーザーが提供する設定に基づいて Kubernetes リソースを自動的に生成する機能を提供しています。現在、バニラ KubernetesOpenShift、および Knative のリソースの生成をサポートしています。さらに、Quarkusは、生成されたマニフェストをターゲットクラスターの API Server に適用することで、ターゲット Kubernetes クラスターにアプリケーションをデプロイすることができます。最後に、コンテナーイメージエクステンションのいずれかが存在する場合 (詳細は container image guide を参照)、Quarkus では、ターゲットプラットフォームにアプリケーションをデプロイする に、コンテナーイメージを作成してレジストリーにプッシュする機能があります。

前提条件

このガイドを完成させるには、以下が必要です:

  • 約15分

  • IDE

  • JDK 11+ がインストールされ、 JAVA_HOME が適切に設定されていること

  • Apache Maven 3.8.1+

  • 使用したい場合、 Quarkus CLI

  • Kubernetesクラスターへのアクセス(Minikubeは有効な選択肢です)

Kubernetes

Kubernetes エクステンションとJib エクステンションの両方を含む新しいプロジェクトを作成してみましょう。

CLI
quarkus create app org.acme:kubernetes-quickstart \
    --extension=resteasy-reactive,kubernetes,jib
cd kubernetes-quickstart

Gradleプロジェクトを作成するには、 --gradle または --gradle-kotlin-dsl オプションを追加します。

Quarkus CLIのインストール方法については、Quarkus CLIガイドをご参照ください。

Maven
mvn io.quarkus.platform:quarkus-maven-plugin:2.11.1.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=kubernetes-quickstart \
    -Dextensions="resteasy-reactive,kubernetes,jib"
cd kubernetes-quickstart

Gradleプロジェクトを作成するには、 -DbuildTool=gradle または -DbuildTool=gradle-kotlin-dsl オプションを追加します。

これにより、ビルドファイルに以下の依存関係が追加されました。

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-kubernetes</artifactId>
</dependency>
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-container-image-jib</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-resteasy-reactive")
implementation("io.quarkus:quarkus-kubernetes")
implementation("io.quarkus:quarkus-container-image-jib")

これらの依存関係を追加することで、ビルドを実行するたびに Kubernetes マニフェストの生成を可能にし、同時に Jib を使ったコンテナーイメージのビルドを可能にします。たとえば、以下を実行した後、

CLI
quarkus build
Maven
./mvnw clean package
Gradle
./gradlew build

作成された他のファイルの中に kubernetes.jsonkubernetes.yml という名前の 2 つのファイルが target/kubernetes/ ディレクトリーにあることに気づくでしょう。

どちらのファイルを見ても、Kubernetes DeploymentService 両方が含まれていることに気づくでしょう。

kubernetes.json ファイルの完全なソースは以下の通りです:

{
  {
    "apiVersion" : "apps/v1",
    "kind" : "Deployment",
    "metadata" : {
      "annotations": {
       "app.quarkus.io/vcs-url" : "<some url>",
       "app.quarkus.io/commit-id" : "<some git SHA>",
      },
      "labels" : {
        "app.kubernetes.io/name" : "test-quarkus-app",
        "app.kubernetes.io/version" : "1.0.0-SNAPSHOT",
      },
      "name" : "test-quarkus-app"
    },
    "spec" : {
      "replicas" : 1,
      "selector" : {
        "matchLabels" : {
          "app.kubernetes.io/name" : "test-quarkus-app",
          "app.kubernetes.io/version" : "1.0.0-SNAPSHOT",
        }
      },
      "template" : {
        "metadata" : {
          "labels" : {
            "app.kubernetes.io/name" : "test-quarkus-app",
            "app.kubernetes.io/version" : "1.0.0-SNAPSHOT"
          }
        },
        "spec" : {
          "containers" : [ {
            "env" : [ {
              "name" : "KUBERNETES_NAMESPACE",
              "valueFrom" : {
                "fieldRef" : {
                  "fieldPath" : "metadata.namespace"
                }
              }
            } ],
            "image" : "yourDockerUsername/test-quarkus-app:1.0.0-SNAPSHOT",
            "imagePullPolicy" : "Always",
            "name" : "test-quarkus-app"
          } ]
        }
      }
    }
  },
  {
  "apiVersion" : "v1",
  "kind" : "Service",
    "metadata" : {
      "annotations": {
       "app.quarkus.io/vcs-url" : "<some url>",
       "app.quarkus.io/commit-id" : "<some git SHA>",
      },
      "labels" : {
        "app.kubernetes.io/name" : "test-quarkus-app",
        "app.kubernetes.io/version" : "1.0.0-SNAPSHOT",
      },
      "name" : "test-quarkus-app"
    },
  "spec" : {
    "ports" : [ {
      "name" : "http",
      "port" : 8080,
      "targetPort" : 8080
    } ],
    "selector" : {
      "app.kubernetes.io/name" : "test-quarkus-app",
      "app.kubernetes.io/version" : "1.0.0-SNAPSHOT"
    },
    "type" : "ClusterIP"
  }
 }
}

Deployment リソースを生成する以外に、application.properties を介して StatefulSet を取得することを選択することも可能です。

quarkus.kubernetes.deployment-kind=StatefulSet

生成されたマニフェストは、 kubectl を使用してプロジェクトのルートからクラスターに適用することができます。

kubectl apply -f target/kubernetes/kubernetes.json

Deployment (または StatefulSet) について注意すべき重要なことは、Pod のコンテナーイメージとして yourDockerUsername/test-quarkus-app:1.0.0-SNAPSHOT を使用していることです。イメージの名前は Jib エクステンションによって制御され、通常の application.properties を利用してカスタマイズすることができます。

例えば、次のような設定の場合:

quarkus.container-image.group=quarkus #optional, default to the system username
quarkus.container-image.name=demo-app #optional, defaults to the application name
quarkus.container-image.tag=1.0       #optional, defaults to the application version

生成されたマニフェストで使用されるイメージは quarkus/demo-app:1.0 となります

名前空間

By default, Quarkus omits the namespace in the generated manifests, rather than enforce the default namespace. That means that you can apply the manifest to your chosen namespace when using kubectl, which in the example below is test:

kubectl apply -f target/kubernetes/kubernetes.json -n=test

マニフェストで名前空間を指定するには、 application.properties の中で次のプロパティによってカスタマイズします。

quarkus.kubernetes.namespace=mynamespace

Docker レジストリーの定義

Docker レジストリーは、以下のプロパティーで指定できます。

quarkus.container-image.registry=my.docker-registry.net

前のセクションで説明したコンテナーイメージプロパティーと一緒にこのプロパティーを追加すると、生成されるマニフェストではイメージ my.docker-registry.net/quarkus/demo-app:1.0 を使用するようになります。次のセクションで明らかになるように、生成されるマニフェストでカスタマイズできるのはイメージだけではありません。

ラベルとアノテーション

ラベル

生成されたマニフェストには、Kubernetes 推奨のラベルが使用されます。これらのラベルは、 quarkus.kubernetes.name, quarkus.kubernetes.version および quarkus.kubernetes.part-of を使用してカスタマイズすることができます。例えば、 application.properties に以下の設定を追加してください:

quarkus.kubernetes.part-of=todo-app
quarkus.kubernetes.name=todo-rest
quarkus.kubernetes.version=1.0-rc.1

OpenShift のセクションで詳しく説明しているように、OpenShift (または Knative) のプロパティーのカスタマイズは同じ方法で行いますが、kubernetesopenshift (または knative) に置き換えます。先ほどの OpenShift の例では、以下のようになります。

quarkus.openshift.part-of=todo-app
quarkus.openshift.name=todo-rest
quarkus.openshift.version=1.0-rc.1

生成されたリソースのラベルは次のようになります:

  "labels" : {
    "app.kubernetes.io/part-of" : "todo-app",
    "app.kubernetes.io/name" : "todo-rest",
    "app.kubernetes.io/version" : "1.0-rc.1"
  }

以下の設定を適用することで、app.kubernetes.io/version のラベルを削除することもできます。

quarkus.kubernetes.add-version-to-label-selectors=false

Custom Labels

追加のカスタムラベルを追加するには、例えば foo=bar を設定する場合、以下の設定を適用するだけです。

quarkus.kubernetes.labels.foo=bar
quarkus-container-image-jib エクステンションモジュールを使用してコンテナーイメージを作成する場合、前述のプロパティーを介して追加されたラベルも生成されたコンテナーイメージに追加されます。

アノテーション

生成されたリソースにはバージョン管理に関連する情報がアノテーションされ、ツールによって、またはユーザーがトラブルシューティングの目的で使用することができます。

  "annotations": {
    "app.quarkus.io/vcs-url" : "<some url>",
    "app.quarkus.io/commit-id" : "<some git SHA>",
   }

カスタムアノテーション

例えば、注釈 foo=barapp.quarkus/id=42 を追加するには、次の設定を適用するだけです。

quarkus.kubernetes.annotations.foo=bar
quarkus.kubernetes.annotations."app.quarkus/id"=42

環境変数

Kubernetesでは、環境変数を定義する方法が複数用意されています。

  • キー/バリューペア

  • Secret または ConfigMap からすべての値をインポートする

  • Secret または ConfigMap の指定されたフィールドで識別される単一の値を補間する

  • 同じリソース内のフィールドから値を補間する

キー/値のペアからの環境変数

生成されたリソースに環境変数としてキーとバリューのペアを追加する場合:

quarkus.kubernetes.env.vars.my-env-var=foobar

上のコマンドは MY_ENV_VAR=foobar を環境変数として追加します。キー my-env-var は大文字に変換され、ダッシュはアンダースコアに置き換えられて MY_ENV_VAR となることに注意してください。

シークレットからの環境変数

Secret のすべてのキーと値のペアを環境変数として追加するには、以下の設定を適用し、ソースとして使用する各 Secret をカンマ ( , ) で区切ってください。

quarkus.kubernetes.env.secrets=my-secret,my-other-secret

これにより、コンテナーの定義に以下のようなものが生成されます。

envFrom:
  - secretRef:
      name: my-secret
      optional: false
  - secretRef:
      name: my-other-secret
      optional: false

以下は、 my-secret Secret から keyName フィールドで識別される値を foo 環境変数に抽出します。

quarkus.kubernetes.env.mapping.foo.from-secret=my-secret
quarkus.kubernetes.env.mapping.foo.with-key=keyName

これにより、コンテナーの env セクションに以下のようなものが生成されます。

- env:
  - name: FOO
    valueFrom:
      secretKeyRef:
        key: keyName
        name: my-secret
        optional: false
ConfigMap からの環境変数

ConfigMap からのすべてのキーと値のペアを環境変数として追加するには、以下の設定を適用し、ソースとして使用する各 ConfigMap をカンマ ( , ) で区切ってください。

quarkus.kubernetes.env.configmaps=my-config-map,another-config-map

これにより、コンテナーの定義に以下のようなものが生成されます。

envFrom:
  - configMapRef:
      name: my-config-map
      optional: false
  - configMapRef:
      name: another-config-map
      optional: false

以下は、 my-config-map ConfigMap から keyName フィールドで識別される値を foo 環境変数に抽出したものです。

quarkus.kubernetes.env.mapping.foo.from-configmap=my-configmap
quarkus.kubernetes.env.mapping.foo.with-key=keyName

これにより、コンテナーの env セクションに以下のようなものが生成されます。

- env:
  - name: FOO
    valueFrom:
      configMapRefKey:
        key: keyName
        name: my-configmap
        optional: false
フィールドからの環境変数

また、以下のように、ソースとして使用するフィールドのパスを指定することで、別のフィールドの値を使用して新しい環境変数を追加することも可能です。

quarkus.kubernetes.env.fields.foo=metadata.name

OpenShift のセクションで詳しく説明しているように、OpenShift プロパティーのカスタマイズは同じ方法で行いますが、kubernetesopenshift に置き換えます。先ほどの OpenShift の例では、以下のようになります。

quarkus.openshift.env.fields.foo=metadata.name
バリデーション

例えば、誤って両方の値を代入したり、変数がフィールドから派生したものであることを指定したりするなど、2つの定義の間で競合が発生すると、ビルド時にエラーが発生します。そのため、問題の原因を診断するのが困難なクラスターにアプリケーションをデプロイする前に問題を修正する機会を得ることができます。

同様に、同じシークレットからのインジェクションを2回定義するなど、2つの冗長な定義があっても問題は発生しませんが、その定義を複製することを意図していなかった可能性があることを知らせる警告が実際に報告されます。

下位互換性

Previous versions of the Kubernetes extension supported a different syntax to add environment variables. The older syntax is still supported but is deprecated, and it’s advised that you migrate to the new syntax.

Table 1. 古い構文と新しい構文

素の変数

quarkus.kubernetes.env-vars.my-env-var.value=foobar

quarkus.kubernetes.env.vars.my-env-var=foobar

フィールドから

quarkus.kubernetes.env-vars.my-env-var.field=foobar

quarkus.kubernetes.env.fields.my-env-var=foobar

すべての ConfigMap から

quarkus.kubernetes.env-vars.xxx.configmap=foobar

quarkus.kubernetes.env.configmaps=foobar

すべての Secret から

quarkus.kubernetes.env-vars.xxx.secret=foobar

quarkus.kubernetes.env.secrets=foobar

ある Secret フィールドから

quarkus.kubernetes.env-vars.foo.secret=foobar

quarkus.kubernetes.env.mapping.foo.from-secret=foobar

quarkus.kubernetes.env-vars.foo.value=field

quarkus.kubernetes.env.mapping.foo.with-key=field

ある ConfigMap フィールドから

quarkus.kubernetes.env-vars.foo.configmap=foobar

quarkus.kubernetes.env.mapping.foo.from-configmap=foobar

quarkus.kubernetes.env-vars.foo.value=field

quarkus.kubernetes.env.mapping.foo.with-key=field

古い文法を残した状態で新しい文法を使って同じ変数を再定義した場合、 新しいバージョン のみ が保持され、問題を通知するために警告が発せられます。例えば、quarkus.kubernetes.env-vars.my-env-var.value=foobarquarkus.kubernetes.env.vars.my-env-var=newValue の両方を定義した場合、エクステンションは環境変数 MY_ENV_VAR=newValue のみを生成して警告を発します。

ボリュームのマウント

Kubernetes エクステンションを使用すると、アプリケーションのボリュームとマウントの両方を設定することができます。 簡単な設定で任意のボリュームをマウントすることができます。

quarkus.kubernetes.mounts.my-volume.path=/where/to/mount

これにより、Pod のパス /where/to/mount にボリューム my-volume のマウントを追加します。 ボリューム自体は、以下のセクションに示すように設定することができます。

シークレットのボリューム
quarkus.kubernetes.secret-volumes.my-volume.secret-name=my-secret
ConfigMap ボリューム
quarkus.kubernetes.config-map-volumes.my-volume.config-map-name=my-secret

アプリケーション設定の受け渡し

Quarkus supports passing configuration from external locations (via Smallrye Config). This usually requires setting an additional environment variable or system property. When you need to use a secret or a config map for the purpose of application configuration, you need to:

  • ボリュームを定義する

  • ボリュームをマウントする

  • SMALLRYE_CONFIG_LOCATIONS の環境変数を作成する

物事を単純化するために、Quarkus はシングルステップの代替手段を提供しています。

quarkus.kubernetes.app-secret=<name of the secret containing the configuration>

または

quarkus.kubernetes.app-config-map=<name of the config map containing the configuration>

これらのプロパティを使用すると、生成されたマニフェストには必要なものがすべて含まれます。 アプリケーションのコンフィグボリュームは、Secret と ConfigMap にそれぞれパスを使用して作成されます。Secret と ConfigMap はそれぞれ /mnt/app-secret/mnt/app-config-map を使用して作成されます。

注:ユーザーは両方のプロパティを同時に使用することができます。

レプリカ数を変更する

レプリカ数を1から3に変更するためには次のようにします。

quarkus.kubernetes.replicas=3

rediness および liveness プローブを追加する

デフォルトでは、Kubernetesリソースは、生成された Deployment の中に readiness と liveness のプローブを含みません。しかし、これらを追加するには、以下のように SmallRye Health エクステンションを追加するだけです。

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-smallrye-health</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-smallrye-health")

生成されたプローブの値は、設定されたヘルスプロパティー (quarkus.smallrye-health.root-pathquarkus.smallrye-health.liveness-path、および quarkus.smallrye-health.readiness-path) によって決定されます。health エクステンションの詳細については、関連する guide を参照してください。

rediness プローブのカスタマイズ

プローブの初期遅延を 20 秒、周期を 45 秒に設定します。

quarkus.kubernetes.readiness-probe.initial-delay=20s
quarkus.kubernetes.readiness-probe.period=45s

hostAliases の追加

Podの /etc/hosts ファイルにエントリを追加するには(詳細は Kubernetes documentation )、以下の設定を適用するだけです。

quarkus.kubernetes.hostaliases."10.0.0.0".hostnames=foo.com,bar.org

これにより、 deployment 定義の中に以下の hostAliases セクションが生成されます。

kind: Deployment
spec:
  template:
    spec:
      hostAliases:
      - hostnames:
        - foo.com
        - bar.org
        ip: 10.0.0.0

コンテナリソース管理

CPUやメモリの制限やリクエストは、以下の設定で Container (詳細は Kubernetes documentation を参照) に適用することができます。

quarkus.kubernetes.resources.requests.memory=64Mi
quarkus.kubernetes.resources.requests.cpu=250m
quarkus.kubernetes.resources.limits.memory=512Mi
quarkus.kubernetes.resources.limits.cpu=1000m

これにより、 container セクションに以下のエントリが生成されます。

containers:
  resources:
    limits:
      cpu: 1000m
      memory: 512Mi
    requests:
      cpu: 250m
      memory: 64Mi

Kubernetes クライアントの使用

Kubernetesにデプロイされ、APIサーバにアクセスする必要があるアプリケーションは、通常 kubernetes-client エクステンションを利用します。

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-kubernetes-client</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-kubernetes-client")

To access the API server from within a Kubernetes cluster, some RBAC related resources are required (e.g. a ServiceAccount, a RoleBinding). So, when the kubernetes-client extension is present, the kubernetes extension is going to create those resources automatically, so that application will be granted the view role. If more roles are required, they will have to be added manually.

You can disable the RBAC resources generation using the property quarkus.kubernetes-client.generate-rbac=false.

Minikube へのデプロイ

Minikube は、開発目的でKubernetesクラスタが必要な場合に非常に人気があります。Minikubeへのデプロイをできるだけ摩擦のないものにするために、Quarkusは quarkus-minikube エクステンションを提供しています。このエクステンションは、以下のようなプロジェクトに追加することができます。

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-minikube</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-minikube")

The purpose of this extension is to generate Kubernetes manifests (minikube.yaml and minikube.json) that are tailored to Minikube. This extension assumes a couple of things:

  • ユーザーはイメージレジストリを使用せず、コンテナイメージをMinikubeのDockerデーモンに直接ビルドしてKubernetesクラスタにアクセスできるようにします。MinikubeのDockerデーモンを使用するには、まず実行する必要があります。

    eval $(minikube -p minikube docker-env)
  • Kubernetesにデプロイされたアプリケーションは、Kubernetesの Ingress ではなく、NodePort Service としてアクセスされます。 この方法の利点は、アプリケーションのURLを実行することで、アプリケーションのURLを簡単に取得できることです。

    minikube service list

この場合に使用される nodePort を制御するために、ユーザーは quarkus.kubernetes.node-port を設定することができます。 しかし、何も設定されていない場合、Quarkusは自動的に適切な(変更されない)値を使用するため、この設定は完全に任意であることに注意してください。

本番環境へのデプロイ時に Minikube エクステンションで生成されたマニフェストを使用することはまったくお勧めできません。本番環境にデプロイする場合は、バニラ Kubernetes マニフェスト (または OpenShift をターゲットにしている場合は OpenShift マニフェスト) の使用を検討してください。
Minikube エクステンションが想定している前提がワークフローに合わない場合、通常の Kubernetes エクステンションを使用して Kubernetes マニフェストを生成し、それを Minikube クラスタに適用することを妨げるものは何もありません。

Kind へのデプロイメント

Kind is another popular tool used as a Kubernetes cluster for development purposes. To make the deployment to Kind experience as frictionless as possible, Quarkus provides the quarkus-kind extension. This extension can be added to a project like so:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-kind</artifactId>
</dependency>

このエクステンションの目的は、Kind に合わせた Kubernetes マニフェスト (kind.yamlkind.json) を生成することと、コンテナーイメージのビルドを行う際にクラスターにイメージをロードする処理を自動化することにあります。テーラーメードのマニフェストは、Minikube (上記を参照) と非常によく似ています (同じルールを共有)。

application.properties を使用して生成されたリソースをチューニングする

Kubernetes のエクステンションでは、application.properties ファイルを使用して生成されたマニフェストをチューニングすることができます。 ここではいくつかの例を紹介します。

設定オプション

以下の表は、利用可能なすべての設定オプションについて説明しています。

Kubernetes

ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能

Configuration property

タイプ

デフォルト

The name of the group this component belongs too

Environment variable: QUARKUS_KUBERNETES_PART_OF

string

The name of the application. This value will be used for naming Kubernetes resources like: - Deployment - Service and so on …​

Environment variable: QUARKUS_KUBERNETES_NAME

string

${quarkus.container-image.name}

The version of the application.

Environment variable: QUARKUS_KUBERNETES_VERSION

string

${quarkus.container-image.tag}

The kind of the deployment resource to use. Supported values are 'Deployment' and 'StatefulSet' defaulting to the first.

Environment variable: QUARKUS_KUBERNETES_DEPLOYMENT_KIND

deployment, stateful-set

deployment

The namespace the generated resources should belong to. If not value is set, then the 'namespace' field will not be added to the 'metadata' section of the generated manifests. This in turn means that when the manifests are applied to a cluster, the namespace will be resolved from the current Kubernetes context (see https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context for more details).

Environment variable: QUARKUS_KUBERNETES_NAMESPACE

string

Whether to add the build timestamp to the Kubernetes annotations This is a very useful way to have manifests of successive builds of the same application differ - thus ensuring that Kubernetes will apply the updated resources

Environment variable: QUARKUS_KUBERNETES_ADD_BUILD_TIMESTAMP

boolean

true

Working directory

Environment variable: QUARKUS_KUBERNETES_WORKING_DIR

string

The commands

Environment variable: QUARKUS_KUBERNETES_COMMAND

list of string

The arguments

Environment variable: QUARKUS_KUBERNETES_ARGUMENTS

list of string

The service account

Environment variable: QUARKUS_KUBERNETES_SERVICE_ACCOUNT

string

The host under which the application is going to be exposed

Environment variable: QUARKUS_KUBERNETES_HOST

string

The number of desired pods

Environment variable: QUARKUS_KUBERNETES_REPLICAS

int

1

The type of service that will be generated for the application

Environment variable: QUARKUS_KUBERNETES_SERVICE_TYPE

cluster-ip, node-port, load-balancer, external-name

cluster-ip

The nodePort to set when serviceType is set to node-port.

Environment variable: QUARKUS_KUBERNETES_NODE_PORT

int

Image pull policy

Environment variable: QUARKUS_KUBERNETES_IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_KUBERNETES_IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KUBERNETES_LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KUBERNETES_READINESS_PROBE_FAILURE_THRESHOLD

int

3

When true (the default), emit a set of annotations to identify services that should be scraped by prometheus for metrics. In configurations that use the Prometheus operator with ServiceMonitor, annotations may not be necessary.

Environment variable: QUARKUS_KUBERNETES_PROMETHEUS_ANNOTATIONS

boolean

true

Define the annotation prefix used for scrape values, this value will be used as the base for other annotation name defaults. Altering the base for generated annotations can make it easier to define re-labeling rules and avoid unexpected knock-on effects. The default value is prometheus.io See Prometheus example: https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus-kubernetes.yml

Environment variable: QUARKUS_KUBERNETES_PROMETHEUS_PREFIX

string

prometheus.io

Define the annotation used to indicate services that should be scraped. By default, /scrape will be appended to the defined prefix.

Environment variable: QUARKUS_KUBERNETES_PROMETHEUS_SCRAPE

string

Define the annotation used to indicate the path to scrape. By default, /path will be appended to the defined prefix.

Environment variable: QUARKUS_KUBERNETES_PROMETHEUS_PATH

string

Define the annotation used to indicate the port to scrape. By default, /port will be appended to the defined prefix.

Environment variable: QUARKUS_KUBERNETES_PROMETHEUS_PORT

string

Define the annotation used to indicate the scheme to use for scraping By default, /scheme will be appended to the defined prefix.

Environment variable: QUARKUS_KUBERNETES_PROMETHEUS_SCHEME

string

The target deployment platform. Defaults to kubernetes. Can be kubernetes, openshift, knative, minikube etc., or any combination of the above as comma separated list.

Environment variable: QUARKUS_KUBERNETES_DEPLOYMENT_TARGET

list of string

CPU Requirements

Environment variable: QUARKUS_KUBERNETES_RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KUBERNETES_RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_KUBERNETES_RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KUBERNETES_RESOURCES_REQUESTS_MEMORY

string

If true, a Kubernetes Ingress will be created

Environment variable: QUARKUS_KUBERNETES_EXPOSE

boolean

false

If true, the service will be exposed

Environment variable: QUARKUS_KUBERNETES_INGRESS_EXPOSE

boolean

false

The host under which the application is going to be exposed

Environment variable: QUARKUS_KUBERNETES_INGRESS_HOST

string

If true, the 'app.kubernetes.io/version' label will be part of the selectors of Service and Deployment

Environment variable: QUARKUS_KUBERNETES_ADD_VERSION_TO_LABEL_SELECTORS

boolean

true

If set to true, Quarkus will attempt to deploy the application to the target Kubernetes cluster

Environment variable: QUARKUS_KUBERNETES_DEPLOY

boolean

false

If set, the secret will mounted to the application container and its contents will be used for application configuration.

Environment variable: QUARKUS_KUBERNETES_APP_SECRET

string

If set, the config map will be mounted to the application container and its contents will be used for application configuration.

Environment variable: QUARKUS_KUBERNETES_APP_CONFIG_MAP

string

The SELinux level label that applies to the container.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_SE_LINUX_OPTIONS_LEVEL

string

The SELinux role label that applies to the container.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_SE_LINUX_OPTIONS_ROLE

string

The SELinux type label that applies to the container.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_SE_LINUX_OPTIONS_TYPE

string

The SELinux user label that applies to the container.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_SE_LINUX_OPTIONS_USER

string

The name of the GMSA credential spec to use.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_WINDOWS_OPTIONS_GMSA_CREDENTIAL_SPEC_NAME

string

GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_WINDOWS_OPTIONS_GMSA_CREDENTIAL_SPEC

string

The UserName in Windows to run the entrypoint of the container process.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_WINDOWS_OPTIONS_RUN_AS_USER_NAME

string

HostProcess determines if a container should be run as a 'Host Process' container.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_WINDOWS_OPTIONS_HOST_PROCESS

boolean

The UID to run the entrypoint of the container process.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_RUN_AS_USER

long

The GID to run the entrypoint of the container process.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_RUN_AS_GROUP

long

Indicates that the container must run as a non-root user.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_RUN_AS_NON_ROOT

boolean

A list of groups applied to the first process run in each container, in addition to the container’s primary GID. If unspecified, no groups will be added to any container.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_SUPPLEMENTAL_GROUPS

list of long

A special supplemental group that applies to all containers in a pod.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_FS_GROUP

long

Sysctls hold a list of namespaced sysctls used for the pod.

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_SYSCTLS

string

It holds policies that will be used for applying fsGroup to a volume when volume is mounted. Values: OnRootMismatch, Always

Environment variable: QUARKUS_KUBERNETES_SECURITY_CONTEXT_FS_GROUP_CHANGE_POLICY

on-root-mismatchIt indicates that volume’s ownership and permissions will be changed only when permission and ownership of root directory does not match with expected permissions on the volume., alwaysIt indicates that volume’s ownership and permissions should always be changed whenever volume is mounted inside a Pod. This the default behavior.

If set, it will change the name of the container according to the configuration

Environment variable: QUARKUS_KUBERNETES_CONTAINER_NAME

string

If true, the debug mode in pods will be enabled.

Environment variable: QUARKUS_KUBERNETES_REMOTE_DEBUG_ENABLED

boolean

false

The transport to use.

Environment variable: QUARKUS_KUBERNETES_REMOTE_DEBUG_TRANSPORT

string

dt_socket

If enabled, it means the JVM will wait for the debugger to attach before executing the main class. If false, the JVM will immediately execute the main class, while listening for the debugger connection.

Environment variable: QUARKUS_KUBERNETES_REMOTE_DEBUG_SUSPEND

string

n

It specifies the address at which the debug socket will listen.

Environment variable: QUARKUS_KUBERNETES_REMOTE_DEBUG_ADDRESS_PORT

int

5005

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_KUBERNETES_ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_KUBERNETES_ENV_CONFIGMAPS

list of string

Custom labels to add to all resources

Environment variable: QUARKUS_KUBERNETES_LABELS

Map<String,String>

Custom annotations to add to all resources

Environment variable: QUARKUS_KUBERNETES_ANNOTATIONS

Map<String,String>

The port number. Refers to the container port.

Environment variable: QUARKUS_KUBERNETES_PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_KUBERNETES_PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_KUBERNETES_PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_KUBERNETES_PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_KUBERNETES_PORTS__PORTS__NODE_PORT

int

The name of the volumeName to mount.

Environment variable: QUARKUS_KUBERNETES_MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_KUBERNETES_MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_KUBERNETES_MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_KUBERNETES_MOUNTS__MOUNTS__READ_ONLY

boolean

false

The name of the secret to mount.

Environment variable: QUARKUS_KUBERNETES_SECRET_VOLUMES__SECRET_VOLUMES__SECRET_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_KUBERNETES_SECRET_VOLUMES__SECRET_VOLUMES__DEFAULT_MODE

string

0600

The path where the file will be mounted.

Environment variable: QUARKUS_KUBERNETES_SECRET_VOLUMES__SECRET_VOLUMES__ITEMS__ITEMS__PATH

string

required

It must be a value between 0000 and 0777. If not specified, the volume defaultMode will be used.

Environment variable: QUARKUS_KUBERNETES_SECRET_VOLUMES__SECRET_VOLUMES__ITEMS__ITEMS__MODE

int

-1

Optional

Environment variable: QUARKUS_KUBERNETES_SECRET_VOLUMES__SECRET_VOLUMES__OPTIONAL

boolean

false

The name of the ConfigMap to mount.

Environment variable: QUARKUS_KUBERNETES_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__CONFIG_MAP_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_KUBERNETES_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__DEFAULT_MODE

string

0600

The path where the file will be mounted.

Environment variable: QUARKUS_KUBERNETES_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__ITEMS__ITEMS__PATH

string

required

It must be a value between 0000 and 0777. If not specified, the volume defaultMode will be used.

Environment variable: QUARKUS_KUBERNETES_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__ITEMS__ITEMS__MODE

int

-1

Optional

Environment variable: QUARKUS_KUBERNETES_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__OPTIONAL

boolean

false

Git repository URL.

Environment variable: QUARKUS_KUBERNETES_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__REPOSITORY

string

required

The directory of the repository to mount.

Environment variable: QUARKUS_KUBERNETES_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__DIRECTORY

string

The commit hash to use.

Environment variable: QUARKUS_KUBERNETES_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__REVISION

string

The name of the claim to mount.

Environment variable: QUARKUS_KUBERNETES_PVC_VOLUMES__PVC_VOLUMES__CLAIM_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_KUBERNETES_PVC_VOLUMES__PVC_VOLUMES__DEFAULT_MODE

string

0600

Optional

Environment variable: QUARKUS_KUBERNETES_PVC_VOLUMES__PVC_VOLUMES__OPTIONAL

boolean

false

The name of the disk to mount.

Environment variable: QUARKUS_KUBERNETES_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__VOLUME_ID

string

required

The partition.

Environment variable: QUARKUS_KUBERNETES_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__PARTITION

int

Filesystem type.

Environment variable: QUARKUS_KUBERNETES_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__FS_TYPE

string

ext4

Whether the volumeName is read only or not.

Environment variable: QUARKUS_KUBERNETES_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__READ_ONLY

boolean

false

The share name.

Environment variable: QUARKUS_KUBERNETES_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__SHARE_NAME

string

required

The secret name.

Environment variable: QUARKUS_KUBERNETES_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__SECRET_NAME

string

required

Whether the volumeName is read only or not.

Environment variable: QUARKUS_KUBERNETES_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__READ_ONLY

boolean

false

The name of the disk to mount.

Environment variable: QUARKUS_KUBERNETES_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__DISK_NAME

string

required

The URI of the vhd blob object OR the resourceID of an Azure managed data disk if Kind is Managed

Environment variable: QUARKUS_KUBERNETES_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__DISK_URI

string

required

Kind of disk.

Environment variable: QUARKUS_KUBERNETES_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__KIND

managed, shared

managed

Disk caching mode.

Environment variable: QUARKUS_KUBERNETES_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__CACHING_MODE

read-write, read-only, none

read-write

File system type.

Environment variable: QUARKUS_KUBERNETES_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__FS_TYPE

string

ext4

Whether the volumeName is read only or not.

Environment variable: QUARKUS_KUBERNETES_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__READ_ONLY

boolean

false

The container image.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE

string

Working directory.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__WORKING_DIR

string

The commands

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__COMMAND

list of string

The arguments

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ARGUMENTS

list of string

The service account.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__SERVICE_ACCOUNT

string

The host under which the application is going to be exposed.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__HOST

string

The port number. Refers to the container port.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__NODE_PORT

int

Image pull policy.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_FAILURE_THRESHOLD

int

3

The name of the volumeName to mount.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__READ_ONLY

boolean

false

CPU Requirements

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_CONFIGMAPS

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_KUBERNETES_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__WITH_KEY

string

required

The container image.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__IMAGE

string

Working directory.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__WORKING_DIR

string

The commands

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__COMMAND

list of string

The arguments

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ARGUMENTS

list of string

The service account.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__SERVICE_ACCOUNT

string

The host under which the application is going to be exposed.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__HOST

string

The port number. Refers to the container port.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__PORTS__PORTS__NODE_PORT

int

Image pull policy.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__READINESS_PROBE_FAILURE_THRESHOLD

int

3

The name of the volumeName to mount.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__MOUNTS__MOUNTS__READ_ONLY

boolean

false

CPU Requirements

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_CONFIGMAPS

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_KUBERNETES_SIDECARS__SIDECARS__ENV_MAPPING__MAPPING__WITH_KEY

string

required

The ip address

Environment variable: QUARKUS_KUBERNETES_HOSTALIASES__HOST_ALIASES__IP

string

The hostnames to resolve to the ip

Environment variable: QUARKUS_KUBERNETES_HOSTALIASES__HOST_ALIASES__HOSTNAMES

list of string

Custom annotations to add to exposition (route or ingress) resources

Environment variable: QUARKUS_KUBERNETES_INGRESS_ANNOTATIONS

Map<String,String>

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_KUBERNETES_ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_KUBERNETES_ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_KUBERNETES_ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_KUBERNETES_ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_KUBERNETES_ENV_MAPPING__MAPPING__WITH_KEY

string

required

非標準型を使用するプロパティーは、プロパティーを展開することで参照することができます。例えば、 Probe 型の kubernetes-readiness-probe を定義するには次のようにします。

quarkus.kubernetes.readiness-probe.initial-delay=20s
quarkus.kubernetes.readiness-probe.period=45s

この例では、 initial-delayperiodProbe タイプのフィールドです。以下に、利用可能なすべてのタイプを説明した表を示します。

クライアント接続の設定

Kubernetes クラスターへの接続の設定が必要な場合があります。デフォルトでは、kubectl が使用するアクティブな context が自動的に使用されます。

たとえば、クラスター API のエンドポイントが自己署名入り SSL 証明書を使用している場合、それを信頼するようにクライアントを明示的に設定する必要があります。これを実現するには、以下のプロパティーを定義します。

quarkus.kubernetes-client.trust-certs=true

The full list of the Kubernetes client configuration properties is provided below.

ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能

Configuration property

タイプ

デフォルト

Whether the client should trust a self-signed certificate if so presented by the API server

Environment variable: QUARKUS_KUBERNETES_CLIENT_TRUST_CERTS

boolean

URL of the Kubernetes API server

Environment variable: QUARKUS_KUBERNETES_CLIENT_MASTER_URL

string

Default namespace to use

Environment variable: QUARKUS_KUBERNETES_CLIENT_NAMESPACE

string

CA certificate file

Environment variable: QUARKUS_KUBERNETES_CLIENT_CA_CERT_FILE

string

CA certificate data

Environment variable: QUARKUS_KUBERNETES_CLIENT_CA_CERT_DATA

string

Client certificate file

Environment variable: QUARKUS_KUBERNETES_CLIENT_CLIENT_CERT_FILE

string

Client certificate data

Environment variable: QUARKUS_KUBERNETES_CLIENT_CLIENT_CERT_DATA

string

Client key file

Environment variable: QUARKUS_KUBERNETES_CLIENT_CLIENT_KEY_FILE

string

Client key data

Environment variable: QUARKUS_KUBERNETES_CLIENT_CLIENT_KEY_DATA

string

Client key algorithm

Environment variable: QUARKUS_KUBERNETES_CLIENT_CLIENT_KEY_ALGO

string

Client key passphrase

Environment variable: QUARKUS_KUBERNETES_CLIENT_CLIENT_KEY_PASSPHRASE

string

Kubernetes auth username

Environment variable: QUARKUS_KUBERNETES_CLIENT_USERNAME

string

Kubernetes auth password

Environment variable: QUARKUS_KUBERNETES_CLIENT_PASSWORD

string

Kubernetes oauth token

Environment variable: QUARKUS_KUBERNETES_CLIENT_TOKEN

string

Watch reconnect interval

Environment variable: QUARKUS_KUBERNETES_CLIENT_WATCH_RECONNECT_INTERVAL

Duration

PT1S

Maximum reconnect attempts in case of watch failure By default there is no limit to the number of reconnect attempts

Environment variable: QUARKUS_KUBERNETES_CLIENT_WATCH_RECONNECT_LIMIT

int

-1

Maximum amount of time to wait for a connection with the API server to be established

Environment variable: QUARKUS_KUBERNETES_CLIENT_CONNECTION_TIMEOUT

Duration

PT10S

Maximum amount of time to wait for a request to the API server to be completed

Environment variable: QUARKUS_KUBERNETES_CLIENT_REQUEST_TIMEOUT

Duration

PT10S

Maximum amount of time in milliseconds to wait for a rollout to be completed

Environment variable: QUARKUS_KUBERNETES_CLIENT_ROLLING_TIMEOUT

Duration

PT15M

HTTP proxy used to access the Kubernetes API server

Environment variable: QUARKUS_KUBERNETES_CLIENT_HTTP_PROXY

string

HTTPS proxy used to access the Kubernetes API server

Environment variable: QUARKUS_KUBERNETES_CLIENT_HTTPS_PROXY

string

Proxy username

Environment variable: QUARKUS_KUBERNETES_CLIENT_PROXY_USERNAME

string

Proxy password

Environment variable: QUARKUS_KUBERNETES_CLIENT_PROXY_PASSWORD

string

IP addresses or hosts to exclude from proxying

Environment variable: QUARKUS_KUBERNETES_CLIENT_NO_PROXY

list of string

Enable the generation of the RBAC manifests.

Environment variable: QUARKUS_KUBERNETES_CLIENT_GENERATE_RBAC

boolean

true

OpenShift

アプリケーションを OpenShift にデプロイする方法の1つとして、s2i(source to image)を使用してソースからイメージストリームを作成し、イメージストリームをデプロイする方法があります。

CLI
quarkus extension remove kubernetes,jib
quarkus extension add openshift

oc new-project quarkus-project
quarkus build -Dquarkus.container-image.build=true

oc new-app --name=greeting  quarkus-project/kubernetes-quickstart:1.0.0-SNAPSHOT
oc expose svc/greeting
oc get route
curl <route>/greeting
Maven
./mvnw quarkus:remove-extension -Dextensions="kubernetes, jib"
./mvnw quarkus:add-extension -Dextensions="openshift"

oc new-project quarkus-project
./mvnw clean package -Dquarkus.container-image.build=true

oc new-app --name=greeting  quarkus-project/kubernetes-quickstart:1.0.0-SNAPSHOT
oc expose svc/greeting
oc get route
curl <route>/greeting
Gradle
./gradlew removeExtension --extensions="kubernetes, jib"
./gradlew addExtension --extensions="openshift"

oc new-project quarkus-project
./gradlew build -Dquarkus.container-image.build=true

oc new-app --name=greeting  quarkus-project/kubernetes-quickstart:1.0.0-SNAPSHOT
oc expose svc/greeting
oc get route
curl <route>/greeting

詳細は Deploying to OpenShift を参照してください。

OpenShiftリソースとカスタマイズ可能なプロパティーの説明を以下にKubernetesリソースと一緒に記載し、該当する場合には類似性を示します。これには、上記の oc new-app … の代替、すなわち oc apply -f target/kubernetes/openshift.json を含みます。

OpenShift リソースの生成を有効にするには、ターゲットプラットフォームに OpenShift を含める必要があります。

quarkus.kubernetes.deployment-target=openshift

両方のプラットフォーム(バニラKubernetesとOpenShift)のリソースを生成する必要がある場合は、両方を含める必要があります(カンマ区切り)。

quarkus.kubernetes.deployment-target=kubernetes,openshift

./mvnw package -Dquarkus.container-image.build=true の実行後に、作成された他のファイルの中に openshift.jsonopenshift.yml という名前の 2 つのファイルが target/kubernetes/ ディレクトリーにあることに気づくでしょう。

これらのマニフェストは、 kubectl を使用して、実行中のクラスターにそのままデプロイすることができます。

kubectl apply -f target/kubernetes/openshift.json

OpenShift’s users might want to use oc rather than kubectl:

oc apply -f target/kubernetes/openshift.json
Quarkus は OpenShift エクステンションも提供しています。このエクステンションは、基本的に Kubernetes エクステンションのラッパーであり、これにより、OpenShift ユーザーは deployment-target プロパティーを openshift に設定する必要がなくなります。

Kubernetesと同様のアプローチでOpenShiftのリソースをカスタマイズすることができます。

OpenShift

ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能

Configuration property

タイプ

デフォルト

The OpenShift flavor / version to use. Older versions of OpenShift have minor differences in the labels and fields they support. This option allows users to have their manifests automatically aligned to the OpenShift 'flavor' they use.

Environment variable: QUARKUS_OPENSHIFT_FLAVOR

v3, v4

v4

The kind of the deployment resource to use. Supported values are 'Deployment' and 'DeploymentConfig' defaulting to the latter.

Environment variable: QUARKUS_OPENSHIFT_DEPLOYMENT_KIND

deployment, deployment-config, stateful-set

The name of the group this component belongs too

Environment variable: QUARKUS_OPENSHIFT_PART_OF

string

The name of the application. This value will be used for naming Kubernetes resources like: 'Deployment', 'Service' and so on…​

Environment variable: QUARKUS_OPENSHIFT_NAME

string

${quarkus.container-image.name}

The version of the application.

Environment variable: QUARKUS_OPENSHIFT_VERSION

string

${quarkus.container-image.tag}

The namespace the generated resources should belong to. If not value is set, then the 'namespace' field will not be added to the 'metadata' section of the generated manifests. This in turn means that when the manifests are applied to a cluster, the namespace will be resolved from the current Kubernetes context (see https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context for more details).

Environment variable: QUARKUS_OPENSHIFT_NAMESPACE

string

Add the build timestamp to the Kubernetes annotations This is a very useful way to have manifests of successive builds of the same application differ - thus ensuring that Kubernetes will apply the updated resources

Environment variable: QUARKUS_OPENSHIFT_ADD_BUILD_TIMESTAMP

boolean

true

Working directory

Environment variable: QUARKUS_OPENSHIFT_WORKING_DIR

string

The commands

Environment variable: QUARKUS_OPENSHIFT_COMMAND

list of string

The arguments

Environment variable: QUARKUS_OPENSHIFT_ARGUMENTS

list of string

The service account

Environment variable: QUARKUS_OPENSHIFT_SERVICE_ACCOUNT

string

The host under which the application is going to be exposed

Environment variable: QUARKUS_OPENSHIFT_HOST

string

The number of desired pods

Environment variable: QUARKUS_OPENSHIFT_REPLICAS

int

1

The type of service that will be generated for the application

Environment variable: QUARKUS_OPENSHIFT_SERVICE_TYPE

cluster-ip, node-port, load-balancer, external-name

cluster-ip

The nodePort to set when serviceType is set to nodePort

Environment variable: QUARKUS_OPENSHIFT_NODE_PORT

int

Image pull policy

Environment variable: QUARKUS_OPENSHIFT_IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_OPENSHIFT_IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_OPENSHIFT_LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_OPENSHIFT_READINESS_PROBE_FAILURE_THRESHOLD

int

3

When true (the default), emit a set of annotations to identify services that should be scraped by prometheus for metrics. In configurations that use the Prometheus operator with ServiceMonitor, annotations may not be necessary.

Environment variable: QUARKUS_OPENSHIFT_PROMETHEUS_ANNOTATIONS

boolean

true

Define the annotation prefix used for scrape values, this value will be used as the base for other annotation name defaults. Altering the base for generated annotations can make it easier to define re-labeling rules and avoid unexpected knock-on effects. The default value is prometheus.io See Prometheus example: https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus-kubernetes.yml

Environment variable: QUARKUS_OPENSHIFT_PROMETHEUS_PREFIX

string

prometheus.io

Define the annotation used to indicate services that should be scraped. By default, /scrape will be appended to the defined prefix.

Environment variable: QUARKUS_OPENSHIFT_PROMETHEUS_SCRAPE

string

Define the annotation used to indicate the path to scrape. By default, /path will be appended to the defined prefix.

Environment variable: QUARKUS_OPENSHIFT_PROMETHEUS_PATH

string

Define the annotation used to indicate the port to scrape. By default, /port will be appended to the defined prefix.

Environment variable: QUARKUS_OPENSHIFT_PROMETHEUS_PORT

string

Define the annotation used to indicate the scheme to use for scraping By default, /scheme will be appended to the defined prefix.

Environment variable: QUARKUS_OPENSHIFT_PROMETHEUS_SCHEME

string

CPU Requirements

Environment variable: QUARKUS_OPENSHIFT_RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_OPENSHIFT_RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_OPENSHIFT_RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_OPENSHIFT_RESOURCES_REQUESTS_MEMORY

string

If set, it will change the name of the container according to the configuration

Environment variable: QUARKUS_OPENSHIFT_CONTAINER_NAME

string

If true, an Openshift Route will be created

Environment variable: QUARKUS_OPENSHIFT_EXPOSE

boolean

false

If true, the service will be exposed

Environment variable: QUARKUS_OPENSHIFT_ROUTE_EXPOSE

boolean

false

The host under which the application is going to be exposed

Environment variable: QUARKUS_OPENSHIFT_ROUTE_HOST

string

If true, the 'app.kubernetes.io/version' label will be part of the selectors of Service and DeploymentConfig

Environment variable: QUARKUS_OPENSHIFT_ADD_VERSION_TO_LABEL_SELECTORS

boolean

true

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_OPENSHIFT_ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_OPENSHIFT_ENV_CONFIGMAPS

list of string

If set, the secret will mounted to the application container and its contents will be used for application configuration.

Environment variable: QUARKUS_OPENSHIFT_APP_SECRET

string

If set, the config amp will be mounted to the application container and its contents will be used for application configuration.

Environment variable: QUARKUS_OPENSHIFT_APP_CONFIG_MAP

string

The SELinux level label that applies to the container.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_SE_LINUX_OPTIONS_LEVEL

string

The SELinux role label that applies to the container.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_SE_LINUX_OPTIONS_ROLE

string

The SELinux type label that applies to the container.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_SE_LINUX_OPTIONS_TYPE

string

The SELinux user label that applies to the container.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_SE_LINUX_OPTIONS_USER

string

The name of the GMSA credential spec to use.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_WINDOWS_OPTIONS_GMSA_CREDENTIAL_SPEC_NAME

string

GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_WINDOWS_OPTIONS_GMSA_CREDENTIAL_SPEC

string

The UserName in Windows to run the entrypoint of the container process.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_WINDOWS_OPTIONS_RUN_AS_USER_NAME

string

HostProcess determines if a container should be run as a 'Host Process' container.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_WINDOWS_OPTIONS_HOST_PROCESS

boolean

The UID to run the entrypoint of the container process.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_RUN_AS_USER

long

The GID to run the entrypoint of the container process.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_RUN_AS_GROUP

long

Indicates that the container must run as a non-root user.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_RUN_AS_NON_ROOT

boolean

A list of groups applied to the first process run in each container, in addition to the container’s primary GID. If unspecified, no groups will be added to any container.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_SUPPLEMENTAL_GROUPS

list of long

A special supplemental group that applies to all containers in a pod.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_FS_GROUP

long

Sysctls hold a list of namespaced sysctls used for the pod.

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_SYSCTLS

string

It holds policies that will be used for applying fsGroup to a volume when volume is mounted. Values: OnRootMismatch, Always

Environment variable: QUARKUS_OPENSHIFT_SECURITY_CONTEXT_FS_GROUP_CHANGE_POLICY

on-root-mismatchIt indicates that volume’s ownership and permissions will be changed only when permission and ownership of root directory does not match with expected permissions on the volume., alwaysIt indicates that volume’s ownership and permissions should always be changed whenever volume is mounted inside a Pod. This the default behavior.

If true, the debug mode in pods will be enabled.

Environment variable: QUARKUS_OPENSHIFT_REMOTE_DEBUG_ENABLED

boolean

false

The transport to use.

Environment variable: QUARKUS_OPENSHIFT_REMOTE_DEBUG_TRANSPORT

string

dt_socket

If enabled, it means the JVM will wait for the debugger to attach before executing the main class. If false, the JVM will immediately execute the main class, while listening for the debugger connection.

Environment variable: QUARKUS_OPENSHIFT_REMOTE_DEBUG_SUSPEND

string

n

It specifies the address at which the debug socket will listen.

Environment variable: QUARKUS_OPENSHIFT_REMOTE_DEBUG_ADDRESS_PORT

int

5005

Custom labels to add to all resources

Environment variable: QUARKUS_OPENSHIFT_LABELS

Map<String,String>

Custom annotations to add to all resources

Environment variable: QUARKUS_OPENSHIFT_ANNOTATIONS

Map<String,String>

The port number. Refers to the container port.

Environment variable: QUARKUS_OPENSHIFT_PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_OPENSHIFT_PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_OPENSHIFT_PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_OPENSHIFT_PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_OPENSHIFT_PORTS__PORTS__NODE_PORT

int

The name of the volumeName to mount.

Environment variable: QUARKUS_OPENSHIFT_MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_OPENSHIFT_MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_OPENSHIFT_MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_OPENSHIFT_MOUNTS__MOUNTS__READ_ONLY

boolean

false

The name of the secret to mount.

Environment variable: QUARKUS_OPENSHIFT_SECRET_VOLUMES__SECRET_VOLUMES__SECRET_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_OPENSHIFT_SECRET_VOLUMES__SECRET_VOLUMES__DEFAULT_MODE

string

0600

The path where the file will be mounted.

Environment variable: QUARKUS_OPENSHIFT_SECRET_VOLUMES__SECRET_VOLUMES__ITEMS__ITEMS__PATH

string

required

It must be a value between 0000 and 0777. If not specified, the volume defaultMode will be used.

Environment variable: QUARKUS_OPENSHIFT_SECRET_VOLUMES__SECRET_VOLUMES__ITEMS__ITEMS__MODE

int

-1

Optional

Environment variable: QUARKUS_OPENSHIFT_SECRET_VOLUMES__SECRET_VOLUMES__OPTIONAL

boolean

false

The name of the ConfigMap to mount.

Environment variable: QUARKUS_OPENSHIFT_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__CONFIG_MAP_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_OPENSHIFT_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__DEFAULT_MODE

string

0600

The path where the file will be mounted.

Environment variable: QUARKUS_OPENSHIFT_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__ITEMS__ITEMS__PATH

string

required

It must be a value between 0000 and 0777. If not specified, the volume defaultMode will be used.

Environment variable: QUARKUS_OPENSHIFT_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__ITEMS__ITEMS__MODE

int

-1

Optional

Environment variable: QUARKUS_OPENSHIFT_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__OPTIONAL

boolean

false

Git repository URL.

Environment variable: QUARKUS_OPENSHIFT_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__REPOSITORY

string

required

The directory of the repository to mount.

Environment variable: QUARKUS_OPENSHIFT_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__DIRECTORY

string

The commit hash to use.

Environment variable: QUARKUS_OPENSHIFT_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__REVISION

string

The name of the claim to mount.

Environment variable: QUARKUS_OPENSHIFT_PVC_VOLUMES__PVC_VOLUMES__CLAIM_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_OPENSHIFT_PVC_VOLUMES__PVC_VOLUMES__DEFAULT_MODE

string

0600

Optional

Environment variable: QUARKUS_OPENSHIFT_PVC_VOLUMES__PVC_VOLUMES__OPTIONAL

boolean

false

The name of the disk to mount.

Environment variable: QUARKUS_OPENSHIFT_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__VOLUME_ID

string

required

The partition.

Environment variable: QUARKUS_OPENSHIFT_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__PARTITION

int

Filesystem type.

Environment variable: QUARKUS_OPENSHIFT_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__FS_TYPE

string

ext4

Whether the volumeName is read only or not.

Environment variable: QUARKUS_OPENSHIFT_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__READ_ONLY

boolean

false

The share name.

Environment variable: QUARKUS_OPENSHIFT_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__SHARE_NAME

string

required

The secret name.

Environment variable: QUARKUS_OPENSHIFT_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__SECRET_NAME

string

required

Whether the volumeName is read only or not.

Environment variable: QUARKUS_OPENSHIFT_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__READ_ONLY

boolean

false

The name of the disk to mount.

Environment variable: QUARKUS_OPENSHIFT_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__DISK_NAME

string

required

The URI of the vhd blob object OR the resourceID of an Azure managed data disk if Kind is Managed

Environment variable: QUARKUS_OPENSHIFT_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__DISK_URI

string

required

Kind of disk.

Environment variable: QUARKUS_OPENSHIFT_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__KIND

managed, shared

managed

Disk caching mode.

Environment variable: QUARKUS_OPENSHIFT_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__CACHING_MODE

read-write, read-only, none

read-write

File system type.

Environment variable: QUARKUS_OPENSHIFT_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__FS_TYPE

string

ext4

Whether the volumeName is read only or not.

Environment variable: QUARKUS_OPENSHIFT_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__READ_ONLY

boolean

false

The container image.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE

string

Working directory.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__WORKING_DIR

string

The commands

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__COMMAND

list of string

The arguments

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ARGUMENTS

list of string

The service account.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__SERVICE_ACCOUNT

string

The host under which the application is going to be exposed.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__HOST

string

The port number. Refers to the container port.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__NODE_PORT

int

Image pull policy.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_FAILURE_THRESHOLD

int

3

The name of the volumeName to mount.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__READ_ONLY

boolean

false

CPU Requirements

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_CONFIGMAPS

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_OPENSHIFT_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__WITH_KEY

string

required

The container image.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__IMAGE

string

Working directory.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__WORKING_DIR

string

The commands

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__COMMAND

list of string

The arguments

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ARGUMENTS

list of string

The service account.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__SERVICE_ACCOUNT

string

The host under which the application is going to be exposed.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__HOST

string

The port number. Refers to the container port.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__PORTS__PORTS__NODE_PORT

int

Image pull policy.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__READINESS_PROBE_FAILURE_THRESHOLD

int

3

The name of the volumeName to mount.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__MOUNTS__MOUNTS__READ_ONLY

boolean

false

CPU Requirements

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_CONFIGMAPS

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_OPENSHIFT_SIDECARS__SIDECARS__ENV_MAPPING__MAPPING__WITH_KEY

string

required

The ip address

Environment variable: QUARKUS_OPENSHIFT_HOST_ALIASES__HOST_ALIASES__IP

string

The hostnames to resolve to the ip

Environment variable: QUARKUS_OPENSHIFT_HOST_ALIASES__HOST_ALIASES__HOSTNAMES

list of string

Custom annotations to add to exposition (route or ingress) resources

Environment variable: QUARKUS_OPENSHIFT_ROUTE_ANNOTATIONS

Map<String,String>

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_OPENSHIFT_ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_OPENSHIFT_ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_OPENSHIFT_ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_OPENSHIFT_ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_OPENSHIFT_ENV_MAPPING__MAPPING__WITH_KEY

string

required

Knative

Knative リソースの生成を可能にするには、ターゲットプラットフォームに Knative を含める必要があります。

quarkus.kubernetes.deployment-target=knative

./mvnw package の実行後、作成された他のファイルの中に knative.jsonknative.yml という名前のファイルが target/kubernetes/ ディレクトリーにあることに気づくでしょう。

どちらかのファイルを見ると、Knative Service が含まれることが確認できます。

knative.json ファイルの完全なソースはこんな感じです。

{
  {
    "apiVersion" : "serving.quarkus.knative.dev/v1alpha1",
    "kind" : "Service",
    "metadata" : {
      "annotations": {
       "app.quarkus.io/vcs-url" : "<some url>",
       "app.quarkus.io/commit-id" : "<some git SHA>"
      },
      "labels" : {
        "app.kubernetes.io/name" : "test-quarkus-app",
        "app.kubernetes.io/version" : "1.0.0-SNAPSHOT"
      },
      "name" : "knative"
    },
    "spec" : {
      "runLatest" : {
        "configuration" : {
          "revisionTemplate" : {
            "spec" : {
              "container" : {
                "image" : "dev.local/yourDockerUsername/test-quarkus-app:1.0.0-SNAPSHOT",
                "imagePullPolicy" : "Always"
              }
            }
          }
        }
      }
    }
  }
}

生成されたマニフェストは、 kubectl を使用して、実行中のクラスターにそのままデプロイすることができます。

kubectl apply -f target/kubernetes/knative.json

生成されたサービスは、以下のプロパティーを使用してカスタマイズすることができます:

Knative

ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能

Configuration property

タイプ

デフォルト

The name of the group this component belongs too

Environment variable: QUARKUS_KNATIVE_PART_OF

string

The name of the application. This value will be used for naming Kubernetes resources like: - Deployment - Service and so on …​

Environment variable: QUARKUS_KNATIVE_NAME

string

${quarkus.container-image.name}

The version of the application.

Environment variable: QUARKUS_KNATIVE_VERSION

string

${quarkus.container-image.tag}

The namespace the generated resources should belong to. If not value is set, then the 'namespace' field will not be added to the 'metadata' section of the generated manifests. This in turn means that when the manifests are applied to a cluster, the namespace will be resolved from the current Kubernetes context (see https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context for more details).

Environment variable: QUARKUS_KNATIVE_NAMESPACE

string

Whether to add the build timestamp to the Kubernetes annotations This is a very useful way to have manifests of successive builds of the same application differ - thus ensuring that Kubernetes will apply the updated resources

Environment variable: QUARKUS_KNATIVE_ADD_BUILD_TIMESTAMP

boolean

true

Working directory

Environment variable: QUARKUS_KNATIVE_WORKING_DIR

string

The commands

Environment variable: QUARKUS_KNATIVE_COMMAND

list of string

The arguments

Environment variable: QUARKUS_KNATIVE_ARGUMENTS

list of string

The service account

Environment variable: QUARKUS_KNATIVE_SERVICE_ACCOUNT

string

The host under which the application is going to be exposed

Environment variable: QUARKUS_KNATIVE_HOST

string

The type of service that will be generated for the application

Environment variable: QUARKUS_KNATIVE_SERVICE_TYPE

cluster-ip, node-port, load-balancer, external-name

cluster-ip

Image pull policy

Environment variable: QUARKUS_KNATIVE_IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_KNATIVE_IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KNATIVE_LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KNATIVE_READINESS_PROBE_FAILURE_THRESHOLD

int

3

When true (the default), emit a set of annotations to identify services that should be scraped by prometheus for metrics. In configurations that use the Prometheus operator with ServiceMonitor, annotations may not be necessary.

Environment variable: QUARKUS_KNATIVE_PROMETHEUS_ANNOTATIONS

boolean

true

Define the annotation prefix used for scrape values, this value will be used as the base for other annotation name defaults. Altering the base for generated annotations can make it easier to define re-labeling rules and avoid unexpected knock-on effects. The default value is prometheus.io See Prometheus example: https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus-kubernetes.yml

Environment variable: QUARKUS_KNATIVE_PROMETHEUS_PREFIX

string

prometheus.io

Define the annotation used to indicate services that should be scraped. By default, /scrape will be appended to the defined prefix.

Environment variable: QUARKUS_KNATIVE_PROMETHEUS_SCRAPE

string

Define the annotation used to indicate the path to scrape. By default, /path will be appended to the defined prefix.

Environment variable: QUARKUS_KNATIVE_PROMETHEUS_PATH

string

Define the annotation used to indicate the port to scrape. By default, /port will be appended to the defined prefix.

Environment variable: QUARKUS_KNATIVE_PROMETHEUS_PORT

string

Define the annotation used to indicate the scheme to use for scraping By default, /scheme will be appended to the defined prefix.

Environment variable: QUARKUS_KNATIVE_PROMETHEUS_SCHEME

string

If set, it will change the name of the container according to the configuration

Environment variable: QUARKUS_KNATIVE_CONTAINER_NAME

string

CPU Requirements

Environment variable: QUARKUS_KNATIVE_RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KNATIVE_RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_KNATIVE_RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KNATIVE_RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_KNATIVE_ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_KNATIVE_ENV_CONFIGMAPS

list of string

Whether this service is cluster-local. Cluster local services are not exposed to the outside world. More information in this link.

Environment variable: QUARKUS_KNATIVE_CLUSTER_LOCAL

boolean

false

This value controls the minimum number of replicas each revision should have. Knative will attempt to never have less than this number of replicas at any point in time.

Environment variable: QUARKUS_KNATIVE_MIN_SCALE

int

This value controls the maximum number of replicas each revision should have. Knative will attempt to never have more than this number of replicas running, or in the process of being created, at any point in time.

Environment variable: QUARKUS_KNATIVE_MAX_SCALE

int

The scale-to-zero values control whether Knative allows revisions to scale down to zero, or stops at “1”.

Environment variable: QUARKUS_KNATIVE_SCALE_TO_ZERO_ENABLED

boolean

true

Environment variable: QUARKUS_KNATIVE_REVISION_AUTO_SCALING_AUTO_SCALER_CLASS

kpa, hpa

Environment variable: QUARKUS_KNATIVE_REVISION_AUTO_SCALING_METRIC

concurrency, rps, cpu

Environment variable: QUARKUS_KNATIVE_REVISION_AUTO_SCALING_TARGET

int

Environment variable: QUARKUS_KNATIVE_REVISION_AUTO_SCALING_CONTAINER_CONCURRENCY

int

Environment variable: QUARKUS_KNATIVE_REVISION_AUTO_SCALING_TARGET_UTILIZATION_PERCENTAGE

int

Environment variable: QUARKUS_KNATIVE_GLOBAL_AUTO_SCALING_AUTO_SCALER_CLASS

kpa, hpa

Environment variable: QUARKUS_KNATIVE_GLOBAL_AUTO_SCALING_CONTAINER_CONCURRENCY

int

Environment variable: QUARKUS_KNATIVE_GLOBAL_AUTO_SCALING_TARGET_UTILIZATION_PERCENTAGE

int

Environment variable: QUARKUS_KNATIVE_GLOBAL_AUTO_SCALING_REQUESTS_PER_SECOND

int

Environment variable: QUARKUS_KNATIVE_REVISION_NAME

string

If set, the secret will mounted to the application container and its contents will be used for application configuration.

Environment variable: QUARKUS_KNATIVE_APP_SECRET

string

If set, the config map will be mounted to the application container and its contents will be used for application configuration.

Environment variable: QUARKUS_KNATIVE_APP_CONFIG_MAP

string

The SELinux level label that applies to the container.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_SE_LINUX_OPTIONS_LEVEL

string

The SELinux role label that applies to the container.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_SE_LINUX_OPTIONS_ROLE

string

The SELinux type label that applies to the container.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_SE_LINUX_OPTIONS_TYPE

string

The SELinux user label that applies to the container.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_SE_LINUX_OPTIONS_USER

string

The name of the GMSA credential spec to use.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_WINDOWS_OPTIONS_GMSA_CREDENTIAL_SPEC_NAME

string

GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_WINDOWS_OPTIONS_GMSA_CREDENTIAL_SPEC

string

The UserName in Windows to run the entrypoint of the container process.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_WINDOWS_OPTIONS_RUN_AS_USER_NAME

string

HostProcess determines if a container should be run as a 'Host Process' container.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_WINDOWS_OPTIONS_HOST_PROCESS

boolean

The UID to run the entrypoint of the container process.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_RUN_AS_USER

long

The GID to run the entrypoint of the container process.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_RUN_AS_GROUP

long

Indicates that the container must run as a non-root user.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_RUN_AS_NON_ROOT

boolean

A list of groups applied to the first process run in each container, in addition to the container’s primary GID. If unspecified, no groups will be added to any container.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_SUPPLEMENTAL_GROUPS

list of long

A special supplemental group that applies to all containers in a pod.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_FS_GROUP

long

Sysctls hold a list of namespaced sysctls used for the pod.

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_SYSCTLS

string

It holds policies that will be used for applying fsGroup to a volume when volume is mounted. Values: OnRootMismatch, Always

Environment variable: QUARKUS_KNATIVE_SECURITY_CONTEXT_FS_GROUP_CHANGE_POLICY

on-root-mismatchIt indicates that volume’s ownership and permissions will be changed only when permission and ownership of root directory does not match with expected permissions on the volume., alwaysIt indicates that volume’s ownership and permissions should always be changed whenever volume is mounted inside a Pod. This the default behavior.

Custom labels to add to all resources

Environment variable: QUARKUS_KNATIVE_LABELS

Map<String,String>

Custom annotations to add to all resources

Environment variable: QUARKUS_KNATIVE_ANNOTATIONS

Map<String,String>

The port number. Refers to the container port.

Environment variable: QUARKUS_KNATIVE_PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_KNATIVE_PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_KNATIVE_PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_KNATIVE_PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_KNATIVE_PORTS__PORTS__NODE_PORT

int

The name of the volumeName to mount.

Environment variable: QUARKUS_KNATIVE_MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_KNATIVE_MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_KNATIVE_MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_KNATIVE_MOUNTS__MOUNTS__READ_ONLY

boolean

false

The name of the secret to mount.

Environment variable: QUARKUS_KNATIVE_SECRET_VOLUMES__SECRET_VOLUMES__SECRET_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_KNATIVE_SECRET_VOLUMES__SECRET_VOLUMES__DEFAULT_MODE

string

0600

The path where the file will be mounted.

Environment variable: QUARKUS_KNATIVE_SECRET_VOLUMES__SECRET_VOLUMES__ITEMS__ITEMS__PATH

string

required

It must be a value between 0000 and 0777. If not specified, the volume defaultMode will be used.

Environment variable: QUARKUS_KNATIVE_SECRET_VOLUMES__SECRET_VOLUMES__ITEMS__ITEMS__MODE

int

-1

Optional

Environment variable: QUARKUS_KNATIVE_SECRET_VOLUMES__SECRET_VOLUMES__OPTIONAL

boolean

false

The name of the ConfigMap to mount.

Environment variable: QUARKUS_KNATIVE_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__CONFIG_MAP_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_KNATIVE_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__DEFAULT_MODE

string

0600

The path where the file will be mounted.

Environment variable: QUARKUS_KNATIVE_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__ITEMS__ITEMS__PATH

string

required

It must be a value between 0000 and 0777. If not specified, the volume defaultMode will be used.

Environment variable: QUARKUS_KNATIVE_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__ITEMS__ITEMS__MODE

int

-1

Optional

Environment variable: QUARKUS_KNATIVE_CONFIG_MAP_VOLUMES__CONFIG_MAP_VOLUMES__OPTIONAL

boolean

false

Git repository URL.

Environment variable: QUARKUS_KNATIVE_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__REPOSITORY

string

required

The directory of the repository to mount.

Environment variable: QUARKUS_KNATIVE_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__DIRECTORY

string

The commit hash to use.

Environment variable: QUARKUS_KNATIVE_GIT_REPO_VOLUMES__GIT_REPO_VOLUMES__REVISION

string

The name of the claim to mount.

Environment variable: QUARKUS_KNATIVE_PVC_VOLUMES__PVC_VOLUMES__CLAIM_NAME

string

required

Default mode. When specifying an octal number, leading zero must be present.

Environment variable: QUARKUS_KNATIVE_PVC_VOLUMES__PVC_VOLUMES__DEFAULT_MODE

string

0600

Optional

Environment variable: QUARKUS_KNATIVE_PVC_VOLUMES__PVC_VOLUMES__OPTIONAL

boolean

false

The name of the disk to mount.

Environment variable: QUARKUS_KNATIVE_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__VOLUME_ID

string

required

The partition.

Environment variable: QUARKUS_KNATIVE_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__PARTITION

int

Filesystem type.

Environment variable: QUARKUS_KNATIVE_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__FS_TYPE

string

ext4

Whether the volumeName is read only or not.

Environment variable: QUARKUS_KNATIVE_AWS_ELASTIC_BLOCK_STORE_VOLUMES__AWS_ELASTIC_BLOCK_STORE_VOLUMES__READ_ONLY

boolean

false

The share name.

Environment variable: QUARKUS_KNATIVE_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__SHARE_NAME

string

required

The secret name.

Environment variable: QUARKUS_KNATIVE_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__SECRET_NAME

string

required

Whether the volumeName is read only or not.

Environment variable: QUARKUS_KNATIVE_AZURE_FILE_VOLUMES__AZURE_FILE_VOLUMES__READ_ONLY

boolean

false

The name of the disk to mount.

Environment variable: QUARKUS_KNATIVE_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__DISK_NAME

string

required

The URI of the vhd blob object OR the resourceID of an Azure managed data disk if Kind is Managed

Environment variable: QUARKUS_KNATIVE_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__DISK_URI

string

required

Kind of disk.

Environment variable: QUARKUS_KNATIVE_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__KIND

managed, shared

managed

Disk caching mode.

Environment variable: QUARKUS_KNATIVE_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__CACHING_MODE

read-write, read-only, none

read-write

File system type.

Environment variable: QUARKUS_KNATIVE_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__FS_TYPE

string

ext4

Whether the volumeName is read only or not.

Environment variable: QUARKUS_KNATIVE_AZURE_DISK_VOLUMES__AZURE_DISK_VOLUMES__READ_ONLY

boolean

false

The container image.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE

string

Working directory.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__WORKING_DIR

string

The commands

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__COMMAND

list of string

The arguments

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ARGUMENTS

list of string

The service account.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__SERVICE_ACCOUNT

string

The host under which the application is going to be exposed.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__HOST

string

The port number. Refers to the container port.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__PORTS__PORTS__NODE_PORT

int

Image pull policy.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__READINESS_PROBE_FAILURE_THRESHOLD

int

3

The name of the volumeName to mount.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__MOUNTS__MOUNTS__READ_ONLY

boolean

false

CPU Requirements

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_CONFIGMAPS

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_KNATIVE_INIT_CONTAINERS__INIT_CONTAINERS__ENV_MAPPING__MAPPING__WITH_KEY

string

required

The container image.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__IMAGE

string

Working directory.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__WORKING_DIR

string

The commands

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__COMMAND

list of string

The arguments

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ARGUMENTS

list of string

The service account.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__SERVICE_ACCOUNT

string

The host under which the application is going to be exposed.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__HOST

string

The port number. Refers to the container port.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__PORTS__PORTS__CONTAINER_PORT

int

The host port.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__PORTS__PORTS__HOST_PORT

int

The application path (refers to web application path).

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__PORTS__PORTS__PATH

string

/

The protocol.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__PORTS__PORTS__PROTOCOL

tcp, udp

tcp

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__PORTS__PORTS__NODE_PORT

int

Image pull policy.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__IMAGE_PULL_POLICY

always, if-not-present, never

always

The image pull secret

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__IMAGE_PULL_SECRETS

list of string

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__LIVENESS_PROBE_FAILURE_THRESHOLD

int

3

The http path to use for the probe For this to work, the container port also needs to be set Assuming the container port has been set (as per above comment), if execAction or tcpSocketAction are not set, an HTTP probe will be used automatically even if no path is set (which will result in the root path being used)

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_HTTP_ACTION_PATH

string

The command to use for the probe.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_EXEC_ACTION

string

The tcp socket to use for the probe (the format is host:port).

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_TCP_SOCKET_ACTION

string

The amount of time to wait before starting to probe.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_INITIAL_DELAY

Duration

0S

The period in which the action should be called.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_PERIOD

Duration

30S

The amount of time to wait for each action.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_TIMEOUT

Duration

10S

The success threshold to use.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_SUCCESS_THRESHOLD

int

1

The failure threshold to use.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__READINESS_PROBE_FAILURE_THRESHOLD

int

3

The name of the volumeName to mount.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__MOUNTS__MOUNTS__NAME

string

The path to mount.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__MOUNTS__MOUNTS__PATH

string

Path within the volumeName from which the container’s volumeName should be mounted.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__MOUNTS__MOUNTS__SUB_PATH

string

ReadOnly

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__MOUNTS__MOUNTS__READ_ONLY

boolean

false

CPU Requirements

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__RESOURCES_LIMITS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__RESOURCES_LIMITS_MEMORY

string

CPU Requirements

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__RESOURCES_REQUESTS_CPU

string

Memory Requirements

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__RESOURCES_REQUESTS_MEMORY

string

The optional list of Secret names to load environment variables from.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_SECRETS

list of string

The optional list of ConfigMap names to load environment variables from.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_CONFIGMAPS

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_KNATIVE_CONTAINERS__CONTAINERS__ENV_MAPPING__MAPPING__WITH_KEY

string

required

The ip address

Environment variable: QUARKUS_KNATIVE_HOST_ALIASES__HOST_ALIASES__IP

string

The hostnames to resolve to the ip

Environment variable: QUARKUS_KNATIVE_HOST_ALIASES__HOST_ALIASES__HOSTNAMES

list of string

The map associating environment variable names to their associated field references they take their value from.

Environment variable: QUARKUS_KNATIVE_ENV_FIELDS

Map<String,String>

The map associating environment name to its associated value.

Environment variable: QUARKUS_KNATIVE_ENV_VARS

Map<String,String>

The optional name of the Secret from which a value is to be extracted. Mutually exclusive with from-configmap.

Environment variable: QUARKUS_KNATIVE_ENV_MAPPING__MAPPING__FROM_SECRET

string

The optional name of the ConfigMap from which a value is to be extracted. Mutually exclusive with from-secret.

Environment variable: QUARKUS_KNATIVE_ENV_MAPPING__MAPPING__FROM_CONFIGMAP

string

The key identifying the field from which the value is extracted.

Environment variable: QUARKUS_KNATIVE_ENV_MAPPING__MAPPING__WITH_KEY

string

required

Tag is optionally used to expose a dedicated url for referencing this target exclusively.

Environment variable: QUARKUS_KNATIVE_TRAFFIC__TRAFFIC__TAG

string

RevisionName of a specific revision to which to send this portion of traffic.

Environment variable: QUARKUS_KNATIVE_TRAFFIC__TRAFFIC__REVISION_NAME

string

LatestRevision may be optionally provided to indicate that the latest ready Revision of the Configuration should be used for this traffic target. When provided LatestRevision must be true if RevisionName is empty.

Environment variable: QUARKUS_KNATIVE_TRAFFIC__TRAFFIC__LATEST_REVISION

boolean

false

Percent indicates that percentage based routing should be used and the value indicates the percent of traffic that is to be routed to this Revision or Configuration. 0 (zero) mean no traffic, 100 means all traffic.

Environment variable: QUARKUS_KNATIVE_TRAFFIC__TRAFFIC__PERCENT

long

100

デプロイメントターゲット

前のセクションで述べたのは deployment-target という概念です。この概念により、ユーザーはどの Kubernetes マニフェストを生成してクラスターにデプロイするかを制御することができます ( quarkus.kubernetes.deploytrue に設定されている場合)。

デフォルトでは、 deployment-target が設定されていない場合は、バニラ Kubernetes リソースのみが生成され、デプロイされます。複数の値が設定されている場合 (例: quarkus.kubernetes.deployment-target=kubernetes,openshift )、すべてのターゲットのリソースが生成されますが、 最初 のターゲットに対応するリソースのみがクラスターに適用されます (デプロイが有効な場合)。

OpenShiftやMinikubeのようなラッパーエクステンションの場合、これらのエクステンションがプロジェクトに明示的に追加されているときは、それらのエクステンションによってデフォルトの deployment-target が設定されます。例えば、 quarkus-minikube がプロジェクトに追加されている場合、 minikube がデフォルトのデプロイメントターゲットになり、 quarkus.kubernetes.deploy 経由のデプロイメントが設定されていると、そのリソースが Kubernetes クラスターに適用されます。ユーザーは、 quarkus.kubernetes.deployment-target を使用して手動でディプロイメント ターゲットを上書きすることもできます。

非推奨の設定

以下のカテゴリの構成プロパティーは非推奨となりました。

quarkus接頭辞のないプロパティー

以前のバージョンのエクステンションでは、これらのプロパティーに quarkus. がありませんでした。これらのプロパティーは現在非推奨となっています。

Docker と S2i のプロパティー

dockers2i を設定するためのプロパティーも非推奨となり、新しいコンテナーイメージエクステンションが採用されました。

コンフィググループ配列

Properties referring to config group arrays (e.g. kubernetes.labels[0], kubernetes.env-vars[0] etc) have been converted to Maps to align with the rest of the Quarkus ecosystem.

以下のコードは labels の設定を変更した様子を示しています:

# Old labels config:
kubernetes.labels[0].name=foo
kubernetes.labels[0].value=bar

# New labels
quarkus.kubernetes.labels.foo=bar

以下のコードは env-vars の設定を変更した様子を示しています:

# Old env-vars config:
kubernetes.env-vars[0].name=foo
kubernetes.env-vars[0].configmap=my-configmap

# New env-vars
quarkus.kubernetes.env-vars.foo.configmap=myconfigmap

env-vars プロパティー

quarkus.kubernetes.env-vars は非推奨となったため (この記事の執筆時点ではまだサポートされていますが) 、代わりに新しい宣言スタイルを使う必要があります。詳細は、環境変数 のほか、より具体的には 下位互換性 を参照してください。

Deployment

コンテナーイメージをビルドしてデプロイするには、 quarkus.kubernetes.deploy フラグを有効にする必要があります (このフラグはデフォルトでは無効になっています - さらに、テスト実行中や開発モードでは何の効果もありません)。これはコマンドラインで簡単に行えます。

./mvnw clean package -Dquarkus.kubernetes.deploy=true

コンテナーイメージのビルド

コンテナーイメージのビルドは、利用可能な3つの container-image エクステンションのいずれかを使用して可能です。

デプロイが要求されるたびに、暗黙のうちにコンテナーイメージのビルドがトリガーされます(Kubernetes のデプロイが有効になっている場合は、追加のプロパティーは必要ありません)。

デプロイ

デプロイメントを有効にすると、Kubernetes エクステンションは quarkus.kubernetes.deployment-target で指定されたリソースを選択してデプロイします。これは、ターゲットの Kubernetes クラスターを指す .kube/config がユーザーディレクトリーで利用可能であることを前提としています。言い換えれば、エクステンションは kubectl が使用しているクラスターであればどれでも使用します。これは、クレデンシャルについても当てはまります。

現在のところ、さらなるカスタマイズのための追加オプションは提供されていません。

リモートデバッグ

kubernetes 環境で動作しているアプリケーションをリモートでデバッグするには、前のセクションで説明したようにアプリケーションをデプロイし、新しいプロパティー (quarkus.kubernetes.remote-debug.enabled=true) として追加する必要があります。このプロパティーは、Java アプリケーションを自動的に設定し、Java エージェント設定 (例: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005) だけでなく、Java エージェントポートを使ってリッスンするサービスリソースも追加します。

デバッグを有効にした状態でアプリケーションをデプロイしたら、次に、ローカルホストマシンから java エージェントの指定されたポートにトラフィックをトンネルする必要があります。

kubectl port-forward svc/<application name> 5005:5005

このコマンドを使用すると、java エージェントがリモートデバッグ用にデフォルトで使用するポート "5005" を使用して、"localhost:5005" からのトラフィックを java エージェントを実行している kubernetes サービスに転送することになります。プロパティー quarkus.kubernetes.remote-debug.address-port を使用して、別の java エージェントポートを設定することも可能です。

最後に、やらなければならないのは、localhost:5005 に転送される java エージェントプロセスをアタッチするようにお気に入りの IDE を設定し、アプリケーションのデバッグを開始することだけです。たとえば、IntelliJ IDEA では、https://www.jetbrains.com/help/idea/tutorial-remote-debug.html:[this tutorial] に従って、リモートアプリケーションのデバッグを行うことができます。

既存のリソースの利用

Sometimes it’s desirable to either provide additional resources (e.g. a ConfigMap, a Secret, a Deployment for a database) or provide custom ones that will be used as a base for the generation process. Those resources can be added under src/main/kubernetes directory and can be named after the target environment (e.g. kubernetes.json, openshift.json, knative.json, or the yml equivalents). The correlation between provided and generated files is done by file name. So, a kubernetes.json/kubernetes.yml file added in src/main/kubernetes will only affect the generated kubernetes.json/kubernetes.yml. An openshift.json/openshift.yml file added in src/main/kubernetes will only affect the generated openshift.json/openshift.yml. A knative.json/knative.yml file added in src/main/kubernetes will only affect the generated knative.json/knative.yml and so on. The provided file may be either in json or yaml format and may contain one or more resources. These resources will end up in both generated formats (json and yaml). For example, a secret added in src/main/kubernetes/kubernetes.yml will be added to both the generated kubernetes.yml and kubernetes.json.

Note: At the time of writing there is no mechanism in place that allows a one-to-many relationship between provided and generated files. Minikube is not an exception to the rule above, so if you want to customize the generated minikube manifests, the file placed under src/main/kubernetes will have to be named minikube.json or minikube.yml (naming it kubernetes.yml or kubernetes.json will result in having only the generated kubernetes.yml and kubernetes.json affected).

Any resource found will be added in the generated manifests. Global modifications (e.g. labels, annotations) will also be applied to those resources. If one of the provided resources has the same name as one of the generated ones, then the generated resource will be created on top of the provided resource, respecting existing content when possible (e.g. existing labels, annotations, environment variables, mounts, replicas etc).

リソースの名前はアプリケーション名によって決定され、 quarkus.kubernetes.namequarkus.openshift.namequarkus.knative.name で上書きすることができます。

例えば、 kubernetes-quickstart アプリケーションでは、 src/main/kubernetes の中に kubernetes.yml のようなファイルを追加することができます。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubernetes-quickstart
  labels:
    app: quickstart
spec:
  replicas: 3
  selector:
    matchLabels:
      app: quickstart
  template:
    metadata:
      labels:
        app: quickstart
    spec:
      containers:
      - name: kubernetes-quickstart
        image: someimage:latest
        ports:
        - containerPort: 80
        env:
        - name: FOO
          value: BAR

生成された kubernetes.yml は以下のようになります。

apiVersion: "apps/v1"
kind: "Deployment"
metadata:
  annotations:
    app.quarkus.io/build-timestamp: "2020-04-10 - 12:54:37 +0000"
  labels:
    app: "quickstart"
  name: "kubernetes-quickstart"
spec:
  replicas: 3 (1)
  selector:
    matchLabels:
      app.kubernetes.io/name: "kubernetes-quickstart"
      app.kubernetes.io/version: "1.0.0-SNAPSHOT"
  template:
    metadata:
      annotations:
        app.quarkus.io/build-timestamp: "2020-04-10 - 12:54:37 +0000"
      labels:
        app: "quickstart" (2)
    spec:
      containers:
      - env:
        - name: "FOO" (3)
          value: "BAR"
        image: "<<yourDockerUsername>>/kubernetes-quickstart:1.0.0-SNAPSHOT" (4)
        imagePullPolicy: "Always"
        name: "kubernetes-quickstart"
        ports:
        - containerPort: 8080 (5)
          name: "http"
          protocol: "TCP"
      serviceAccount: "kubernetes-quickstart"

提供されたレプリカ <1>、ラベル <2>、環境変数 <3> はそのまま引き継がれました。ただし、イメージ <4> とコンテナーポート <5> は変更されました。また、デフォルトのアノテーションが追加されました。

  • リソース名がアプリケーション名 (またはオーバーライドされた名前) と一致しない場合、リソースを再利用するのではなく、新しいものが追加されます。これは、コンテナーについても当てはまります。

  • コンテナー名がアプリケーション名 (またはオーバーライドされた名前) と一致しない場合、コンテナー固有の設定は無視されます。

サービスバインディング

Quarkus supports the Service Binding Specification for Kubernetes to bind services to applications.

Specifically, Quarkus implements the Workload Projection part of the specification, therefore allowing applications to bind to services, such as a Database or a Broker, without the need for user configuration.

サポートされるエクステンションの Service Binding を有効にするには、quarkus-kubernetes-service-binding エクステンションをアプリケーションの依存関係に追加します。

  • Service Binding では、以下のエクステンションを使用でき、Workload Projection に対応しています。

    • quarkus-jdbc-mariadb

    • quarkus-jdbc-mssql

    • quarkus-jdbc-mysql

    • quarkus-jdbc-postgresql

    • quarkus-mongo-client

    • quarkus-kafka-client

    • quarkus-smallrye-reactive-messaging-kafka

Workload Projection

Workload Projection は、Kubernetes クラスターからのサービスの設定を取得するプロセスです。この設定は、特定の規約に従ったディレクトリー構造の形式をとり、アプリケーションまたはサービスにマウントされたボリュームとしてアタッチされます。kubernetes-service-binding エクステンションは、このディレクトリー構造を利用して設定ソースを作成し、これにより、データベースやメッセージブローカーなどの追加モジュールを設定することができます。

アプリケーションの開発中、ユーザーは Workload Projection を使用して、実際のアプリケーションコードや設定を変更することなく、開発用データベースやその他のローカルで実行されるサービスにアプリケーションを接続することができます。

ディレクトリー構造をテストリソースに含めて統合テストに渡すワークロードの投影の例については、Kubernetes Service Binding datasource GitHub リポジトリーを参照してください。

  • k8s-sb ディレクトリーは、すべてのサービスバインディングの root です。この例では、fruit-db と呼ばれる 1 つのデータベースのみをバインドすることを意図しています。このバインディングデータベースには、データベースタイプとして postgresql を示す type ファイルがあり、ディレクトリー内の他のファイルは、接続を確立するために必要な情報を提供します。

  • Quarkus プロジェクトが、OpenShift によって設定された SERVICE_BINDING_ROOT 環境変数から情報を取得した後、ファイルシステム内に存在する生成された設定ファイルを探し出し、設定ファイルの値を特定のエクステンションのプロパティーにマッピングするために使用することができます。

Service Binding Operator の紹介

The Service Binding Operator is an Operator that implements Service Binding Specification for Kubernetes and is meant to simplify the binding of services to an application. Containerized applications that support Workload Projection obtain service binding information in the form of volume mounts. The Service Binding Operator reads binding service information and mounts it to the application containers that need it.

アプリケーションとバインドされたサービスの相関は ServiceBinding リソースによって表現され、これにより、どのサービスがどのアプリケーションにバインドされるかという意図が宣言されます。

Service Binding Operator は ServiceBinding リソースを監視し、どのアプリケーションがどのサービスとバインドされるべきかを Operator に知らせます。リストされたアプリケーションがデプロイされると、Service Binding Operator はアプリケーションに渡さなければならないすべてのバインディング情報を収集し、バインディング情報でボリュームマウントをアタッチしてアプリケーションコンテナーをアップグレードします。

Service Binding Operator は、以下の操作を実施します。

  • 特定のサービスにバインドされることを意図したワークロードの ServiceBinding リソースを観察する

  • ボリュームマウントを使用して、ワークロードにバインド情報を適用する

次の章では、自動および半自動のサービスバインディングのアプローチとそのユースケースについて説明します。どちらのアプローチでも、kubernetes-service-binding エクステンションは、ServiceBinding リソースを生成します。半自動アプローチでは、ユーザーはターゲットサービスの設定を手動で提供する必要があります。自動アプローチでは、ServiceBinding リソースを生成する限定されたサービスセットの場合、追加の設定は必要ありません。

半自動のサービスバインディング

サービスバインディングのプロセスは、あるアプリケーションにバインドされる必要なサービスをユーザーが指定するところから始まります。この表現は、kubernetes-service-binding エクステンションによって生成される ServiceBinding リソースに要約されています。kubernetes-service-binding エクステンションを使用することで、ユーザーは最小限の設定で ServiceBinding リソースを生成できるため、プロセス全体が簡素化されます。

バインディングプロセスを担当するService Binding Operator は、ServiceBinding リソースから情報を読み取り、それに応じて必要なファイルをコンテナーにマウントします。

  • 以下は、ServiceBinding リソースの例です。

    apiVersion: binding.operators.coreos.com/v1beta1
    kind: ServiceBinding
    metadata:
     name: binding-request
     namespace: service-binding-demo
    spec:
     application:
       name: java-app
       group: apps
       version: v1
       resource: deployments
     services:
     - group: postgres-operator.crunchydata.com
       version: v1beta1
       kind: Database
       name: db-demo
       id: postgresDB
    • quarkus-kubernetes-service-binding エクステンションは、同じ情報をよりコンパクトに表現する方法を提供します。以下に例を示します。

      quarkus.kubernetes-service-binding.services.db-demo.api-version=postgres-operator.crunchydata.com/v1beta1
      quarkus.kubernetes-service-binding.services.db-demo.kind=Database

先ほどの設定プロパティーを application.properties 内に追加すると、quarkus-kubernetes は、quarkus-kbernetes-service-binding エクステンションとの組み合わせにより、自動的に ServiceBinding リソースを生成します。

先に述べた db-demo property-configuration 識別子は、2 つのロールを持つようになり、以下の動作も完了します。

  • api-versionkind のプロパティーを相互に関連付け、グループ化する

  • 後で編集できるように、カスタムリソースの name プロパティーを定義します。以下に例を示します。

    quarkus.kubernetes-service-binding.services.db-demo.api-version=postgres-operator.crunchydata.com/v1beta1
    quarkus.kubernetes-service-binding.services.db-demo.kind=Database
    quarkus.kubernetes-service-binding.services.db-demo.name=my-db
その他のリソース

自動サービスバインディング

quarkus-kubernetes-service-binding エクステンションは、アプリケーションが利用可能でバインド可能な Operator によって提供される外部サービスへのアクセスを必要とすることを検出した後、自動的に ServiceBinding リソースを生成することができます。

自動サービスバインディングは、限られた数のサービスタイプに対して生成することができます。Kubernetes および Quarkus のサービスに関する確立された用語と一致させるために、この章ではこれらのサービスタイプを kind と呼びます。
Table 2. サービス auto-binding をサポートするオペレーター

オペレーター

API バージョン

Kind

postgresql

CrunchyData Postgres

postgres-operator.crunchydata.com/v1beta1

PostgresCluster

mysql

Percona XtraDB Cluster

pxc.percona.com/v1-9-0

PerconaXtraDBCluster

mongo

Percona Mongo

psmdb.percona.com/v1-9-0

PerconaServerMongoDB

自動データソースバインディング

従来のデータベースの場合、データソースが以下のように設定されるたびに自動バインディングが開始されます。

quarkus.datasource.db-kind=postgresql

The previous configuration, combined with the presence of quarkus-datasource, quarkus-jdbc-postgresql, quarkus-kubernetes, and quarkus-kubernetes-service-binding properties in the application, results in the generation of the ServiceBinding resource for the postgresql database type.

使用された postgresql` Operator と一致する Operator リソースの apiVersion プロパティーと kind プロパティーを使用することにより、生成された ServiceBinding リソースは、サービスまたはリソースをアプリケーションにバインドします。

データベースサービスの名前を指定しない場合、db-kind プロパティーの値がデフォルトの名前として使用されます。

 services:
 - apiVersion: postgres-operator.crunchydata.com/v1beta1
   kind: PostgresCluster
   name: postgresql

データソースの名前を以下のように指定しました。

quarkus.datasource.fruits-db.db-kind=postgresql

生成された ServiceBinding 内の service は、以下のように表示されます。

 services:
 - apiVersion: postgres-operator.crunchydata.com/v1beta1
   kind: PostgresCluster
   name: fruits-db

同様に、mysql を使う場合は、データソース名を以下のように指定することができます。

quarkus.datasource.fruits-db.db-kind=mysql

生成された service には、以下の内容が含まれます。

 services:
 - apiVersion: pxc.percona.com/v1-9-0
   kind: PerconaXtraDBCluster
   name: fruits-db

自動サービスバインディングのカスタマイズ

自動バインディングは手動での設定をできるだけ排除するために開発されましたが、生成された ServiceBinding リソースを修正しなければならない場合もあります。生成プロセスはアプリケーションから抽出された情報とサポートされる Operator のナレッジにのみ依存しており、これはクラスターにデプロイされているものを反映していない可能性があります。生成されるリソースは、一般的なサービス kind のサポートされているバインディング可能な Operator のナレッジと、以下のようなミスマッチの可能性を防ぐために開発された一連の規約にのみ基づいています。

  • ターゲットリソース名がデータソース名と一致しない

  • そのサービスの kind のデフォルトの Operator ではなく、特定の Operator を使用する必要がある

  • ユーザーがデフォルトまたは最新以外のバージョンを使用する必要がある場合に発生するバージョンの競合

規約
  • 対象リソース座標は、Operator のタイプとサービスの kind に応じて決定されます。

  • ターゲットリソース名は、デフォルトでは postgresqlmysqlmongo などのサービスの kind に一致するように設定されます。

  • 名前付きデータソースの場合、データソースの名前が使用されます。

  • 名前付き mongo クライアントの場合、クライアントの名前が使われます。

例 1 - 名前の不一致

生成された ServiceBinding を修正して名前の不一致を修正する必要がある場合は、quarkus.kubernetes-service-binding.services プロパティーを使用して、サービスの名前をサービスキーとして指定します。

service key は通常、データソースの名前や mongo クライアントの名前など、サービスの名前です。この値がない場合は、postgresqlmysqlmongo などのデータソースのタイプが代わりに使用されます。

異なるタイプのサービス間での名前の競合を避けるために、service key の前に postgresql-<person>` のような特定のデータソースのタイプを付けます。

次の例は、PostgresCluster リソースの apiVersion プロパティーをカスタマイズする方法を示しています。

quarkus.datasource.db-kind=postgresql
quarkus.kubernetes-service-binding.services.postgresql.api-version=postgres-operator.crunchydata.com/v1beta2
例 2: データソースのカスタム名のアプリケーション

例 1 では、db-kind(postgresql) がサービスキーとして使用されました。この例では、規約に従ってデータソースに名前がついているので、データソース名 (fruits-db) が代わりに使用されます。

次の例は、名前付きデータソースの場合、データソース名がターゲットリソースの名前として使用されることを示しています。

quarkus.datasource.fruits-db.db-kind=postgresql

これは、以下の設定と同じ効果があります。

quarkus.kubernetes-service-binding.services.fruits-db.api-version=postgres-operator.crunchydata.com/v1beta1
quarkus.kubernetes-service-binding.services.fruits-db.kind=PostgresCluster
quarkus.kubernetes-service-binding.services.fruits-db.name=fruits-db
その他のリソース
  • For more details about the available properties and how do they work, see the Workload Projection part of the Service Binding specification.