57 lines
1.1 KiB
YAML
57 lines
1.1 KiB
YAML
|
# A headless service to create DNS records
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: nginx
|
||
|
labels:
|
||
|
app: nginx
|
||
|
spec:
|
||
|
ports:
|
||
|
- port: 80
|
||
|
name: web
|
||
|
# *.nginx.default.svc.cluster.local
|
||
|
clusterIP: None
|
||
|
selector:
|
||
|
app: nginx
|
||
|
---
|
||
|
apiVersion: apps/v1alpha1
|
||
|
kind: PetSet
|
||
|
metadata:
|
||
|
name: web
|
||
|
spec:
|
||
|
serviceName: "nginx"
|
||
|
replicas: 2
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: nginx
|
||
|
annotations:
|
||
|
pod.alpha.kubernetes.io/initialized: "true"
|
||
|
spec:
|
||
|
terminationGracePeriodSeconds: 0
|
||
|
containers:
|
||
|
- name: nginx
|
||
|
image: gcr.io/google_containers/nginx-slim:0.7
|
||
|
ports:
|
||
|
- containerPort: 80
|
||
|
name: web
|
||
|
command:
|
||
|
- nginx
|
||
|
args:
|
||
|
- -g
|
||
|
- "daemon off;"
|
||
|
volumeMounts:
|
||
|
- name: www
|
||
|
mountPath: /usr/share/nginx/html
|
||
|
volumeClaimTemplates:
|
||
|
- metadata:
|
||
|
name: www
|
||
|
annotations:
|
||
|
volume.alpha.kubernetes.io/storage-class: anything
|
||
|
spec:
|
||
|
accessModes: [ "ReadWriteOnce" ]
|
||
|
resources:
|
||
|
requests:
|
||
|
storage: 1Gi
|
||
|
|