July 2019
Beginner to intermediate
302 pages
9h 38m
English
You can look at the YAML configurations that Kubernetes automatically creates for the deployment and service:
$ kubectl get service cookbook-recipe -o yamlapiVersion: v1kind: Servicemetadata: creationTimestamp: "2019-05-24T17:20:10Z" labels: run: cookbook-recipe name: cookbook-recipe namespace: default resourceVersion: "7829" selfLink: /api/v1/namespaces/default/services/cookbook-recipe uid: 2f3c26c4-7e48-11e9-b1ea-080027d87cc5spec: clusterIP: 10.96.207.154 externalTrafficPolicy: Cluster ports: - nodePort: 32402 port: 5000 protocol: TCP targetPort: 5000 selector: run: cookbook-recipe sessionAffinity: None type: LoadBalancerstatus: loadBalancer: {}
The preceding code is the config for service. In a similar fashion, the config ...