Docker run to kubernetes yaml

4/9/2019

I have a docker run command like below:
docker run -it -p 5901:5901 -p 6901:6901 --user 1000 --privileged check-user bash
I would like to cover that command to Kubernetes yaml to create the pod. Please give me some suggestions.

-- The Night Hunter
docker
kubernetes
yaml

1 Answer

4/9/2019

Assuming check-user is name of the docker image

apiVersion: v1
kind: Pod
metadata:
  labels:
    run: check-user
  name: check-user
spec:
  containers:
  - args:
    - bash
    image: check-user
    name: check-user
    ports:
    - containerPort: 5901
    - containerPort: 6901
    tty: true
    stdin: true
    securityContext:
      runAsUser: 1000
      privileged: true
  restartPolicy: Never
-- KitKarson
Source: StackOverflow