All Projects → titansoft-pte-ltd → imagepullsecret-patcher

titansoft-pte-ltd / imagepullsecret-patcher

Licence: MIT License
A simple Kubernetes client-go application that creates and patches imagePullSecrets to service accounts in all Kubernetes namespaces to allow cluster-wide authenticated access to private container registry.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to imagepullsecret-patcher

OpenRegistry
OpenRegistry - A decentralised container registry fully compliant with OCI Distribution Specification
Stars: ✭ 33 (-79.25%)
Mutual labels:  container, container-registry
Huddy
Huddy = Hugo + Caddy docker container
Stars: ✭ 14 (-91.19%)
Mutual labels:  container
fengming
No description or website provided.
Stars: ✭ 14 (-91.19%)
Mutual labels:  container
inspr
Inspr is an agnostic application mesh for simpler, faster, and securer development of distributed applications (dApps).
Stars: ✭ 49 (-69.18%)
Mutual labels:  container
docker
🐳 Official Docker image of the SinusBot for TeamSpeak 3 and Discord.
Stars: ✭ 50 (-68.55%)
Mutual labels:  container
httptest
A simple concurrent HTTP testing tool
Stars: ✭ 42 (-73.58%)
Mutual labels:  container
edge-home-orchestration-go
Home Edge Project in LF Edge - Edge Orchestration for home edge devices to enabling smart home use cases.
Stars: ✭ 68 (-57.23%)
Mutual labels:  container
docker-postgres-windows
No description or website provided.
Stars: ✭ 19 (-88.05%)
Mutual labels:  container
nixery
Container registry which transparently builds images using the Nix package manager. Canonical repository is https://cs.tvl.fyi/depot/-/tree/tools/nixery
Stars: ✭ 1,365 (+758.49%)
Mutual labels:  container-registry
docker-rsyslog
Rsyslog server with multiple input listeners (UDP/TCP/RELP) and outputs (file/kafka/syslog).
Stars: ✭ 18 (-88.68%)
Mutual labels:  container
EvDev
Full-Featured Dockerized Development Environment
Stars: ✭ 21 (-86.79%)
Mutual labels:  container
container-amiga-gcc
Containerfile for AmigaOS Cross-Compiler Toolchain
Stars: ✭ 51 (-67.92%)
Mutual labels:  container
singularityhub.github.io
Container tools for scientific computing! Docs at https://singularityhub.github.io/singularityhub-docs
Stars: ✭ 68 (-57.23%)
Mutual labels:  container
kube-notary
A Kubernetes watchdog for verifying image trust with Codenotary (www.codenotary.com)
Stars: ✭ 55 (-65.41%)
Mutual labels:  container
docker-garby
Just another Docker maintenance script, managing garbage collection of Docker containers and images.
Stars: ✭ 36 (-77.36%)
Mutual labels:  container
elixir-ms
an elixir microservice base/skeleton 💀
Stars: ✭ 39 (-75.47%)
Mutual labels:  container
HerokuContainer
Dockerized ASP.NET Core Web API app in Heroku
Stars: ✭ 26 (-83.65%)
Mutual labels:  container
fastfreeze
Turn-key solution to checkpoint/restore applications running in Linux containers
Stars: ✭ 68 (-57.23%)
Mutual labels:  container
coreos-gpu-installer
Scripts to build and use a container to install GPU drivers on CoreOS Container Linux
Stars: ✭ 21 (-86.79%)
Mutual labels:  container
update-container-description-action
github action to update a Docker Hub, Quay or Harbor repository description from a README file
Stars: ✭ 20 (-87.42%)
Mutual labels:  container-registry

imagepullsecret-patcher

Build Status Go Report Card Codecov GitHub tag (latest SemVer) GitHub issues

A simple Kubernetes client-go application that creates and patches imagePullSecrets to service accounts in all Kubernetes namespaces to allow cluster-wide authenticated access to private container registry.

screenshot

A blog post: https://medium.com/titansoft-engineering/kubernetes-cluster-wide-access-to-private-container-registry-with-imagepullsecret-patcher-b8b8fb79f7e5

Installation and configuration

To install imagepullsecret-patcher, can refer to deploy-example as a quick-start.

Below is a table of available configurations:

Config name ENV Command flag Default value Description
force CONFIG_FORCE -force true overwrite secrets when not match
debug CONFIG_DEBUG -debug false show DEBUG logs
managedonly CONFIG_MANAGEDONLY -managedonly false only modify secrets which were created by imagepullsecret
runonce CONFIG_RUNONCE -runonce false run the update loop once, allowing for cronjob scheduling if desired
serviceaccounts CONFIG_SERVICEACCOUNTS -serviceaccounts "default" comma-separated list of serviceaccounts to patch
all service account CONFIG_ALLSERVICEACCOUNT -allserviceaccount false if true, list and patch all service accounts and the -servicesaccounts argument is ignored
dockerconfigjson CONFIG_DOCKERCONFIGJSON -dockerconfigjson "" json credential for authenicating container registry
dockerconfigjsonpath CONFIG_DOCKERCONFIGJSONPATH -dockerconfigjsonpath "" path for of mounted json credentials for dynamic secret management
secret name CONFIG_SECRETNAME -secretname "image-pull-secret" name of managed secrets
excluded namespaces CONFIG_EXCLUDED_NAMESPACES -excluded-namespaces "" comma-separated namespaces excluded from processing
loop duration CONFIG_LOOP_DURATION -loop-duration 10 seconds duration string which defines how often namespaces are checked, see https://golang.org/pkg/time/#ParseDuration for more examples

And here are the annotations available:

Annotation Object Description
k8s.titansoft.com/imagepullsecret-patcher-exclude namespace If a namespace is set this annotation with "true", it will be excluded from processing by imagepullsecret-patcher.

Providing credentials

You can provide the authentication credentials for imagepullsecret to populate across namespaces in a couple of ways.

You can provide a raw secret as an environment variable, or better yet, by mounting a volume into the container. Mounted secrets can be dynamically updated and are more secure. Please see the relevant docs for more information https://kubernetes.io/docs/concepts/configuration/secret/

Why

To deploy private images to Kubernetes, we need to provide the credential to the private docker registries in either

With the second approach, a Kubernetes cluster admin configures the default service accounts in each namespace, and a Pod deployed by developers automatically inherits the image-pull-secret from the default service account in Pod's namespace.

This is done manually by following command for each Kubernetes namespace.

kubectl create secret docker-registry image-pull-secret \
  -n <your-namespace> \
  --docker-server=<your-registry-server> \
  --docker-username=<your-name> \
  --docker-password=<your-pword> \
  --docker-email=<your-email>

kubectl patch serviceaccount default \
  -p "{\"imagePullSecrets\": [{\"name\": \"image-pull-secret\"}]}" \
  -n <your-namespace>

And it could be automated with a simple program like imagepullsecret-patcher.

Contribute

Development Environment

  • Go 1.13
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].