文档说我需要输入pod,但是我不能。
sudo kubectl get pods -n kube-system
给我以下输出:
coredns-66bff467f8-bhwrx 1/1 Running 4 10h
coredns-66bff467f8-ph2pb 1/1 Running 4 10h
etcd-ubuntu-xenial 1/1 Running 3 10h
ingress-nginx-admission-create-mww2h 0/1 Completed 0 4h48m
ingress-nginx-admission-patch-9dklm 0/1 Completed 0 4h48m
ingress-nginx-controller-7bb4c67d67-8nqcw 1/1 Running 1 4h48m
kube-apiserver-ubuntu-xenial 1/1 Running 3 10h
kube-controller-manager-ubuntu-xenial 1/1 Running 3 10h
kube-proxy-hn9qw 1/1 Running 3 10h
kube-scheduler-ubuntu-xenial 1/1 Running 3 10h
storage-provisioner 1/1 Running 4 10h
当我尝试输入sudo kubectl exec ingress-nginx-controller-7bb4c67d67-8nqcw -- /bin/bash/
时,出现以下错误:
Error from server (NotFound): pods "ingress-nginx-controller-7bb4c67d67-8nqcw" not found
之所以我使用sudo运行所有内容的原因是因为我正在使用vm-dirver=none
之所以需要知道入口控制器的版本,是因为我想在主机名中使用通配符将多个子域转发到同一服务/端口。而且我知道此功能仅在入口控制器版本1.18中可用。
答案 0 :(得分:1)
由于未传递名称空间参数(def form_valid(self, form):
vote, created = Rate.objects.get_or_create(
sender=self.request.user,
person=self.get_object(),
choice=form.cleaned_data['choice'])
if not created:
Rate.objects.filter(sender=self.request.user, person=self.get_object()).update(choice=form.cleaned_data['choice'])
return super(PersonDetailView, self).form_valid(form)
else:
return super(PersonDetailView, self).form_valid(form)
)而收到该错误。
要获取版本,您可以这样做:
-n kube-system