fix: new dir for k8s

This commit is contained in:
2020-01-17 15:33:16 +01:00
parent 5d8e4712a4
commit 3a475ec22b
2 changed files with 0 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: geo-service
name: geo-service
annotations:
kubernetes.io/change-cause: "${TIMESTAMP} Deployed commit id: ${COMMIT}"
spec:
replicas: 1
selector:
matchLabels:
app: geo-service
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: geo-service
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- geo-service
topologyKey: kubernetes.io/hostname
containers:
- name: geo-service
resources:
limits:
memory: "100Mi"
requests:
memory: "100Mi"
imagePullPolicy: Always
image: registry.gitlab.com/unboundsoftware/dancefinder/geo-service:${COMMIT}
ports:
- containerPort: 80
name: http
envFrom:
- secretRef:
name: google-maps-api
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: geo-service
spec:
ports:
- port: 80
name: http
protocol: TCP
targetPort: 80
selector:
app: geo-service
type: ClusterIP
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
source ${BUILD_TOOLS_PATH}/scripts/kubernetes.sh
ENVIRONMENT="${1?usage: secrets.sh <environment>}"
LASTPASS_SHARE="envconfig\\${ENVIRONMENT}"
kube_cmd=$(kubernetes:get_command ${ENVIRONMENT})
SECRET_NAME="google-maps-api"
API_KEY=$(lpass show --name "${LASTPASS_SHARE}/${SECRET_NAME}" --notes)
$kube_cmd delete secret ${SECRET_NAME,,} &> /dev/null || true
$kube_cmd create secret generic \
${SECRET_NAME,,} \
--from-literal=MAPS_API_KEY="${API_KEY}"