python客户端登录容器

#nginx:
location / {
	alias  D:\\workplace\\UI\\dist\\;
}
location /api/ws/{
	proxy_pass http://127.0.0.1:9090/ws/;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection "upgrade";
}
location /api/ {
	proxy_pass http://127.0.0.1:9090/;
}

#code:
urlpatterns.append(path('', RedirectView.as_view(url='/')))

#websocket
application = ProtocolTypeRouter({
    "websocket": AuthMiddlewareStack(
        URLRouter([
            # URLRouter just takes standard Django path() or url() entries.
            path("ws/clusters//look/", K8SLoginIn),
        ]),
    ),
})
#登录容器
container_stream = stream(
            self.V1.connect_get_namespaced_pod_exec,
            name=pod_name,
            namespace=namespace,
            container=container,
            command=command,
            stderr=True, stdin=True,
            stdout=True, tty=True,
            _preload_content=False
        )

 

你可能感兴趣的:(k8s,k8s)