apiVersion: v1
kind: Service
metadata:
  name: eureka-cluster
  namespace: {{ .Values.namespace }}
spec:
  selector:
    app: eureka
  ports:
  - port: 8761
    targetPort: 8761
  type: LoadBalancer

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: eureka-cluster
  namespace: {{ .Values.namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: eureka
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: eureka
    spec:
      containers:
        - image: {{ .Values.eureka.image }}
          imagePullPolicy: IfNotPresent
          name: eureka-server
          ports:
            - containerPort: 8761
              name: http
          livenessProbe:
            httpGet:
             path: /
             port: 8761
            initialDelaySeconds: 45
            timeoutSeconds: 10
            periodSeconds: 60
            failureThreshold: 3
