Skip to content

Instantly share code, notes, and snippets.

@linkdd
Created September 14, 2021 17:09
Show Gist options
  • Save linkdd/d8fc89aa52ac1320906381811d57a6a3 to your computer and use it in GitHub Desktop.
Save linkdd/d8fc89aa52ac1320906381811d57a6a3 to your computer and use it in GitHub Desktop.
Example of Elixir deployment for Kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-elixir-app
namespace: default
labels:
app.kubernetes.io/name: my-elixir-app
app.kubernetes.io/instance: myapp-cluster
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: my-elixir-app
app.kubernetes.io/instance: myapp-node
template:
metadata:
labels:
app.kubernetes.io/name: my-elixir-app
app.kubernetes.io/instance: myapp-node
spec:
containers:
- name: main
image: myapp:latest
imagePullPolicy: IfNotPresent
env:
- name: RELEASE_NODE_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: RELEASE_COOKIE
valueFrom:
secretKeyRef:
name: my-elixir-app-cluster
key: ERLANG_COOKIE
ports:
- name: epmd
containerPort: 4369
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment