Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deploy a node frontend with elasticsearch backend
---
apiVersion: v1
kind: Service
metadata:
name: loadbalancer
spec:
selector:
app: node
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: node
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: node
spec:
containers:
- name: node6
image: node:6
ports:
- containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: db
labels:
app: db
spec:
replicas: 1
selector:
matchLabels:
app: db
template:
metadata:
labels:
app: db
spec:
containers:
- name: elasticsearch
image: elasticsearch:7.0.1
ports:
- protocol: TCP
port: 9200
targetPort: 9200
- protocol: TCP
port: 9300
targetPort: 9300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment