aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-10 14:50:55 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-10 14:50:55 +0200
commitcc2decc957e7cbb2936fa4a8730bf5baa6c21c61 (patch)
tree64be4026aa662fff47b8bbe3e7a64b307bc25118
parentbc18049649f0d9cf5efc5a8edc425de2c8707267 (diff)
downloadk8s-sandbox-cc2decc957e7cbb2936fa4a8730bf5baa6c21c61.tar.gz
k8s-sandbox-cc2decc957e7cbb2936fa4a8730bf5baa6c21c61.tar.bz2
k8s-sandbox-cc2decc957e7cbb2936fa4a8730bf5baa6c21c61.tar.xz
k8s-sandbox-cc2decc957e7cbb2936fa4a8730bf5baa6c21c61.zip
wip
-rw-r--r--README.md2
-rw-r--r--k8s/db.yaml5
-rw-r--r--k8s/mi.yaml67
-rw-r--r--mi-gateway/Dockerfile2
4 files changed, 60 insertions, 16 deletions
diff --git a/README.md b/README.md
index 2e748e3..7f55fd7 100644
--- a/README.md
+++ b/README.md
@@ -11,5 +11,7 @@
Secrets
+ kubectl create secret generic test-secret --from-literal=username='my-app' --from-literal=password='39528$vdg7Jb'
+
echo -n $password | base64
kubectl exec -it mi-gateway-pod -- /bin/bash
diff --git a/k8s/db.yaml b/k8s/db.yaml
index e62ff52..e97ca94 100644
--- a/k8s/db.yaml
+++ b/k8s/db.yaml
@@ -4,5 +4,6 @@ kind: Secret
metadata:
name: membership-import-admin
data:
- username: cG9zdGdyZXM=
- password: ZGlxODJ5REQ3b3hFSVA1Zw==
+ # mi-gateway
+ username: bWktZ2F0ZXdheQ==
+ password: bWktZ2F0ZXdheQ==
diff --git a/k8s/mi.yaml b/k8s/mi.yaml
index 2d1dcb7..43d6adf 100644
--- a/k8s/mi.yaml
+++ b/k8s/mi.yaml
@@ -17,13 +17,36 @@ spec:
image: trygvis/mi-processor:latest
ports:
- containerPort: 8080
- volumeMounts:
- - name: pgpass
- mountPath: /secret/pgpass
- volumes:
- - name: pgpass
- secret:
- secretName: membership-import-admin
+
+# volumeMounts:
+# - name: pgpass
+# mountPath: /secret/pgpass
+# volumes:
+# - name: pgpass
+# secret:
+# secretName: membership-import-admin
+
+---
+kind: Service
+apiVersion: v1
+metadata:
+ name: pg
+spec:
+ type: ClusterIP
+ ports:
+ - port: 5432
+ targetPort: 5432
+
+---
+kind: Endpoints
+apiVersion: v1
+metadata:
+ name: pg
+subsets:
+ - addresses:
+ - ip: 10.88.80.3
+ ports:
+ - port: 5432
---
apiVersion: apps/v1
@@ -45,13 +68,29 @@ spec:
image: trygvis/mi-gateway:latest
ports:
- containerPort: 8080
- volumeMounts:
- - name: pgpass
- mountPath: /secret/pgpass
- volumes:
- - name: pgpass
- secret:
- secretName: membership-import-admin
+ env:
+ - name: PGDATABASE
+ value: iqey
+ - name: PGUSER
+ valueFrom:
+ secretKeyRef:
+ name: membership-import-admin
+ key: username
+ - name: PGPASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: membership-import-admin
+ key: password
+ - name: PGHOST
+ value: pg.default.svc.cluster.local
+
+# volumeMounts:
+# - name: pgpass
+# mountPath: /secret/pgpass
+# volumes:
+# - name: pgpass
+# secret:
+# secretName: membership-import-admin
---
apiVersion: v1
diff --git a/mi-gateway/Dockerfile b/mi-gateway/Dockerfile
index d657cc3..ae3062b 100644
--- a/mi-gateway/Dockerfile
+++ b/mi-gateway/Dockerfile
@@ -4,6 +4,8 @@ WORKDIR /opt
COPY package*.json ./
+RUN apt update && apt full-upgrade
+RUN apt install postgresql-client
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production