Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Created April 12, 2019 14:45
Show Gist options
  • Save mlafeldt/9e7f7363610f5026a6a754ecde6f6616 to your computer and use it in GitHub Desktop.
Save mlafeldt/9e7f7363610f5026a6a754ecde6f6616 to your computer and use it in GitHub Desktop.

Revisions

  1. mlafeldt created this gist Apr 12, 2019.
    78 changes: 78 additions & 0 deletions nginx.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: nginx
    namespace: ae-ops-testing
    labels:
    app: nginx
    spec:
    # replicas: 1
    selector:
    matchLabels:
    app: nginx
    template:
    metadata:
    labels:
    app: nginx
    spec:
    containers:
    - name: nginx
    image: nginx:1.7.9
    ports:
    - containerPort: 80
    resources:
    requests:
    memory: "64Mi"
    cpu: "250m"
    limits:
    memory: "128Mi"
    cpu: "500m"
    ---
    apiVersion: v1
    kind: Service
    metadata:
    name: nginx
    namespace: ae-ops-testing
    labels:
    app: nginx
    spec:
    ports:
    - port: 80
    protocol: TCP
    selector:
    app: nginx
    ---
    kind: ServiceMonitor
    apiVersion: monitoring.coreos.com/v1
    metadata:
    name: nginx
    namespace: ae-ops-testing
    labels:
    prometheus: kube-prometheus
    spec:
    selector:
    matchLabels:
    app: nginx
    endpoints:
    - port: http
    namespaceSelector:
    matchNames:
    - ae-ops-testing
    ---
    kind: HorizontalPodAutoscaler
    apiVersion: autoscaling/v2beta1
    metadata:
    name: nginx
    namespace: ae-ops-testing
    spec:
    scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: nginx
    minReplicas: 1
    maxReplicas: 10
    metrics:
    - type: Pods
    pods:
    metricName: cpu_usage
    targetAverageValue: 10m