Skip to content

Commit f2bc3ae

Browse files
author
Vaughn Dice
committed
ref(*): update docs and Makefile
as well as remove old/unused contrib/kubernetes dir
1 parent fe50d7a commit f2bc3ae

8 files changed

Lines changed: 7 additions & 153 deletions

File tree

Makefile

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Short name: Short name, following [a-zA-Z_], used all over the place.
22
# Some uses for short name:
33
# - Docker image name
4-
# - Kubernetes service, rc, pod, secret, volume names
4+
# - Kubernetes service, deployment, pod names
55
SHORT_NAME := registry
66

77
include includes.mk versioning.mk
@@ -25,11 +25,6 @@ ifeq ($(STORAGE_TYPE),)
2525
STORAGE_TYPE = fs
2626
endif
2727

28-
# Kubernetes-specific information for Secret, RC, Service, and Image.
29-
SECRET := contrib/kubernetes/manifests/${SHORT_NAME}-${STORAGE_TYPE}-secret.yaml
30-
RC := contrib/kubernetes/manifests/${SHORT_NAME}-rc.yaml
31-
SVC := contrib/kubernetes/manifests/${SHORT_NAME}-service.yaml
32-
3328
all:
3429
@echo "Use a Makefile to control top-level building of the project."
3530

@@ -43,38 +38,15 @@ docker-build: check-docker build
4338
docker build --rm -t ${IMAGE} rootfs
4439
docker tag ${IMAGE} ${MUTABLE_IMAGE}
4540

46-
# Push to a registry that Kubernetes can access.
47-
docker-push: check-docker
48-
docker push ${IMAGE}
49-
5041
build-binary:
5142
${DEV_ENV_CMD} go build -ldflags ${LDFLAGS} -o $(BINDIR)/${SHORT_NAME} main.go
5243
$(call check-static-binary,$(BINDIR)/${SHORT_NAME})
5344
${DEV_ENV_CMD} upx -9 --brute $(BINDIR)/${SHORT_NAME}
5445

55-
# Deploy is a Kubernetes-oriented target
56-
deploy: kube-secret kube-service kube-rc
57-
58-
kube-secret: check-kubectl
59-
kubectl create -f ${SECRET}
60-
61-
# Some things, like services, have to be deployed before pods. This is an
62-
# example target. Others could perhaps include kube-volume, etc.
63-
kube-service: check-kubectl
64-
kubectl create -f ${SVC}
65-
66-
# When possible, we deploy with RCs.
67-
kube-rc: check-kubectl
68-
kubectl create -f ${RC}
69-
70-
kube-clean: check-kubectl
71-
kubectl delete rc ${SHORT_NAME}
72-
7346
test: check-docker
7447
contrib/ci/test.sh ${IMAGE}
7548

76-
update-manifests:
77-
sed 's#\(image:\) .*#\1 $(IMAGE)#' contrib/kubernetes/manifests/${SHORT_NAME}-rc.yaml \
78-
> ${RC}
49+
deploy: check-kubectl docker-build docker-push
50+
kubectl --namespace=deis patch deployment deis-$(SHORT_NAME) --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}]'
7951

80-
.PHONY: all build kube-up kube-down deploy
52+
.PHONY: all build build-binary docker-build test deploy

README.md

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The registry is a [Docker registry](https://docs.docker.com/registry/) component
1717

1818
If you decide to use this component standalone, you can host your own Docker registry in your own Kubernetes cluster.
1919

20-
The Docker image that this repository builds is based on [Alpine Linux](http://www.alpinelinux.org/) and uses [the Deis fork](https://github.com/deis/distribution) of [the official Docker v2 registry code](https://github.com/docker/distribution).
20+
The Docker image that this repository builds is based on [the official Docker v2 registry image](https://github.com/docker/distribution).
2121

2222
# Development
2323

@@ -53,52 +53,12 @@ To build and push the image run:
5353
$ make docker-build docker-push
5454
```
5555

56-
Before deploying your custom image you must update the container image specification in the pod manifest. This file is found at `contrib/kubernetes/manifests/registry-rc.yaml`:
56+
To deploy the image via patching the registry deployment run:
5757

58-
```yaml
59-
- name: registry
60-
image: quay.io/youruser/registry:git-f5c7dc3
61-
env:
62-
- name: REGISTRY_STORAGE_DELETE_ENABLED
63-
value: "true"
64-
```
65-
66-
By default registry uses the filesystem as the storage medium. To use a custom object store like s3, gcs or azure:
67-
- First provide the details required for authenticating to object store in base64 format by updating the secret file which can be found at `contrib/kubernetes/manifests/registry-{STORAGE_TYPE}-secret.yaml`.
68-
- Update the storage type and secret to be used in the pod manifest. This file is found at `contrib/kubernetes/manifests/registry-rc.yaml`:
69-
```yaml
70-
- name: REGISTRY_STORAGE
71-
value: filesystem
72-
73-
- name: registry-creds
74-
secret:
75-
secretName: fs-keyfile
76-
```
77-
- Set the STORAGE_TYPE environment variable.
78-
```
79-
$ export STORAGE_TYPE = {s3/gcs/azure}
80-
```
81-
82-
Once updated, deploy the registry to your kubernetes cluster with:
83-
84-
```
58+
```console
8559
$ make deploy
8660
```
8761

88-
After a while, you should see one pod up with one running:
89-
90-
```
91-
NAME READY STATUS RESTARTS AGE
92-
registry-6wy8o 1/1 Running 0 32s
93-
```
94-
95-
You can then interact with this pod as you would with any other Kubernetes pod:
96-
97-
```
98-
$ kubectl logs -f registry-6wy8o
99-
$ kubectl exec -it registry-6wy8o sh
100-
```
101-
10262
## License
10363

10464
© 2014, 2015, 2016 Engine Yard, Inc.

contrib/kubernetes/manifests/registry-azure-secret.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

contrib/kubernetes/manifests/registry-fs-secret.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

contrib/kubernetes/manifests/registry-gcs-secret.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

contrib/kubernetes/manifests/registry-rc.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

contrib/kubernetes/manifests/registry-s3-secret.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

contrib/kubernetes/manifests/registry-service.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)