Update How to use the Kubernetes Agent to connect your app to a cluster authored by Corina Patachia's avatar Corina Patachia
This page is meant to help with code and snippets to connect to a Kubernetes cluster using the K8 Agent. This connection doesn't use a tunnel.
\ No newline at end of file
**This page is meant to help with code and snippets to connect to a Kubernetes cluster using the K8 Agent. This connection doesn't use a tunnel. **
Before you get started :
- you need a Kubernetes cluster running and kubectl installed
Steps to reproduce :
1. Containerize your application with a Dockerfile. In the example we provide we start with a base alpine node image and set the working directory, install the packages we need and then copy everything in the container at line 15. The app is running at like 17. We have a react app so we added 2 arguments in the dockerfile, especially for js apps.
2. Now it's time to create the actual agent. In your GitLab project, go to >Infrastrcutre > Kubernetes Cluster and click on "Connect a cluster ( agent ) " button.
3. Create a new agent by typing in a unique name for the agent and clicking create.
4. !!! Important !!! After you create the Agent, GitLab shares a token and some helm commands to connect the agent to the cluster with the newly generated token. Please copy the commands in the popup before you close it.
5. connect to your Kubernetes cluster via the terminal and execute the helm commands with the agent token that you have copied at the previous step.
6.
\ No newline at end of file