-
Notifications
You must be signed in to change notification settings - Fork 2
/
k8s.yaml
74 lines (74 loc) · 2.17 KB
/
k8s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
apiVersion: v1
kind: Service
metadata:
name: phoenix-libcluster
labels:
app: phoenix-libcluster
tier: phoenix-libcluster
spec:
type: LoadBalancer
ports:
# the port that this service should serve on
- port: 8080
selector:
app: phoenix-libcluster
tier: phoenix-libcluster
---
apiVersion: v1
kind: ReplicationController
metadata:
name: phoenix-libcluster
# these labels can be applied automatically
# from the labels in the pod template if not set
labels:
app: phoenix-libcluster
tier: phoenix-libcluster
spec:
# this replicas value is default
# modify it according to your case
replicas: 3
# selector can be applied automatically
# from the labels in the pod template if not set
# selector:
# app: guestbook
# tier: frontend
template:
metadata:
labels:
app: phoenix-libcluster
tier: phoenix-libcluster
spec:
containers:
- name: phoenix-libcluster
image: libcluster:v1
imagePullPolicy: IfNotPresent
#args: ["mix", "phoenix.server", "--no-deps-check", "--no-compile", "--no-halt"]
args:
#- date | md5sum | tr -d '\n' > .nomnom && elixir --name $(MY_POD_NAMESPACE)@$(MY_POD_IP) -S mix && MIX_ENV=prod PORT=80 mix phoenix.server
#- echo 'manju' | tr -d '\n' > .nomnom && elixir --name $(MY_POD_NAMESPACE)@$(MY_POD_IP) -S mix && mix phoenix.server
# PORT=8080 elixir --cookie manju --name phoenix-libcluster@$(hostname -I) -S mix phoenix.server
- mix deps.get && mix compile && PORT=8080 elixir --name phoenix-libcluster@$(hostname -I) -S mix phoenix.server
command:
- /bin/bash
- -c
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: PORT
value: "8080"
- name: MY_BASENAME
value: phoenix-libcluster
- name: MY_POD_NAMESPACE
value: phoenix-libcluster
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
ports:
- containerPort: 8080