Skip to content

Commit

Permalink
chore(cd): add k8s support
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjules committed Apr 11, 2022
1 parent 1382d94 commit 582f2f6
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 0 deletions.
15 changes: 15 additions & 0 deletions k8s/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: spoty-config
namespace: spoty
data:
service-name: spoty
prod: "false"
spotify-redirect-uri: http://spoty-service.spoty.svc.cluster.local:80
http-server-host: 0.0.0.0
http-server-port: "9000"
cache-max-keys: "64"
cache-max-cost: "1000000"
jaeger-endpoint: http://localhost:14268/api/traces
amqp-uri: amqp://guest:guest@localhost:5672
84 changes: 84 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: spoty
namespace: spoty
labels:
app: spoty
spec:
replicas: 1
selector:
matchLabels:
app: spoty
template:
metadata:
labels:
app: spoty
spec:
containers:
- name: spoty
image: julesmike/spoty:1c20f9f76f4ecd6f45611d4fbbc762d74be008a1
resources:
limits:
memory: "128Mi"
cpu: "100m"
ports:
- containerPort: 9000
env:
- name: SPOTIFY_CLIENT_ID
valueFrom:
secretKeyRef:
name: spoty-secret
key: spotify-client-id
optional: false
- name: SPOTIFY_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: spoty-secret
key: spotify-client-secret
optional: false
- name: SERVICE_NAME
valueFrom:
configMapKeyRef:
name: spoty-config
key: service-name
- name: PROD
valueFrom:
configMapKeyRef:
name: spoty-config
key: prod
- name: SPOTIFY_REDIRECT_URI
valueFrom:
configMapKeyRef:
name: spoty-config
key: spotify-redirect-uri
- name: HTTP_SERVER_HOST
valueFrom:
configMapKeyRef:
name: spoty-config
key: http-server-host
- name: HTTP_SERVER_PORT
valueFrom:
configMapKeyRef:
name: spoty-config
key: http-server-port
- name: CACHE_MAX_KEYS
valueFrom:
configMapKeyRef:
name: spoty-config
key: cache-max-keys
- name: CACHE_MAX_COST
valueFrom:
configMapKeyRef:
name: spoty-config
key: cache-max-cost
- name: JAEGER_ENDPOINT
valueFrom:
configMapKeyRef:
name: spoty-config
key: jaeger-endpoint
- name: AMQP_URI
valueFrom:
configMapKeyRef:
name: spoty-config
key: amqp-uri
4 changes: 4 additions & 0 deletions k8s/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: spoty
9 changes: 9 additions & 0 deletions k8s/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: spoty-secret
namespace: spoty
type: Opaque
data:
spotify-client-id: MTExZmVkY2UyMzZmNGQzNGE2MDc3MTFhN2FjNGE2MDY= #obviously not real
spotify-client-secret: ZmI0ZDk4ODE5YjkxMmRmZDkwZDU4MDNiYjY2OGFkMjQ= #obviously not real
12 changes: 12 additions & 0 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: spoty-service
namespace: spoty
spec:
selector:
app: spoty
ports:
- protocol: TCP
port: 80
targetPort: 9000

0 comments on commit 582f2f6

Please sign in to comment.