doc/user/clusters/agent/_index.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
You can connect your Kubernetes cluster with GitLab to deploy, manage, and monitor your cloud-native solutions.
To connect a Kubernetes cluster to GitLab, you must first install an agent in your cluster.
The agent runs in the cluster, and you can use it to:
For more details about the agent's purpose and architecture, see the architecture documentation.
You must deploy a separate agent to every cluster you want to connect to GitLab. The agent was designed with strong multi-tenancy support. To simplify maintenance and operations you should run only one agent per cluster.
An agent is always registered in a GitLab project. After an agent is registered and installed, the agent connection to the cluster can be shared with other projects, groups, and users. This approach means you can manage and configure your agent instances from GitLab itself, and you can scale a single installation to multiple tenants.
GitLab supports the following Kubernetes versions. If you want to run GitLab in a Kubernetes cluster, you might need a different version of Kubernetes:
You can upgrade your Kubernetes version to a supported version at any time:
GitLab aims to support a new minor Kubernetes version three months after its initial release. GitLab supports at least three production-ready Kubernetes minor versions at any given time.
When a new version of Kubernetes is released:
When installing the agent, use a Helm version compatible with your Kubernetes version. Other versions of Helm might not work. For a list of compatible versions, see the Helm version support policy.
Support for deprecated APIs can be removed from the GitLab codebase when GitLab no longer supports the Kubernetes version that only supports the deprecated API.
Some GitLab features might work on versions not listed here. This epic tracks support for Kubernetes versions.
You can choose from two primary workflows. The GitOps workflow is recommended.
GitLab recommends using Flux for GitOps. To get started, see Tutorial: Set up Flux for GitOps.
In a CI/CD workflow, you configure GitLab CI/CD to use the Kubernetes API to query and update your cluster.
This workflow is considered push-based, because GitLab pushes requests from GitLab CI/CD to your cluster.
Use this workflow:
This workflow has a weaker security model. You should not use a CI/CD workflow for production deployments.
The agent opens a bidirectional channel to KAS for communication. This channel is used for all communication between the agent and KAS:
For detailed information about channel routing, see Routing KAS requests in the agent.
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Receptive agents allow GitLab to integrate with Kubernetes clusters that cannot establish a network connection to the GitLab instance, but can be connected to by GitLab. For example, this can occur when:
When this feature is enabled, GitLab connects to the agent with the provided URL. You can use agents and receptive agents simultaneously.
This glossary provides definitions for terms related to the GitLab Kubernetes integration.
| Term | Definition | Scope |
|---|---|---|
| GitLab agent for Kubernetes | The overall offering, including related features and the underlying components agentk and kas. | GitLab, Kubernetes, Flux |
agentk | The cluster-side component that maintains a secure connection to GitLab for Kubernetes management and deployment automation. | GitLab |
GitLab agent server for Kubernetes (kas) | The GitLab-side component of GitLab that handles operations and logic for the Kubernetes agent integration. Manages the connection and communication between GitLab and Kubernetes clusters. | GitLab |
| Pull-based deployment | A deployment method where Flux checks for changes in a Git repository and automatically applies these changes to the cluster. | GitLab, Kubernetes |
| Push-based deployment | A deployment method where updates are sent from GitLab CI/CD pipelines to the Kubernetes cluster. | GitLab |
| Flux | An open-source GitOps tool that integrates with the agent for pull-based deployments. | GitOps, Kubernetes |
| GitOps | A set of practices that involve using Git for version control and collaboration in the management and automation of cloud and Kubernetes resources. | DevOps, Kubernetes |
| Kubernetes namespace | A logical partition in a Kubernetes cluster that divides cluster resources between multiple users or environments. | Kubernetes |