step1/manifests/server.yaml (48 lines of code) (raw):
# 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: serverservice
spec:
selector:
matchLabels:
app: serverservice
template:
metadata:
labels:
app: serverservice
spec:
serviceAccountName: default
containers:
- name: server
image: serverservice
ports:
- containerPort: 5050
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:5050"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:5050"]
env:
- name: PORTS
value: "5050"
resources:
requests:
cpu: 200m
memory: 128Mi
limits:
cpu: 400m
memory: 256Mi
---
apiVersion: v1
kind: Service
metadata:
name: serverservice
spec:
type: ClusterIP
selector:
app: serverservice
ports:
- name: grpc
port: 5050
targetPort: 5050