Skip to content

Instantly share code, notes, and snippets.

@ccollicutt
Created September 26, 2018 20:30
Show Gist options
  • Select an option

  • Save ccollicutt/3985699e0ea93c675fa5e3ffae0db1db to your computer and use it in GitHub Desktop.

Select an option

Save ccollicutt/3985699e0ea93c675fa5e3ffae0db1db to your computer and use it in GitHub Desktop.

Revisions

  1. ccollicutt created this gist Sep 26, 2018.
    26 changes: 26 additions & 0 deletions deployment securitycontext runasuser
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: web-dep
    labels:
    tier: frontend
    annotations:
    AppVersion: "3.4"
    spec:
    replicas: 2
    selector:
    matchLabels:
    app: nginx
    template:
    metadata:
    labels:
    app: nginx
    spec:
    securityContext:
    runAsUser: 1000
    containers:
    - name: nginx
    image: nginx:1.7.9
    ports:
    - containerPort: 80
    command: ["sleep", "1000"]