Skip to content

Commit

Permalink
feat(controller): move deis-controller to use Deployments
Browse files Browse the repository at this point in the history
RC for deis-controller is kept around so it can be taken out of rotation without needing manual intervention (see replicas 0 and changed labels)
  • Loading branch information
helgi committed Jul 26, 2016
1 parent 31cbcc9 commit 4173034
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 3 deletions.
106 changes: 106 additions & 0 deletions workflow-dev/tpl/deis-controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#helm:generate helm template -o $HELM_GENERATE_DIR/manifests/deis-controller-deployment.yaml -d $HELM_GENERATE_DIR/tpl/generate_params.toml $HELM_GENERATE_DIR/tpl/deis-controller-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deis-controller
namespace: deis
labels:
heritage: deis
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
app: deis-controller
template:
metadata:
labels:
app: deis-controller
spec:
serviceAccount: deis-controller
containers:
- name: deis-controller
image: quay.io/{{.controller.org}}/controller:{{env "CONTROLLER_GIT_TAG" | default .controller.dockerTag}}
imagePullPolicy: {{.controller.pullPolicy}}
livenessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 30
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /readiness
port: 8000
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 5
ports:
- containerPort: 8000
name: http
env:
- name: KUBERNETES_POD_TERMINATION_GRACE_PERIOD_SECONDS
value: "5"
- name: "APP_STORAGE"
value: "{{ or (env "STORAGE_TYPE") (.storage)}}"
- name: "SLUGRUNNER_IMAGE_NAME"
value: "quay.io/{{.slugrunner.org}}/slugrunner:{{env "SLUGRUNNER_GIT_TAG" | default .slugrunner.dockerTag}}"
- name: DEIS_SECRET_KEY
valueFrom:
secretKeyRef:
name: django-secret-key
key: secret-key
- name: DEIS_BUILDER_KEY
valueFrom:
secretKeyRef:
name: builder-key-auth
key: builder-key
{{- if env "DATABASE_LOCATION" | default .database_location | eq "off-cluster" }}
- name: DEIS_DATABASE_NAME
value: "{{ env "DATABASE_NAME" | default .database.name }}"
- name: DEIS_DATABASE_SERVICE_HOST
value: "{{ env "DATABASE_HOST" | default .database.host }}"
- name: DEIS_DATABASE_SERVICE_PORT
value: "{{ env "DATABASE_PORT" | default .database.port }}"
{{- end }}
- name: DEIS_DATABASE_USER
valueFrom:
secretKeyRef:
name: database-creds
key: user
- name: DEIS_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: database-creds
key: password
- name: RESERVED_NAMES
value: "deis, deis-builder, deis-workflow-manager, grafana"
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-socket
- name: builder-key-auth
mountPath: /var/run/secrets/api/builder/auth
readOnly: true
- name: django-secret-key
mountPath: /var/run/secrets/api/django
readOnly: true
- name: database-creds
mountPath: /var/run/secrets/deis/database/creds
readOnly: true
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
- name: django-secret-key
secret:
secretName: django-secret-key
- name: builder-key-auth
secret:
secretName: builder-key-auth
- name: database-creds
secret:
secretName: database-creds
6 changes: 3 additions & 3 deletions workflow-dev/tpl/deis-controller-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ metadata:
labels:
heritage: deis
spec:
replicas: 1
replicas: 0
selector:
app: deis-controller
app: deis-controller-deprecated
template:
metadata:
labels:
app: deis-controller
app: deis-controller-deprecated
spec:
serviceAccount: deis-controller
containers:
Expand Down

0 comments on commit 4173034

Please sign in to comment.