I have set up a front-end service via the following svc and deployment:
Deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ui-deployment
spec:
replicas: 1
template:
metadata:
labels:
els-pod: ui
spec:
containers:
- image: pkaramol/the-ui
name: ui
ports:
- containerPort: 80
restartPolicy: Always
Service
apiVersion: v1
kind: Service
metadata:
name: ui
spec:
ports:
- name: ui-port
port: 8080
targetPort: 80
selector:
els-pod: ui
When exposing via an AWS ELB as follows:
kubectl expose deployment ui-deployment --type=LoadBalancer --port=80 --target-port=8080 --name=k8s-elb