├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── charts
└── nsqd
│ ├── Chart.yaml
│ ├── templates
│ ├── nsqd-deployment.yaml
│ ├── nsqd-service-account.yaml
│ └── nsqd-svc.yaml
│ └── values.yaml
├── includes.mk
├── rootfs
├── Dockerfile
└── opt
│ └── nsq
│ └── bin
│ └── start-nsqd
└── versioning.mk
/.gitignore:
--------------------------------------------------------------------------------
1 | manifests/*.tmp.yaml
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | SHELL = /bin/bash
2 | include includes.mk
3 |
4 | DOCKER_HOST = $(shell echo $$DOCKER_HOST)
5 | BUILD_TAG ?= git-$(shell git rev-parse --short HEAD)
6 | SHORT_NAME ?= nsq
7 | DEPLOYMENT_NAME ?= nsqd
8 | DEIS_REGISTRY ?= ${DEV_REGISTRY}
9 | IMAGE_PREFIX ?= deis
10 |
11 | TEST_ENV_PREFIX := docker run --rm -v ${CURDIR}:/bash -w /bash quay.io/deis/shell-dev
12 | SHELL_SCRIPTS = $(wildcard rootfs/opt/nsq/bin/*)
13 |
14 | include versioning.mk
15 |
16 | build: docker-build
17 | push: docker-push
18 |
19 | docker-build:
20 | docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} rootfs
21 | docker tag ${IMAGE} ${MUTABLE_IMAGE}
22 |
23 | clean: check-docker
24 | docker rmi $(IMAGE)
25 |
26 | test: test-style
27 |
28 | test-style: check-docker
29 | ${TEST_ENV_PREFIX} shellcheck $(SHELL_SCRIPTS)
30 |
31 | deploy: check-kubectl docker-build docker-push
32 | kubectl --namespace=deis patch deployment deis-${DEPLOYMENT_NAME} \
33 | --type='json' \
34 | -p='[ \
35 | {"op": "replace", "path": "/spec/strategy", "value":{"type":"Recreate"}}, \
36 | {"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}, \
37 | {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value":"Always"} \
38 | ]'
39 |
40 | .PHONY: build push docker-build clean test test-style deploy
41 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | | | Deis Workflow is no longer maintained.
Please [read the announcement](https://deis.com/blog/2017/deis-workflow-final-release/) for more detail. |
3 | |---:|---|
4 | | 09/07/2017 | Deis Workflow [v2.18][] final release before entering maintenance mode |
5 | | 03/01/2018 | End of Workflow maintenance: critical patches no longer merged |
6 | | | [Hephy](https://github.com/teamhephy/workflow) is a fork of Workflow that is actively developed and accepts code contributions. |
7 |
8 | # Deis NSQ
9 | [](https://ci.deis.io/job/nsq)
10 |
11 | Deis (pronounced DAY-iss) Workflow is an open source Platform as a Service (PaaS) that adds a developer-friendly layer to any [Kubernetes](http://kubernetes.io) cluster, making it easy to deploy and manage applications on your own servers.
12 |
13 | 
14 |
15 | A NSQ image for running on a kubernetes cluster.
16 |
17 | ## Description
18 | NSQ is a high performance realtime distributed messaging platform. This image is for running `nsqd` on a kubernetes cluster. It provides no data persistence or the `nsqlookupd` service. Access to the queue is provided through a service ip.
19 |
20 | [v2.18]: https://github.com/deis/workflow/releases/tag/v2.18.0
21 |
--------------------------------------------------------------------------------
/charts/nsqd/Chart.yaml:
--------------------------------------------------------------------------------
1 | name: nsqd
2 | home: https://github.com/deis/nsq
3 | version:
4 | description: A kubernetes based docker image for running nsq daemon.
5 | maintainers:
6 | - name: Deis Team
7 | email: engineering@deis.com
8 |
--------------------------------------------------------------------------------
/charts/nsqd/templates/nsqd-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: extensions/v1beta1
2 | kind: Deployment
3 | metadata:
4 | name: deis-nsqd
5 | labels:
6 | heritage: deis
7 | annotations:
8 | component.deis.io/version: {{ .Values.docker_tag }}
9 | spec:
10 | replicas: 1
11 | strategy:
12 | type: Recreate
13 | selector:
14 | matchLabels:
15 | app: deis-nsqd
16 | template:
17 | metadata:
18 | labels:
19 | app: deis-nsqd
20 | spec:
21 | serviceAccount: deis-nsqd
22 | containers:
23 | - name: deis-nsqd
24 | image: quay.io/{{.Values.org}}/nsq:{{.Values.docker_tag}}
25 | imagePullPolicy: {{.Values.pull_policy}}
26 | {{- if or (.Values.limits_cpu) (.Values.limits_memory)}}
27 | resources:
28 | limits:
29 | {{- if (.Values.limits_cpu) }}
30 | cpu: {{.Values.limits_cpu}}
31 | {{- end}}
32 | {{- if (.Values.limits_memory) }}
33 | memory: {{.Values.limits_memory}}
34 | {{- end}}
35 | {{- end}}
36 | command:
37 | - /opt/nsq/bin/start-nsqd
38 | ports:
39 | - containerPort: 4151
40 | name: http
41 | protocol: TCP
42 | - containerPort: 4150
43 | name: transport
44 | protocol: TCP
45 | livenessProbe:
46 | httpGet:
47 | path: /ping
48 | port: 4151
49 | initialDelaySeconds: 5
50 | timeoutSeconds: 1
51 | readinessProbe:
52 | httpGet:
53 | path: /ping
54 | port: 4151
55 | initialDelaySeconds: 5
56 | timeoutSeconds: 1
57 | env:
58 | - name: POD_NAMESPACE
59 | valueFrom:
60 | fieldRef:
61 | fieldPath: metadata.namespace
62 |
--------------------------------------------------------------------------------
/charts/nsqd/templates/nsqd-service-account.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ServiceAccount
3 | metadata:
4 | name: deis-nsqd
5 | labels:
6 | heritage: deis
7 |
--------------------------------------------------------------------------------
/charts/nsqd/templates/nsqd-svc.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: deis-nsqd
5 | labels:
6 | heritage: deis
7 | app: deis-nsqd
8 | spec:
9 | ports:
10 | - port: 4151
11 | name: http
12 | targetPort: http
13 | - port: 4150
14 | name: transport
15 | targetPort: transport
16 | selector:
17 | app: deis-nsqd
18 |
--------------------------------------------------------------------------------
/charts/nsqd/values.yaml:
--------------------------------------------------------------------------------
1 | org: "deisci"
2 | pull_policy: "Always"
3 | docker_tag: "canary"
4 | # limits_cpu: "100m"
5 | # limits_memory: "50Mi"
6 |
--------------------------------------------------------------------------------
/includes.mk:
--------------------------------------------------------------------------------
1 | SHELL := /bin/bash
2 |
3 | check-docker:
4 | @if [ -z $$(which docker) ]; then \
5 | echo "Missing \`docker\` client which is required for development"; \
6 | exit 2; \
7 | fi
8 |
9 | check-kubectl:
10 | @if [ -z $$(which kubectl) ]; then \
11 | echo "Missing \`kubectl\` client which is required for development"; \
12 | exit 2; \
13 | fi
14 |
--------------------------------------------------------------------------------
/rootfs/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM quay.io/deis/base:v0.3.6
2 |
3 | RUN adduser --system \
4 | --shell /bin/bash \
5 | --disabled-password \
6 | --home /opt/nsq \
7 | --group \
8 | nsq \
9 | && curl -Ls https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > /usr/bin/jq \
10 | && chmod +x /usr/bin/jq \
11 | && curl -s https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.3.8.linux-amd64.go1.6.2.tar.gz | tar xz \
12 | && mv /nsq-0.3.8.linux-amd64.go1.6.2/bin/* /bin \
13 | && rm -r /nsq-0.3.8.linux-amd64.go1.6.2 \
14 | && mkdir /opt/nsq/data
15 |
16 | COPY . /
17 | RUN chown -R nsq:nsq /opt/nsq
18 | USER nsq
19 |
--------------------------------------------------------------------------------
/rootfs/opt/nsq/bin/start-nsqd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eo pipefail
3 |
4 | export MAX_READY_COUNT=${MAX_READY_COUNT:-10000}
5 | export DATA_PATH=${DATA_PATH:-/opt/nsq/data}
6 | exec nsqd -max-rdy-count "${MAX_READY_COUNT}" --data-path "${DATA_PATH}"
7 |
--------------------------------------------------------------------------------
/versioning.mk:
--------------------------------------------------------------------------------
1 | MUTABLE_VERSION ?= canary
2 | VERSION ?= git-$(shell git rev-parse --short HEAD)
3 |
4 | IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/${SHORT_NAME}:${VERSION}
5 | MUTABLE_IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION}
6 |
7 | info:
8 | @echo "Build tag: ${VERSION}"
9 | @echo "Registry: ${DEIS_REGISTRY}"
10 | @echo "Immutable tag: ${IMAGE}"
11 | @echo "Mutable tag: ${MUTABLE_IMAGE}"
12 |
13 | .PHONY: docker-push
14 | docker-push: docker-mutable-push docker-immutable-push
15 |
16 | .PHONY: docker-immutable-push
17 | docker-immutable-push:
18 | docker push ${IMAGE}
19 |
20 | .PHONY: docker-mutable-push
21 | docker-mutable-push:
22 | docker push ${MUTABLE_IMAGE}
23 |
--------------------------------------------------------------------------------