Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
---
kind: Service
apiVersion: v1
metadata:
name: web-svc
spec:
type: LoadBalancer
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: demo-httpd
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: demo-httpd
labels:
app: web
spec:
replicas: 2
selector:
matchLabels:
app: demo-httpd
template:
metadata:
labels:
app: demo-httpd
spec:
containers:
- name: httpd
image: gowatana/centos7:httpd
ports:
- containerPort: 80
protocol: TCP
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- demo-httpd
topologyKey: "kubernetes.io/hostname"
@gowatana

This comment has been minimized.

Copy link
Owner Author

@gowatana gowatana commented Sep 18, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment