// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-kubernetes"]
= Kubernetes
:page-aliases: extensions/kubernetes.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-kubernetes
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Perform operations against Kubernetes API
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Perform operations against Kubernetes API

[id="extensions-kubernetes-whats-inside"]
== What's inside

* xref:{cq-camel-components}::kubernetes-config-maps-component.adoc[Kubernetes ConfigMap component], URI syntax: `kubernetes-config-maps:masterUrl`
* xref:{cq-camel-components}::kubernetes-cronjob-component.adoc[Kubernetes Cronjob component], URI syntax: `kubernetes-cronjob:masterUrl`
* xref:{cq-camel-components}::kubernetes-custom-resources-component.adoc[Kubernetes Custom Resources component], URI syntax: `kubernetes-custom-resources:masterUrl`
* xref:{cq-camel-components}::kubernetes-deployments-component.adoc[Kubernetes Deployments component], URI syntax: `kubernetes-deployments:masterUrl`
* xref:{cq-camel-components}::kubernetes-events-component.adoc[Kubernetes Event component], URI syntax: `kubernetes-events:masterUrl`
* xref:{cq-camel-components}::kubernetes-hpa-component.adoc[Kubernetes HPA component], URI syntax: `kubernetes-hpa:masterUrl`
* xref:{cq-camel-components}::kubernetes-job-component.adoc[Kubernetes Job component], URI syntax: `kubernetes-job:masterUrl`
* xref:{cq-camel-components}::kubernetes-namespaces-component.adoc[Kubernetes Namespaces component], URI syntax: `kubernetes-namespaces:masterUrl`
* xref:{cq-camel-components}::kubernetes-nodes-component.adoc[Kubernetes Nodes component], URI syntax: `kubernetes-nodes:masterUrl`
* xref:{cq-camel-components}::kubernetes-persistent-volumes-component.adoc[Kubernetes Persistent Volume component], URI syntax: `kubernetes-persistent-volumes:masterUrl`
* xref:{cq-camel-components}::kubernetes-persistent-volumes-claims-component.adoc[Kubernetes Persistent Volume Claim component], URI syntax: `kubernetes-persistent-volumes-claims:masterUrl`
* xref:{cq-camel-components}::kubernetes-pods-component.adoc[Kubernetes Pods component], URI syntax: `kubernetes-pods:masterUrl`
* xref:{cq-camel-components}::kubernetes-replication-controllers-component.adoc[Kubernetes Replication Controller component], URI syntax: `kubernetes-replication-controllers:masterUrl`
* xref:{cq-camel-components}::kubernetes-resources-quota-component.adoc[Kubernetes Resources Quota component], URI syntax: `kubernetes-resources-quota:masterUrl`
* xref:{cq-camel-components}::kubernetes-secrets-component.adoc[Kubernetes Secrets component], URI syntax: `kubernetes-secrets:masterUrl`
* xref:{cq-camel-components}::kubernetes-service-accounts-component.adoc[Kubernetes Service Account component], URI syntax: `kubernetes-service-accounts:masterUrl`
* xref:{cq-camel-components}::kubernetes-services-component.adoc[Kubernetes Services component], URI syntax: `kubernetes-services:masterUrl`
* xref:{cq-camel-components}::openshift-build-configs-component.adoc[OpenShift Build Config component], URI syntax: `openshift-build-configs:masterUrl`
* xref:{cq-camel-components}::openshift-builds-component.adoc[OpenShift Builds component], URI syntax: `openshift-builds:masterUrl`
* xref:{cq-camel-components}::openshift-deploymentconfigs-component.adoc[OpenShift Deployment Configs component], URI syntax: `openshift-deploymentconfigs:masterUrl`

Please refer to the above links for usage and configuration details.

[id="extensions-kubernetes-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-kubernetes[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-kubernetes</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-kubernetes-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

[id="extensions-kubernetes-configuration-automatic-registration-of-a-kubernetes-client-instance"]
=== Automatic registration of a Kubernetes Client instance

The extension automatically registers a Kubernetes Client bean named `kubernetesClient`. You can reference the bean in your routes like this:

[source,java]
----
from("direct:pods")
    .to("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPods")
----

Or you can omit referring to the client bean entirely and the Kubernetes component will automatically use the Kubernetes client that was autowired.

[source,java]
----
from("direct:pods")
    .to("kubernetes-pods:local?operation=listPods")
----

By default, the client is configured from the local kubeconfig file. You can customize the client configuration via properties within `application.properties`:

[source,properties]
----
quarkus.kubernetes-client.master-url=https://my.k8s.host
quarkus.kubernetes-client.namespace=my-namespace
----

The full set of configuration options are documented in the https://quarkus.io/guides/kubernetes-client#quarkus-kubernetes-client_configuration[Quarkus Kubernetes Client guide].

If you want to suppress this behavior, you can disable autowiring and all configuration will be driven from the documented component and endpoint options.

To disable autowiring at the component level, add the following configuration to `application.properties`.

[source,properties]
----
camel.component.kubernetes-pods.autowired-enabled=false
----

To disable autowiring at the endpoint level.

[source,java]
----
from("direct:pods")
    .to("kubernetes-pods:https://my.cluster.host?autowiredEnabled=false&operation=listPods")
----

[id="extensions-kubernetes-configuration-openshift-specific-components"]
=== OpenShift specific components

When using any of the OpenShift specific components:

* `openenshift-build-configs`
* `openenshift-builds`
* `openshift-deploymentconfigs`

You must add the following dependency to your application.

[source,xml]
----
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-openshift-client</artifactId>
</dependency>
----

[id="extensions-kubernetes-configuration-having-only-a-single-consumer-in-a-cluster-consuming-from-a-given-endpoint"]
=== Having only a single consumer in a cluster consuming from a given endpoint

This functionality is provided by the `camel-quarkus-kubernetes-cluster-service` extension.
Refer to the xref:reference/extensions/kubernetes-cluster-service.adoc[extension documentation] for more information.

