registry-creds

by kir4h.gh

Helm chartv1.3.0App 1.10Verified publisher

A Helm chart for registry creds

About this chart

registry-creds

  • Chart Details
  • Prerequisites
  • Adding helm repository
  • Installing the Chart
    • Using Docker Registry Provider
    • Using Elastic Container Registry
      • From AWS
      • Outside AWS
    • Using Google Container Registry
  • Uninstalling the Chart
  • Using existing secrets
    • Using an existing secret for Docker Private Registry
  • Configuration

Chart Details

This chart bootstraps a registry-creds deployment on a Kubernetes cluster

Prerequisites

  • Kubernetes 1.9+

Adding helm repository

In order to be able to install the chart you will have to add the repository where the chart is hosted

helm repo add kir4h https://kir4h.github.io/charts/

Installing the Chart

By default, all registry credential types are disabled by default but at least one needs to be configured (otherwise registry-creds will be up and running but useless)

Using Docker Registry Provider

helm install --name registry-creds --set dpr.enabled=true --set-string dpr.user="myUser" --set-string dpr.password="myPassword" \
--set-string dpr.server=myregistry:myport kir4h/registry-creds

Using Elastic Container Registry

From AWS

Ensure your EC2 instances have the appropriate permissions as described in registry-creds documentation.

helm install --name registry-creds --set ecr.enabled=true --set-string ecr.awsAccount="myAccount" \
--set-string ecr.awsRegion="myRegion" kir4h/registry-creds

Outside AWS

helm install --name registry-creds --set ecr.enabled=true --set-string ecr.awsAccessKeyId="myID" \
--set-string ecr.awsSecretAccessKey="mySecret" --set-string ecr.awsAccount="myAccount" --set-string ecr.awsRegion="myRegion" \
kir4h/registry-creds

Using Google Container Registry

Create a custom-values.yaml file:

gcr:
  enabled: false
  applicationDefaultCredentialsJson: |
  {
    "client_id": "myID",
    "client_secret": "mySecret",
    "refresh_token": "myRefreshToken",
    "type": "authorized_user"
  }"

Install the chart using this custom-values.yaml file:

helm install --name registry-creds --values custom-values.yaml kir4h/registry-creds

Uninstalling the Chart

helm delete registry-creds

Using existing secrets

In order to set the authentication for the private registry (dpr, ecr, gcr), existing secrets can be referenced instead of providing the required parameters for the registry provider. This can be useful in some scenarios (for instance for a GitOps approach where we don't want sensitive information to live in the repository)

Unlike other components, registry-creds is designed to be installed in kube-system namespace and therefore corresponding secrets need to be created in that namespace.

Using an existing secret for Docker Private Registry

Creating the secret:

kubectl create secret generic registry-creds-dpr -n kube-system \
--from-literal "DOCKER_PRIVATE_REGISTRY_SERVER=myServer" \
--from-literal "DOCKER_PRIVATE_REGISTRY_USER=myUser" \
--from-literal "DOCKER_PRIVATE_REGISTRY_PASSWORD=myPassword"

Installing the chart:

helm install --name registry-creds --set dpr.enabled=true --set-string dpr.existingSecretName="registry-creds-dpr" \
kir4h/registry-creds

Configuration

The following table lists the configurable parameters of this chart and their default values.

ParameterDescriptionDefault
replicaCountnumber of replicas1
image.namecontainer image repository"upmcenterprises/registry-creds"
image.tagcontainer image tag"1.9"
image.pullPolicycontainer image pull policy"IfNotPresent"
nameOverrideoverride name of app""
argscontainer args{}
extraEnvcontainer environment variables{}
fullnameOverrideoverride full name of app""
podLabelslabels to be added to pods{}
podAnnotationsannotations to be added to pods{}
dpr.enabledenable the injection of docker private registry credentialsfalse
dpr.existingSecretNamedefines an existing secret (in kube-system namespace) containing the credentials""
dpr.useruser for authenticating with docker private registry. Only applicable if dpr.existingSecretName is empty""
dpr.serverhostname/IP Address of the docker private registry. Only applicable if dpr.existingSecretName is empty""
dpr.passwordpassword for authentication with the selected docker private registry. Only applicable if dpr.existingSecretName is empty""
ecr.enabledenable the injection of elastic container registry credentials""
ecr.existingSecretNamedefines an existing secret (in kube-system namespace) containing the credentials""
ecr.awsAccessKeyIdID of the key used to access ECR. Not needed for machines within AWS. Only applicable if ecr.existingSecretName is empty""
ecr.awsSecretAccessKeysecret of the key used to access ECR. Not needed for machines within AWS. Only applicable if ecr.existingSecretName is empty""
ecr.awsAccountcomma separated list of AWS Account Ids. Only applicable if ecr.existingSecretName is empty""
ecr.awsRegionoptional AWS region to override the default. Only applicable if ecr.existingSecretName is empty""
ecr.awsAssumeRoleoptional role to be assumed by AWS and used to retrieve tokens. Only applicable if ecr.existingSecretName is empty""
gcr.enabledenables the injection of google container registry credentialsfalse
gcr.existingSecretNamedefines an existing secret (in kube-system namespace) containing the credentials""
gcr.applicationDefaultCredentialsJsonJSON representing google cloud credentials. Only applicable if gcr.existingSecretName is empty""
gcr.urlURL for google container registry. Only applicable if gcr.existingSecretName is empty"https://gcr.io"
acr.enabledenables the injection of azure container registry credentialsfalse
acr.existingSecretNamedefines an existing secret (in kube-system namespace) containing the credentials""
acr.urldefines the url of azure container registry. Only applicable if acr.existingSecretName is empty""
acr.clientIdis the client id used to access azure container registry. Only applicable if acr.existingSecretName is empty""
acr.passwordis the client password used to access azure container registry. Only applicable if acr.existingSecretName is empty""
rbac.enabledenables the usage of RBAC for registry-creds (needed for clusters with RBAC enabled)true
rbac.existingServiceAccountNamename of an existing service account to be used for RBAC permissions. If not defined a new service account will be created by the chart""
resources.limits.memorymemory resource limit"100Mi"
resources.limits.cpucpui resource limit"200m"
resources.requests.memorymemory resource request"50Mi"
resources.requests.cpucpu resource request"40m"
tolerationsList of node taints to tolerate[]
nodeSelectorNode labels for pod assignment{}
affinityNode affinity{}

Deploy registry-creds with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has registry-creds on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartregistry-creds is pinned at v1.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply