
This example shows a simple two tier setup in Kubernetes, and simply prints the environment information that each pod sees. Querying the service multiple times will show services at work load balancing requests.
33 lines
696 B
YAML
33 lines
696 B
YAML
---
|
|
apiVersion: v1
|
|
kind: ReplicationController
|
|
metadata:
|
|
name: show-rc
|
|
labels:
|
|
type: show-type
|
|
spec:
|
|
replicas: 3
|
|
template:
|
|
metadata:
|
|
labels:
|
|
type: show-type
|
|
spec:
|
|
containers:
|
|
- name: show-container
|
|
image: gcr.io/google-samples/env-show:1.1
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8080
|
|
protocol: TCP
|
|
env:
|
|
- name: USER_VAR
|
|
value: important information
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|