# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: clientservice
spec:
  selector:
    matchLabels:
      app: clientservice
  template:
    metadata:
      labels:
        app: clientservice
    spec:
      serviceAccountName: default
      containers:
      - name: client
        image: clientservice
        ports:
        - containerPort: 8080
        readinessProbe:
          initialDelaySeconds: 10
          periodSeconds: 5
          httpGet:
            path: "/_healthz"
            port: 8080
        livenessProbe:
          initialDelaySeconds: 10
          periodSeconds: 5
          httpGet:
            path: "/_healthz"
            port: 8080
        env:
        - name: SERVER_ADDR
          value: "serverservice:5050"
        resources:
          requests:
            cpu: 250m
            memory: 512Mi
          limits:
            cpu: 500m
            memory: 1Gi
---
apiVersion: v1
kind: Service
metadata:
  name: clientservice
spec:
  type: ClusterIP
  selector:
    app: clientservice
  ports:
  - name: http
    port: 8080
    targetPort: 8080
