NOTE: This will setup credentials across ALL namespaces!
Parameters
The following parameters are driven via Environment variables.
Environment Variables:
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY: Credentials to access AWS.
awsaccount: Comma separated list of AWS Account Ids.
awsregion: (optional) Can override the default AWS region by setting this variable.
aws-assume-role (optional) can provide a role ARN that will be assumed for getting ECR authorization tokens
Note: The region can also be specified as an arg to the binary.
TOKEN_RETRY_TYPE: The type of Timer to use when getting a registry token fails and must be retried; "simple" or "exponential" (default: simple)
TOKEN_RETRIES: The number of times to retry getting a registry token if an error occurred (default: 3)
TOKEN_RETRY_DELAY: The number of seconds to delay between successive retries at getting a registry token; applies to "simple" retry timer only (default: 5)
GCRURL: URL to Google Container Registry
DOCKER_PRIVATE_REGISTRY_SERVER, DOCKER_PRIVATE_REGISTRY_USER, DOCKER_PRIVATE_REGISTRY_PASSWORD: the URL, user name, and password for a Docker private registry
ACR_URL, ACR_CLIENT_ID, ACR_PASSWORD: the registry URL, client ID, and password to access to access an Azure Container Registry.
How to setup running in AWS
Clone the repo and navigate to directory
Configure
If running on AWS EC2, make sure your EC2 instances have the following IAM permissions:
If you are not running in AWS Cloud, then you can still use this tool! Edit & create the sample secret and update values for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, aws-account, and aws-region (base64 encoded).
NOTE: If running on premise, no need to provide AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY since that will come from the EC2 instance.
Use awsecr-cred for name of imagePullSecrets on your deployment.yaml file.
How to setup running in GCR
Clone the repo and navigate to directory
Input your application_default_credentials.json information into the secret.yaml template located here:
The value for application_default_credentials.json can be obtained with the following command:
Edit the sample secret and update values for DOCKER_PRIVATE_REGISTRY_SERVER, DOCKER_PRIVATE_REGISTRY_USER, and DOCKER_PRIVATE_REGISTRY_PASSWORD (base64 encoded).
Edit the sample secret and update values for ACR_URL, ACR_CLIENT_ID, and ACR_PASSWORD (base64 encoded). Use service principal application ID as the client ID, and service principal password (client secret) as the password.