Skip to content
Snippets Groups Projects
  • Liz Rice's avatar
    08097d22
    Need credentials in order to run kubectl version (#332) · 08097d22
    Liz Rice authored
    Without passing in kubeconfig credentials:
    
    ```bash
    $ docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -v $(which kubectl):/usr/bin/kubectl -t lizrice/kube-bench:5e6cdfdb master -v 1
    I0628 16:52:06.591683    6099 util.go:367] Unable to get Kubernetes version from kubectl, using default version: 1.6
    I0628 16:52:06.591822    6099 common.go:74] Using benchmark file: cfg/1.6/master.yaml
    ...
    ```
    As updated in the README with this fix:
    
    ```bash
    docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -v $(which kubectl):/usr/bin/kubectl -v ~/.kube:/.kube -e KUBECONFIG=/.kube/config -t lizrice/kube-bench:5e6cdfdb master -v 1
    I0628 16:53:26.784122    7224 util.go:131] No test file found for 1.14 - using tests for Kubernetes 1.13
    I0628 16:53:26.784961    7224 common.go:228] Using config file: cfg/1.13/config.yaml
    ...
    ```
    08097d22
    History
    Need credentials in order to run kubectl version (#332)
    Liz Rice authored
    Without passing in kubeconfig credentials:
    
    ```bash
    $ docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -v $(which kubectl):/usr/bin/kubectl -t lizrice/kube-bench:5e6cdfdb master -v 1
    I0628 16:52:06.591683    6099 util.go:367] Unable to get Kubernetes version from kubectl, using default version: 1.6
    I0628 16:52:06.591822    6099 common.go:74] Using benchmark file: cfg/1.6/master.yaml
    ...
    ```
    As updated in the README with this fix:
    
    ```bash
    docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -v $(which kubectl):/usr/bin/kubectl -v ~/.kube:/.kube -e KUBECONFIG=/.kube/config -t lizrice/kube-bench:5e6cdfdb master -v 1
    I0628 16:53:26.784122    7224 util.go:131] No test file found for 1.14 - using tests for Kubernetes 1.13
    I0628 16:53:26.784961    7224 common.go:228] Using config file: cfg/1.13/config.yaml
    ...
    ```