You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A registry server with a repository capable of accepting and hosting OCI artifacts, such as Google
Artifact Registry, JFrog Artifactory, Harbor, Elastic Container Registry, and so on.
Either IaaS-specific trust for Kubernetes service accounts to access the registry, or a secret with
sufficient privileges to push and pull artifacts from that repository.
If you install Local Source Proxy on a Kubernetes cluster that a cloud provider manages
(such as EKS, AKS, or GKE), ensure that TCP port 5002 is open between control plane nodes and your
worker nodes.
The rest of this topic tells you how to obtain these prerequisites.
Using Tanzu CLI
: All registries except ECR can use the following code:
```yaml
---apiVersion: v1kind: Secretmetadata:name: lsp-push-credentialsnamespace: tap-installtype: kubernetes.io/dockerconfigjsonstringData:.dockerconfigjson: BASE64-ENCODED-DOCKER-CONFIG-JSON```The `dockerconfigjson` structure is as follows:```json{"auths":{"REGISTRY-SERVER":{"username":"USERNAME-VALUE","password": "PASSWORD-VALUE"}}}```If you're using the Tanzu Application Platform GitOps installer using Secrets OPerationS (SOPS),after using SOPS to encrypt the secret put the secret in the`clusters/CLUSTER-NAME/cluster-config/config/lsp`directory in your GitOps repository.If you're using the Tanzu Application Platform GitOps installer using ESO, create a secret asfollows:```json#@ load("@ytt:data", "data")#@ load("@ytt:json", "json")#@ def config():#@ return {#@ "auths": {#@ data.values.tap_value.{path-to-registry-host}: {#@ "username": data.values.tap_values.{path-to-registry-username},#@ "password": data.values.tap_values.{path-to-registry-password}#@ }#@ }#@ }#@ end---apiVersion: v1kind: Secretmetadata: name: lsp-push-credentials namespace: tap-installtype: kubernetes.io/dockerconfigjsonstringData: .dockerconfigjson: #@ json.encode(config())```
The procedure you use to obtain a secret with sufficient privileges depends on whether your registry
is Elastic Container Registry (ECR) or something else.
Using AWS
: If you're using Elastic Container Registry as your registry, you must create the container
repository ahead of time. Additionally you require an AWS Identity Access and Management (IAM) role
Amazon Resource Name (ARN) that possesses the necessary privileges to push and pull artifacts to
the ECR repository. This is limited in scope to the service account for Local Source Proxy.
Export the variables by running:
```console
export AWS_ACCOUNT_ID=012345678901 # Your AWS account ID
export AWS_REGION=us-west-2 # The AWS region you are going to deploy to
export EKS_CLUSTER_NAME=tap-on-aws # The name of your Elastic Kubernetes Service Cluster
```
Using a secret with pull privileges only
: You can use a secret with only pull privileges if you prefer to have a dedicated credential with a
least-privilege policy, specifically for downloading artifacts instead of reusing credentials with
higher privileges.
The secret containing this credential is distributed across developer namespaces by using the
Secretgen SecretExport resource. Namespace Provisioner automatically imports it to the developer
namespace. However, for development purposes, you can skip this step and use the same secret for
both pushing and pulling artifacts.