diff options
Diffstat (limited to 'apps/k8s')
-rw-r--r-- | apps/k8s/.gitignore | 1 | ||||
-rw-r--r-- | apps/k8s/mi.yaml | 135 | ||||
-rw-r--r-- | apps/k8s/secrets.yaml.j2 | 8 |
3 files changed, 144 insertions, 0 deletions
diff --git a/apps/k8s/.gitignore b/apps/k8s/.gitignore new file mode 100644 index 0000000..03cdeec --- /dev/null +++ b/apps/k8s/.gitignore @@ -0,0 +1 @@ +secrets.yaml diff --git a/apps/k8s/mi.yaml b/apps/k8s/mi.yaml new file mode 100644 index 0000000..c838f02 --- /dev/null +++ b/apps/k8s/mi.yaml @@ -0,0 +1,135 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mi-processor-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: mi-processor-pod + template: + metadata: + labels: + app: mi-processor-pod + spec: + containers: + - name: mi-processor + image: trygvis/mi-processor:latest + ports: + - containerPort: 8080 + +# 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 +kind: Deployment +metadata: + name: mi-gateway-deployment +spec: + replicas: 3 + selector: + matchLabels: + app: mi-gateway-pod + template: + metadata: + labels: + app: mi-gateway-pod + spec: + containers: + - name: mi-gateway + image: trygvis/mi-gateway:latest + ports: + - containerPort: 8080 + 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 +#kind: Service +#metadata: +# name:mi-gateway-service +#spec: +# selector: +# app: mi-gateway-pod +# type: LoadBalancer +# ports: +# - protocol: TCP +# port: 80 +# targetPort: 8080 + +--- +apiVersion: v1 +kind: Service +metadata: + name: mi-gateway-service +spec: + selector: + app: mi-gateway-pod + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + +--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: mi-gateway-ingress +spec: + rules: +# - host: my-server.10.0.0.8.xip.io + - http: + paths: + - path: / + backend: + serviceName: mi-gateway-service + servicePort: 80 diff --git a/apps/k8s/secrets.yaml.j2 b/apps/k8s/secrets.yaml.j2 new file mode 100644 index 0000000..f23a233 --- /dev/null +++ b/apps/k8s/secrets.yaml.j2 @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: membership-import-admin +type: Opaque +data: + username: {{ membership_import_admin.username | b64encode }} + password: {{ membership_import_admin.password | b64encode }} |