Skip to content

Instantly share code, notes, and snippets.

@fvigotti
Created October 4, 2016 13:52
Show Gist options
  • Save fvigotti/e3fdc4402e03ff36d5cad6b5016efe64 to your computer and use it in GitHub Desktop.
Save fvigotti/e3fdc4402e03ff36d5cad6b5016efe64 to your computer and use it in GitHub Desktop.
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