Skip to content

Instantly share code, notes, and snippets.

@asksven
Created March 19, 2023 16:22
Show Gist options
  • Save asksven/d3ebdd47d80dd15ec9d81c77206f919d to your computer and use it in GitHub Desktop.
Save asksven/d3ebdd47d80dd15ec9d81c77206f919d to your computer and use it in GitHub Desktop.

Revisions

  1. asksven created this gist Mar 19, 2023.
    54 changes: 54 additions & 0 deletions deployment.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: nginx
    name: nginx-deployment
    spec:
    progressDeadlineSeconds: 600
    replicas: 2
    revisionHistoryLimit: 2
    selector:
    matchLabels:
    app: nginx
    strategy:
    rollingUpdate:
    maxSurge: 25%
    maxUnavailable: 25%
    type: RollingUpdate
    template:
    metadata:
    creationTimestamp: null
    labels:
    app: nginx
    spec:
    containers:
    - image: nginxinc/nginx-unprivileged:1.16
    imagePullPolicy: IfNotPresent
    name: nginx
    ports:
    - containerPort: 80
    protocol: TCP
    resources:
    limits:
    cpu: 100m
    memory: 10Mi
    requests:
    cpu: 80m
    memory: 4Mi
    securityContext:
    allowPrivilegeEscalation: false
    capabilities:
    drop:
    - NET_RAW
    readOnlyRootFilesystem: true
    runAsNonRoot: true
    volumeMounts:
    - mountPath: /tmp
    name: tmp
    securityContext:
    fsGroup: 2000
    runAsUser: 999
    volumes:
    - emptyDir: {}
    name: tmp
    17 changes: 17 additions & 0 deletions ingress.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    name: status
    spec:
    ingressClassName: nginx
    rules:
    - host: status.asksven.local
    http:
    paths:
    - backend:
    service:
    name: nginx-svc
    port:
    number: 80
    path: /
    pathType: Prefix
    14 changes: 14 additions & 0 deletions service.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    apiVersion: v1
    kind: Service
    metadata:
    creationTimestamp: null
    name: nginx-svc
    spec:
    ports:
    - port: 80
    protocol: TCP
    targetPort: 8080
    selector:
    app: nginx
    sessionAffinity: None
    type: ClusterIP