Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: hostn-port
name: hostn-port
spec:
replicas: 1
selector:
matchLabels:
app: hostn-port
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: hostn-port
spec:
containers:
- image: gcr.io/google_containers/serve_hostname
imagePullPolicy: Always
name: hostnames
ports:
- containerPort: 9376
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
apiVersion: v1
kind: Service
metadata:
labels:
app: hostn-port-svc
name: hostn-port-svc
spec:
ports:
- port: 95
protocol: TCP
targetPort: 9376
selector:
app: hostn-port
externalIPs:
- ${SERVER_IP}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: hostn-hndp
name: hostn-hndp
spec:
replicas: 1
selector:
matchLabels:
app: hostn-hd
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: hostn-hd
annotations:
scheduler.alpha.kubernetes.io/affinity: >
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "kubernetes.io/hostname",
"operator": "In",
"values": ["${SERVER_HOSTNAME}"]
}
]
}
]
}
}
}
spec:
hostNetwork: true
containers:
- image: gcr.io/google_containers/serve_hostname
imagePullPolicy: Always
name: hostnames
ports:
- containerPort: 9376
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.