mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-11 16:58:47 +01:00
Migrate hishtory from k8s to docker compose
This commit is contained in:
parent
2c6061e497
commit
ad809efef6
2
Makefile
2
Makefile
@ -25,11 +25,9 @@ build-api:
|
|||||||
|
|
||||||
deploy-static: build-static
|
deploy-static: build-static
|
||||||
docker push gcr.io/dworken-k8s/hishtory-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
|
deploy-api: build-api
|
||||||
docker push gcr.io/dworken-k8s/hishtory-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
|
deploy: release deploy-static deploy-api
|
||||||
|
|
||||||
|
@ -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
|
|
@ -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
|
|
@ -29,7 +29,7 @@ import (
|
|||||||
const (
|
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.
|
// 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
|
// 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 (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user