Kubernetes deployment for GKE Hello app redistibution.
Code sample
YAML
What's next
To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser .
Kubernetes deployment for GKE Hello app redistibution.
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
labels
:
app
:
hello-web
name
:
hello-web
namespace
:
default
spec
:
replicas
:
3
selector
:
matchLabels
:
app
:
hello-web
template
:
metadata
:
labels
:
app
:
hello-web
spec
:
# Pod anti affinity config START
affinity
:
podAntiAffinity
:
requiredDuringSchedulingIgnoredDuringExecution
:
-
labelSelector
:
matchExpressions
:
-
key
:
app
operator
:
In
values
:
-
hello-web
topologyKey
:
kubernetes.io/hostname
# Pod anti affinity config END
containers
:
-
image
:
us-docker.pkg.dev/google-samples/containers/gke/hello-app-redis:1.0
# change to the image name you built
name
:
hello-app
# Readiness probe config START
readinessProbe
:
failureThreshold
:
1
httpGet
:
path
:
/healthz
port
:
8080
scheme
:
HTTP
initialDelaySeconds
:
1
periodSeconds
:
1
successThreshold
:
1
timeoutSeconds
:
1
To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser .
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.