ingress-nginx-helm/docs/examples/docker-registry/README.md

54 lines
2.1 KiB
Markdown
Raw Normal View History

2017-11-17 23:33:41 +00:00
# Docker registry
Minor documentation cleanup (#7826) * clarify link * Add section headers * console blocks * grpc example json was not valid * multi-tls update text The preceding point 1 related to https://github.com/kubernetes-retired/contrib/blob/4f2cb51ef82b4dddb625f6053ad132c1faf07aa1/ingress/controllers/nginx/examples/ingress.yaml and the deployments referenced in https://github.com/kubernetes-retired/contrib/blob/4f2cb51ef82b4dddb625f6053ad132c1faf07aa1/ingress/controllers/nginx/examples/README.md They are not relevant to the current instructions. * add whitespace around parens * grammar setup would be a proper noun, but it is not the intended concept, which is a state * grammar * is-only * via * Use bullets for choices * ingress-controller nginx is a distinct brand. generally this repo talks about ingress-controller, although it is quite inconsistent about how... * drop stray paren * OAuth is a brand and needs an article here also GitHub is a brand * Indent text under numbered lists * use e.g. * Document that customer header config maps changes do not trigger updates This should be removed if https://github.com/kubernetes/ingress-nginx/issues/5238 is fixed. * article * period * infinitive verb + period * clarify that the gRPC server is responsible for listening for TCP traffic and not some other part of the backend application * avoid using ; and reword * whitespace * brand: gRPC * only-does is the right form `for` adds nothing here * spelling: GitHub * punctuation `;` is generally not the right punctuation... * drop stray `to` * sentence * backticks * fix link * Improve readability of compare/vs * Renumber list * punctuation * Favor Ingress-NGINX and Ingress NGINX * Simplify custom header restart text * Undo typo damage Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-01-17 00:57:28 +00:00
This example demonstrates how to deploy a [docker registry](https://github.com/docker/distribution) in the cluster and configure Ingress to enable access from the Internet.
2017-11-17 23:33:41 +00:00
## Deployment
First we deploy the docker registry in the cluster:
```console
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/docker-registry/deployment.yaml
2017-11-17 23:33:41 +00:00
```
2018-04-29 06:17:29 +00:00
!!! Important
2018-08-30 18:24:56 +00:00
**DO NOT RUN THIS IN PRODUCTION**
2017-11-17 23:33:41 +00:00
2018-08-30 18:24:56 +00:00
This deployment uses `emptyDir` in the `volumeMount` which means the contents of the registry will be deleted when the pod dies.
2017-11-17 23:33:41 +00:00
The next required step is creation of the ingress rules. To do this we have two options: with and without TLS
### Without TLS
Download and edit the yaml deployment replacing `registry.<your domain>` with a valid DNS name pointing to the ingress controller:
```console
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/docker-registry/ingress-without-tls.yaml
2017-11-17 23:33:41 +00:00
```
2018-04-29 06:17:29 +00:00
!!! Important
2020-02-09 23:50:27 +00:00
Running a docker registry without TLS requires we configure our local docker daemon with the insecure registry flag.
2018-04-29 06:17:29 +00:00
2020-02-09 23:50:27 +00:00
Please check [deploy a plain http registry](https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry)
2017-11-17 23:33:41 +00:00
### With TLS
Download and edit the yaml deployment replacing `registry.<your domain>` with a valid DNS name pointing to the ingress controller:
```console
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/docker-registry/ingress-with-tls.yaml
2017-11-17 23:33:41 +00:00
```
Deploy [kube lego](https://github.com/jetstack/kube-lego) use [Let's Encrypt](https://letsencrypt.org/) certificates or edit the ingress rule to use a secret with an existing SSL certificate.
### Testing
2017-11-19 17:25:50 +00:00
To test the registry is working correctly we download a known image from [docker hub](https://hub.docker.com), create a tag pointing to the new registry and upload the image:
2017-11-17 23:33:41 +00:00
```console
docker pull ubuntu:16.04
docker tag ubuntu:16.04 `registry.<your domain>/ubuntu:16.04`
docker push `registry.<your domain>/ubuntu:16.04`
```
Please replace `registry.<your domain>` with your domain.