deploymentexample.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
#
apiVersion : apps/v1
#
kind : Deployment
#
metadata :
annotations :
labels :
app : go-helloworld
name : go-helloworld
namespace : default
#
spec :
#
#
replicas : 3
#
#
selector :
matchLabels :
app : go-helloworld
#
#
strategy :
rollingUpdate :
maxSurge : 25%
maxUnavailable : 25%
type : RollingUpdate
#
template :
#
#
metadata :
labels :
app : go-helloworld
#
spec :
containers :
#
#
#
-
image :
pixelpotato/go-helloworld:v2.0.0 imagePullPolicy : IfNotPresent
name : go-helloworld
#
#
ports :
-
containerPort : 6112
protocol : TCP
#
#
#
livenessProbe :
httpGet :
path : /
port : 6112
#
#
#
readinessProbe :
httpGet :
path : /
port : 6112
#
resources :
#
#
#
requests :
memory : " 64Mi "
cpu : " 250m "
#
#
#
limits :
memory : " 128Mi "
cpu : " 500m "
serviceexample.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
Set the API endpoint used to create the Service resource. #
apiVersion: v1
Define the type of the resource. #
kind: Service
Set the parameters that make the object identifiable, such as its name, namespace, and labels. #
metadata:
labels:
app: go-helloworld
name: go-helloworld
namespace: default
Define the desired configuration for the Service resource. #
spec:
Define the ports that the service should serve on. #
For example, the service is exposed on port 8111, and #
directs the traffic to the pods on port 6112, using TCP. #
ports:
- port: 8111
protocol: TCP
targetPort: 6112
Identify the pods managed by this Service using the following selectors. #
In this case, all pods with the label go-helloworld. #
selector:
app: go-helloworld
Define the Service type, here set to ClusterIP. #
type: ClusterIP