apiVersion: v1
kind: Service
metadata:
  labels:
    app: extranetui-service
  name: extranetui-service
spec:
  ports:
  - name: extranetui-service-port
    port: 80
    targetPort: http
  selector:
    app: extranetui
  sessionAffinity: ClientIP
  type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: extranetui
spec:
  replicas: 2
  selector:
    matchLabels:
      app: extranetui
  template:
    metadata:
      annotations:
        linkerd.io/inject: enabled
      labels:
        app: extranetui
    spec:
      containers:
      - image: aosprodacr.azurecr.io/extranetui
        imagePullPolicy: IfNotPresent
        livenessProbe:
          httpGet:
            path: /healthcheck
            port: 80
          initialDelaySeconds: 30
          periodSeconds: 1
        name: extranetui
        ports:
        - containerPort: 80
          name: http
        readinessProbe:
          httpGet:
            path: /healthcheck
            port: 80
          initialDelaySeconds: 30
          periodSeconds: 1
        resources:
          limits:
            cpu: 500m
            memory: 768M
          requests:
            cpu: 300m
            memory: 512M
        volumeMounts:
        - mountPath: /app/appsettings.json
          name: config-volume
          subPath: appsettings.json
      imagePullSecrets:
      - name: acr-pull
      restartPolicy: Always
      volumes:
      - configMap:
          name: app-config
        name: config-volume
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: extranetui-hpa
spec:
  maxReplicas: 5
  minReplicas: 2
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: extranetui
  targetCPUUtilizationPercentage: 50
