In a VMbased Kubernetes deployment, the Python HTTP server running on the deployment host gets stopped, because of which the download of binaries from the deployment host to the Cluster Nodes fails and the deployment also fails.

In the Kubernetes, install Ansible log file, the below messages indicating that the HTTP server is not reachable appears.

mirror”: “http://<DeploymentHost-IP>:8000/runc.amd64”,
 “msg”: “Status code was 404 and not [200]: HTTP Error 404: Not Found”
Alternately, you can run the below command to confirm if the Python HTTP Server is running:
Command: curl <deployment_host_ip>:8000

If the output of the above command doesn’t consist of a directory listing, then it indicates that the HTTP server is not running.

Workaround:
  1. You can start the Python HTTP Server using any of the below approach.
    Navigate to the below directory inside the Deployment container of the Deployment Host and execute the below command to start the Python HTTP Server.
    cd /root/k8s-installer/
    ansible-playbook scripts/ansible/prepare.yml --tags python-web-server -e @scripts/ansible/vars.yml --become
    

    OR

    Alternately, you can also use the below command to start the Python HTTP Server:
    cd /root/k8s-installer/cluster/pkg/infra
    nohup python3 -m http.server 8000 >> /opt/python-webserver.log 2>&1 &
    Note: If additional verbose logging is required, then "-v" option needs to be appended to the command.

    For example: nohup python3 -m http.server 8000 -v >> /opt/python-webserver.log 2>&1 &

  2. Re-trigger the Kubernetes deployment inside the deployment container using the command:
    cd /root/k8s-installer/
    ansible-playbook -i inventory/<your-cluster-name>/hosts.yml scripts/ansible/deploy_k8s.yml -u <your-SSH-username> --become -e @scripts/ansible/internal_vars.yml -e @scripts/ansible/vars.yml