Migrate hishtory from k8s to docker compose

This commit is contained in:
David Dworken 2022-10-18 11:53:35 -07:00
parent 2c6061e497
commit ad809efef6
4 changed files with 1 additions and 82 deletions

View File

@ -25,11 +25,9 @@ build-api:
deploy-static: build-static
docker push gcr.io/dworken-k8s/hishtory-static
kubectl patch deployment hishtory-static -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"ts\":\"`date|sed -e 's/ /_/g'|sed -e 's/:/-/g'`\"}}}}}}"
deploy-api: build-api
docker push gcr.io/dworken-k8s/hishtory-api
kubectl patch deployment hishtory-api -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"ts\":\"`date|sed -e 's/ /_/g'|sed -e 's/:/-/g'`\"}}}}}}"
deploy: release deploy-static deploy-api

View File

@ -1,47 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: hishtory-api
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: hishtory-api
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hishtory-api
spec:
revisionHistoryLimit: 5
selector:
matchLabels:
app: hishtory-api
replicas: 1
template:
metadata:
labels:
app: hishtory-api
spec:
containers:
- name: hishtory-api
image: gcr.io/dworken-k8s/hishtory-api
imagePullPolicy: Always
ports:
- containerPort: 80
volumeMounts:
- name: aws-secret-volume
mountPath: /root/awscreds/
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /root/.aws/credentials
- name: DOGSTATSD_HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
volumes:
- name: aws-secret-volume
secret:
secretName: aws-secret

View File

@ -1,32 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: hishtory-static
spec:
ports:
- port: 80
targetPort: 80
selector:
app: hishtory-static
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hishtory-static
spec:
revisionHistoryLimit: 5
selector:
matchLabels:
app: hishtory-static
replicas: 1
template:
metadata:
labels:
app: hishtory-static
spec:
containers:
- name: hishtory-static
image: gcr.io/dworken-k8s/hishtory-static
imagePullPolicy: Always
ports:
- containerPort: 80

View File

@ -29,7 +29,7 @@ import (
const (
// This password is for the postgres cluster running in my k8s cluster that is not publicly accessible. Some day I'll migrate it out of the code and rotate the password, but until then, this is fine.
// TODO: Migrate this
PostgresDb = "postgresql://postgres:O74Ji4735C@postgres-postgresql.default.svc.cluster.local:5432/hishtory?sslmode=disable"
PostgresDb = "postgresql://postgres:O74Ji4735C@postgres:5432/hishtory?sslmode=disable"
)
var (