Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
single-server-binary (#557)
Browse files Browse the repository at this point in the history
Changes:
* All services are now executed from single binary, `dispatch-server`.
This allows easier management of middlewares, and also allows `dispatch-server local` to exist (added earlier).
* All images (but event-sidecar) have been merged into single image "dispatch-server".
* Configuration has been unified: no more `pkg/config`,
there is a single place that reads config file, flags and environment variables.
* Services now only listen on HTTP port 80, since TLS is terminated at Ingress
(But enabling it back will be easy).
* Charts have been adjusted, and most importantly, cleaned up from unused volumes
(e.g. API manager had volume with Docker socket mounted).
* Config files in charts are slimmed down and are using YAML instead of JSON for better readability.
* Application manager chart has been removed for now. We don't use it,
and it's been broken for some time now (e2e tests for application manager have been gone for couple releases).
* Some services have been "deglobalized" - the global flags are gone,
and those services that were using global variables have been converted to use
struct-level variables that are configured during initialization.
  • Loading branch information
kars7e authored Jul 10, 2018
1 parent 73ccccf commit c43b7ae
Show file tree
Hide file tree
Showing 93 changed files with 731 additions and 2,634 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ run-dev: ## run the dev server
@./scripts/run-dev.sh

CLI = dispatch
SERVICES = api-manager application-manager event-manager \
function-manager identity-manager image-manager secret-store event-sidecar \
service-manager

SERVICES = dispatch-server event-sidecar

DARWIN_BINS = $(foreach bin,$(SERVICES),$(bin)-darwin)
LINUX_BINS = $(foreach bin,$(SERVICES),$(bin)-linux)
Expand Down
8 changes: 0 additions & 8 deletions charts/dispatch/charts/api-manager/templates/config-map.yaml

This file was deleted.

27 changes: 2 additions & 25 deletions charts/dispatch/charts/api-manager/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,17 @@ spec:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ default .Values.global.image.host .Values.image.host }}/{{ .Values.image.repository }}:{{ default .Values.global.image.tag .Values.image.tag }}"
image: "{{ default .Values.global.image.host .Values.image.host }}/{{ default .Values.global.image.repository .Values.image.repository }}:{{ default .Values.global.image.tag .Values.image.tag }}"
imagePullPolicy: {{ default .Values.global.pullPolicy .Values.image.pullPolicy }}
args:
- "api-manager"
- "--host=0.0.0.0"
- "--port={{ .Values.service.internalPort }}"
- "--db-file={{ default .Release.Name .Values.global.db.release }}-{{ .Values.global.db.host }}.{{ default .Release.Namespace .Values.global.db.namespace }}:{{ .Values.global.db.port }}"
- "--db-backend={{ .Values.global.db.backend }}"
- "--db-username={{ .Values.global.db.user }}"
- "--db-password={{ .Values.global.db.password }}"
- "--db-database={{ .Values.global.db.database }}"
- "--tls-port=443"
- "--tls-certificate=/data/tls/tls.crt"
- "--tls-key=/data/tls/tls.key"
- "--gateway={{ .Values.gateway.name }}"
- "--gateway-host={{ .Values.gateway.host }}"
- "--function-manager={{ .Release.Name }}-function-manager.{{ .Release.Namespace }}"
- "--resync-period={{ .Values.resyncPeriod }}"
Expand Down Expand Up @@ -64,28 +61,8 @@ spec:
value: cookie
initialDelaySeconds: 10
periodSeconds: 3
volumeMounts:
- mountPath: "/data/{{ template "name" . }}"
name: {{ template "fullname" . }}
- mountPath: "/var/run/docker.sock"
name: {{ template "fullname" . }}-docker
- mountPath: "/data/tls"
name: tls
readOnly: true
env:
- name: DOCKER_API_VERSION
value: "1.24"
resources:
{{ .Values.resources | default .Values.global.resources | toYaml | indent 12 }}
volumes:
- name: {{ template "fullname" . }}
emptyDir: {}
- name: {{ template "fullname" . }}-docker
hostPath:
path: /var/run/docker.sock
- name: tls
secret:
secretName: {{ default .Values.global.tls.secretName .Values.ingress.tls.secretName }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down
7 changes: 3 additions & 4 deletions charts/dispatch/charts/api-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
replicaCount: 1
maxUnavailable: 0
maxSurge: 1
image:
image: {}
# host: vmware
repository: dispatch-api-manager
# repository: dispatch-server
# tag: latest
# pullPolicy: Always

gateway:
name: kong
host: "http://api-gateway-kongadmin.kong:8001"

service:
Expand Down Expand Up @@ -41,4 +40,4 @@ resources: {}
#requests:
# cpu: 100m
# memory: 128Mi
resyncPeriod: 10
resyncPeriod: 10s
21 changes: 0 additions & 21 deletions charts/dispatch/charts/application-manager/.helmignore

This file was deleted.

4 changes: 0 additions & 4 deletions charts/dispatch/charts/application-manager/Chart.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions charts/dispatch/charts/application-manager/templates/NOTES.txt

This file was deleted.

16 changes: 0 additions & 16 deletions charts/dispatch/charts/application-manager/templates/_helpers.tpl

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions charts/dispatch/charts/application-manager/templates/service.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions charts/dispatch/charts/application-manager/values.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if .Values.global.rbac.create -}}
# A cluster role for create/get/list/delete/update secrets
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
Expand Down
12 changes: 4 additions & 8 deletions charts/dispatch/charts/event-manager/templates/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ metadata:
name: {{ template "fullname" . }}
namespace: {{ .Release.Namespace }}
data:
organization: {{ .Values.global.organization }}
config.json: |-
{
"rabbitmq": {
"url": "{{ .Values.queue.rabbitmq.url }}",
"exchangeName": "{{ .Values.queue.rabbitmq.exchangeName }}"
}
}
config.yaml: |-
---
events:
rabbitmq-url: {{ .Values.queue.rabbitmq.url }}
Loading

0 comments on commit c43b7ae

Please sign in to comment.