Skip to content

Instantly share code, notes, and snippets.

@pratikmallya
Last active January 8, 2020 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pratikmallya/1b9588e05752030d6d567e39762f3599 to your computer and use it in GitHub Desktop.
Save pratikmallya/1b9588e05752030d6d567e39762f3599 to your computer and use it in GitHub Desktop.
Simulating a daemonset with a deployment
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: nginx
spec:
minReplicas: 1
maxReplicas: 10000
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: nginx
metrics:
- type: External
external:
metricName: kubernetes_state.nodes.by_condition
metricSelector:
matchLabels:
kubernetescluster: "throwaway-dev-meeting"
condition: "ready"
status: "true"
targetAverageValue: 1
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
annotations:
ad.datadoghq.com/nginx.check_names: '["nginx"]'
ad.datadoghq.com/nginx.init_configs: '[{}]'
ad.datadoghq.com/nginx.instances: '[{"nginx_status_url": "http://%%host%%/nginx_status", "tags": "%%tags%%"}]'
ad.datadoghq.com/nginx.logs: '[{"type": "docker","image": "nginx","service": "nginx","source": "nginx"}]'
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nginx
topologyKey: "kubernetes.io/hostname"
containers:
- name: nginx
image: nginx:latest
ports:
- name: http
containerPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment