Coder Social home page Coder Social logo

docker-registry's Introduction

Task

The task is to write the Kubernetes deployment manifests to run Docker registry in Kubernetes with at least the following

  • deployment
  • service
  • persistent volume claim
  • garbage collect cron job
  • ingress
  • secret (if needed).

Make sure Docker registry uses Redis for cache and you run 2 replicas of Docker registry for redundancy.

Record any issues you encounter. You’re also welcome to list improvement ideas for the service that are outside the scope of this assignment.

Optional task:

Write a script that implements Docker registry retention.
There are containers with various tags pushed to the Docker registry which runs on premises, e.g. app/calculator:v1 , app/calculator:v2 , app/calculator:latest, app/calculator:v5, app/jmeter:v2 etc.
There is a need to go through all of the repositories in the registry and retain only the last X images. We might need to keep 10 images of the app/calculator and 5 images of app/jmeter - the retention job should be able to work with different retention settings.
Usual choice is a Jenkins pipeline written in Groovy but do not be limited by that, feel free to choose your own language and method to periodically run the retention job.

Docker Registry Helm Chart

This directory contains a Kubernetes chart to deploy a private Docker Registry.

Prerequisites Details

  • PV support on underlying infrastructure (if persistence is required)

Chart Details

This chart will do the following:

  • Implement a Docker registry deployment

Installing the Chart

To install the chart, use the following:

$ helm install --namespace default docker-registry ./docker-registry --values ./docker-registry/values.yaml

change namespace to your namespace

Configuration

The following table lists the configurable parameters of the docker-registry chart and their default values.

Parameter Description Default
image.pullPolicy Container pull policy IfNotPresent
image.repository Container image to use registry
image.tag Container image tag to deploy 2.8.1
imageRedis.pullPolicy Container pull policy IfNotPresent
imageRedis.repository Container image to use bitnami/redis
imageRedis.tag Container image tag to deploy 6.2
service.port TCP port on which the service is exposed 5000
replicaCount k8s replicas count 2
updateStrategy update strategy for deployment {}
podAnnotations Annotations for pod {}
resources.limits.cpu Container requested CPU nil
resources.limits.memory Container requested memory nil
resourcesRedis.limits.cpu Container requested CPU nil
resourcesRedis.limits.memory Container requested memory nil
secrets.htpasswd Htpasswd authentication nil
secrets.haSharedSecret Shared secret for Registry nil
secrets.redisPassword Redis password nil
configData Configuration file for docker registry nil
ingress.enabled If true, Ingress will be created false
ingress.annotations Ingress annotations {}
ingress.labels Ingress labels {}
ingress.path Ingress service path /
ingress.hosts Ingress hostnames []
extraEnvVars Additional environment variables to the pod []

Specify each parameter using the --set key=value[,key=value] argument to helm install.

To generate htpasswd file, run this docker command: docker run --entrypoint htpasswd registry:2 -Bbn user password > ./htpasswd.

docker-registry's People

Watchers

Igor Ivanov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.