api/7_configure/kubernetes/kubernetes_agent_spec.rb | Configure Kubernetes Agent deploys a K8s manifest file
Full description
Configure Kubernetes Agent deploys a K8s manifest file
GitLab recently introduced a new service to its infrastructure. The GitLab Kubernetes Agent. This service has two components:
- GitLab Kubernetes Agent Server (
gitlab-kas
), installed alongside with GitLab (Omnibus or Chart) - GitLab Kubernetes Agent Server Agent (
agentk
), installed in the user's Kubernetes cluster
The main idea is that the user is able to use GitLab as a GitOps tool. The user will create a so called "manifest project", wherein, K8s manifests will be provided. Every time this manifest files change gitlab-kas
will send the contents of these files to agentk
, which will then apply this resources to K8s.
The feature works and will be tested like the following:
-
gitlab-kas
will be already installed together with GitLab via GitLab chart or Omnibus (might not be enabled by default). - The user creates a "manifest configuration project" with k8s resources via API.
- The user creates a "agent configuration project". This project contains a file that specifies which projects
agentk
should be interested in managing via API. - The user uses the GitLab GraphQL API to create a
Clusters::Agent
, which will be associated to the "agent configuration project", and also an associatedClusters::AgentToken
(token
) on the database. -
agentk
is installed in any Kubernetes server configured by the user informingagentk
of thetoken
created above. Thistoken
is what allowsgitlab-kas
to trust the communication withagentk
. In the test it's done via K3s. - We then verify programmatically that
agentk
sent a request togitlab-kas
asking to sync the "manifest project" files.
File path
./qa/specs/features/ee/api/7_configure/kubernetes/kubernetes_agent_spec.rb
Edited by João Alexandre Cunha