Merging Everything into the Same YAML Definition
Merge all the definitions we’ve explored until now into a single YAML file and then create objects using that file.
Looking into the merged file
Consider this lesson as a connective tissue. We’ll merge the definitions we used in this chapter into a single YAML file. We’ve already discussed a similar example before, so there’s no need for lengthy explanations.
Let’s look at the definition of go-demo-2.yml
:
Press + to interact
apiVersion: apps/v1kind: Deploymentmetadata:name: go-demo-2-dblabels:type: dbservice: go-demo-2vendor: MongoLabsspec:selector:matchLabels:type: dbservice: go-demo-2strategy:type: Recreatetemplate:metadata:labels:type: dbservice: go-demo-2vendor: MongoLabsspec:containers:- name: dbimage: mongo:3.3---apiVersion: v1kind: Servicemetadata:name: go-demo-2-dbspec:ports:- port: 27017selector:type: dbservice: go-demo-2---apiVersion: apps/v1beta2kind: Deploymentmetadata:name: go-demo-2-apilabels:type: apiservice: go-demo-2language: gospec:replicas: 3selector:matchLabels:type: apiservice: go-demo-2template:metadata:labels:type: apiservice: go-demo-2language: gospec:containers:- name: apiimage: vfarcic/go-demo-2env:- name: DBvalue: go-demo-2-dbreadinessProbe:httpGet:path: /demo/helloport: 8080periodSeconds: 1livenessProbe:httpGet:path: /demo/helloport: 8080---apiVersion: v1kind: Servicemetadata:name: go-demo-2-apispec:type: NodePortports:- port: 8080selector:type: apiservice: go-demo-2
Differences with previous definitions
If you start searching for differences with the ...