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.
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.
2. Now it's time to create the actual agent. In your GitLab project, go to `> Infrastructure > 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.
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.
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.
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.