docker run command change to .yaml file

2/24/2016

below is my start container docker run command:

docker run -it -d --name=aaa--net=host -v /opt/headedness/phantomjs:/data/phantomjs/bin/phantomjs -v /opt/ctcrawler/log:/data/log XXX/app/aaa:latest -id aaa -endpoint http://localhost:8080/c2/ -selenium http://localhost:4444/wd/hub

How to change it to a yaml file? I have try many ways,but still can`t working... below is my .yaml file(pls help...)

apiVersion: v1
kind: Pod
metadata:
  name: aaa
spec:
  containers:
    - name: aaa
      image: xxx/app/aaa:latest
      net: "host"
      args:
      - -id: aaa
      - -phantomjs: /data/phantomjs/bin/phantomjs
      - -capturedPath: /data/log
      - -endpoint: http://wwww/c2/
      - -selenium: http://localhost:4444/wd/hub
      - -proxy: n/a
      imagePullPolicy: Always
  imagePullSecrets:
    - name: myregistrykey
-- david guo
docker
kubernetes

1 Answer

2/24/2016

Your Spec is invalid. For host network set spec.securityContext.HostNetwork: true Use hostPath volumes to mount directories on the host. If it is configuration data, you can use a gitRepo volume or ConfigMap starting from v1.2.

-- Vishnu Kannan
Source: StackOverflow