Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
* Update the prod instance. Check in hydrated manifests for prod.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Lewi committed May 4, 2020
1 parent 3f698dc commit a9fafaf
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 1 deletion.
81 changes: 81 additions & 0 deletions .build/prod/apps_v1_deployment_label-bot-ml-github-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: label-bot
environment: prod
service: label-bot
name: label-bot-ml-github-app
namespace: label-bot-prod
spec:
replicas: 9
selector:
matchLabels:
app: label-bot
environment: prod
service: label-bot
template:
metadata:
labels:
app: label-bot
environment: prod
service: label-bot
spec:
containers:
- command:
- python
- app.py
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
key: DATABASE_URL
name: ml-app-inference-secret
- name: WEBHOOK_SECRET
valueFrom:
secretKeyRef:
key: WEBHOOK_SECRET
name: ml-app-inference-secret
- name: APP_ID
value: "27079"
- name: GITHUB_APP_PEM_KEY
value: /var/secrets/github/kf-label-bot-prod.private-key.pem
- name: GCP_PROJECT_ID
value: issue-label-bot-dev
- name: GCP_PUBSUB_TOPIC_NAME
value: event_queue
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/user-gcp-sa.json
- name: FLASK_ENV
value: production
- name: PORT
value: "3000"
- name: APP_URL
value: https://mlbot.net/
- name: authors
value: c
image: gcr.io/github-probots/label-bot-frontend:3f698dc
name: frontend
ports:
- containerPort: 443
- containerPort: 80
- containerPort: 3000
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 10
periodSeconds: 3
volumeMounts:
- mountPath: /var/secrets/google
name: user-gcp-sa
- mountPath: /var/secrets/github
name: github-app
workingDir: /flask_app
volumes:
- name: user-gcp-sa
secret:
secretName: user-gcp-sa
- name: github-app
secret:
secretName: github-app
23 changes: 23 additions & 0 deletions .build/prod/extensions_v1beta1_ingress_label-bot-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.global-static-ip-name: label-bot-prod
networking.gke.io/managed-certificates: certificate
labels:
app: label-bot
environment: prod
service: label-bot
name: label-bot-frontend
namespace: label-bot-prod
spec:
backend:
serviceName: label-bot-ml-github-app
servicePort: 3000
rules:
- http:
paths:
- backend:
serviceName: label-bot-ml-github-app
servicePort: 3000
path: /
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
labels:
environment: prod
name: certificate
namespace: label-bot-prod
spec:
domains:
- label-bot-prod.mlbot.net
18 changes: 18 additions & 0 deletions .build/prod/~g_v1_service_label-bot-ml-github-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: label-bot
environment: prod
service: label-bot
name: label-bot-ml-github-app
namespace: label-bot-prod
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: label-bot
environment: prod
service: label-bot
type: NodePort
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!.build
.*
*.pem
*.hdf5
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ else
GIT_VERSION := $(shell git describe --always)-dirty-$(shell git diff | shasum -a256 | cut -c -6)
endif

CONTEXT=label-bot-frontend-prod

hydrate-prod:
rm -rf .build/prod
mkdir -p .build/prod
kustomize build -o .build/prod deployment/overlays/prod

apply-prod: hydrate-prod
kubectl --context=$(CONTEXT) apply -f .build/prod

TAG := $(shell date +v%Y%m%d)-$(GIT_VERSION)
all: build

Expand Down
2 changes: 1 addition & 1 deletion deployment/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace: label-bot-prod
images:
- name: gcr.io/github-probots/label-bot-frontend
newName: gcr.io/github-probots/label-bot-frontend
newTag: 2cb624e
newTag: 3f698dc
resources:
- certificate.yaml
- ../../base
Expand Down

0 comments on commit a9fafaf

Please sign in to comment.