Add Container Images for Kubernetes Deployments
To add container images to Harness for your Kubernetes deployments, you add a Harness Artifact Server. The Artifact Server uses your container registry account to connect to your container registry (Docker registry, AWS ECR, Google GCR, Azure Container Registry, etc).
Once you have the Artifact Server set up, you add the container image artifact using a Harness Service Artifact Source.
In this topic:
- Before You Begin
- Step 1: Add the Artifact Server
- Step 2: Create the Harness Kubernetes Service
- Step 3: Add the Artifact Source
- Next Steps
Before You Begin
Ensure you have reviewed and set up the following:
- Connect to Your Target Kubernetes Platform. You must have a Harness Kubernetes Delegate running in your target Kubernetes cluster.
- Kubernetes Deployments Overview
Step 1: Add the Artifact Server
Harness supports all of the popular container registries. You add your container registry account as a Harness Artifact Server.
For steps on setting up each container registry, see Add Artifact Servers.
In the following step, we use the Docker Registry Artifact Server.
Step 2: Create the Harness Kubernetes Service
- In Harness, click Setup, and then click Add Application.
- Enter a name for the Application and click Submit.
- Click Services, and then click Add Service. The Add Service settings appear.
- In Name, enter a name for the Service.
- In Deployment Type, select Kubernetes, and then ensure Enable Kubernetes V2 is selected.
- Click Submit. The new Harness Kubernetes Service is created.
Step 3: Add the Artifact Source
To demonstrate how to add the Artifact Source, we use a Docker Registry Artifact Server.
For the settings for all Artifact Sources, see Add Artifact Servers.
- In the Harness Kubernetes Service, click Add Artifact Source, and select Docker Registry. The Docker Registry settings appear. Enter the following settings:
- In Name, let Harness generate a name for the source or enter a custom name.
- In Source Server, select the Artifact Server. In this example, we are using a Docker Registry with a connection to Docker Hub.
- In Docker Image Name, enter the image name. Official images in public repos such as Docker Hub need the label library. For example, library/nginx.
- Click SUBMIT. The Artifact Source is added.
Recommended — View the build history for the artifact by clicking Artifact History, and then using Manually Pull Artifact to pull the artifact.
In addition to artifact sources taken from Artifact Servers, you can use a Shell Script to query a custom artifact repository. See Custom Artifact Source.