---
apiVersion: v1
kind: Service
metadata:
  name: frontend
spec:
  ports:
  - name: frontend-http
    port: 80
    protocol: TCP
    targetPort: 8080
  - name: frontend-https
    port: 443
    protocol: TCP
    targetPort: 8080
  selector:
    app: digraph
    tier: frontend
  type: LoadBalancer

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: digraph
    tier: frontend
  name: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: digraph
      tier: frontend
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: digraph
        tier: frontend
    spec:
      containers:
      - name: frontend
        command:
        - ./frontend
        envFrom:
        - secretRef:
            name: digraph-secrets
        image: emwalker/digraph:v126
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
      restartPolicy: Always

---
apiVersion: v1
kind: Service
metadata:
  name: frontend
spec:
  ports:
  - name: frontend-http
    nodePort: 30723
    port: 80
    protocol: TCP
    targetPort: 8080
  - name: frontend-https
    nodePort: 31583
    port: 443
    protocol: TCP
    targetPort: 8080
  selector:
    app: digraph
    tier: frontend
  type: NodePort

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: digraph
    tier: frontend
  name: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: digraph
      tier: frontend
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: digraph
        tier: frontend
    spec:
      containers:
      - name: frontend
        command:
        - ./frontend
        envFrom:
        - secretRef:
            name: digraph-secrets
        image: emwalker/digraph:v126
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
      restartPolicy: Always

Replace LoadBalancer service with a NodePort service
Replace LoadBalancer service with a NodePort service
