kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch14/numbers/api.yaml

45 lines
961 B
YAML

apiVersion: v1
kind: Service
metadata:
name: numbers-api
namespace: kiamol-ch14-test
spec:
ports:
- port: 8016
targetPort: api
selector:
app: numbers-api
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: numbers-api
namespace: kiamol-ch14-test
spec:
selector:
matchLabels:
app: numbers-api
template:
metadata:
labels:
app: numbers-api
annotations:
prometheus.io/port: "9115"
prometheus.io/path: "/probe"
prometheus.io/target: "http://127.0.0.1/healthz"
spec:
containers:
- name: api
image: kiamol/ch03-numbers-api
ports:
- containerPort: 80
name: api
env:
- name: FailAfterCallCount
value: "3"
- name: exporter
image: prom/blackbox-exporter:v0.17.0
ports:
- name: metrics
containerPort: 9115