简体   繁体   English

无法访问在Kubernetes集群上部署的应用

[英]Not able to access app deployed on kubernetes cluster

I am getting following error while accessing the app deployed on Azure kubernetes service 访问Azure kubernetes服务上部署的应用程序时出现以下错误

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {},
  "code": 403
}

I have followed all steps as given here https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app 我已按照此处给出的所有步骤进行操作https://docs.microsoft.com/zh-cn/azure/aks/tutorial-kubernetes-prepare-app

I know that this is something to do with authentication and RBAC, but i don't know what exactly is wrong and where should i make changes. 我知道这与身份验证和RBAC有关,但是我不知道到底是什么问题以及应该在哪里进行更改。

Just follow the steps in the link you posted. 只需按照您发布的链接中的步骤进行即可。 You will be successful in finishing that. 您将成功完成该任务。 The destination of each step below: 以下每个步骤的目标:

  1. Create the image and make sure it can work without any error. 创建图像并确保其可以正常运行。
  2. Create an Azure Container Registry and push the image into the registry. 创建一个Azure容器注册表并将映像推送到注册表中。
  3. Create a Service Principal for the AKS to let it just can pull the image from the registry. 为AKS创建一个服务主体,使其可以从注册表中提取图像。
  4. Change the yaml file and make it pull the image from the Azure Registry, then crate pods in the AKS nodes. 更改yaml文件,使其从Azure注册表中提取图像,然后在AKS节点中创建容器。

You just need these four steps to run the application on AKS. 您只需要执行以下四个步骤即可在AKS上运行该应用程序。 Then get the IP address through the command kubectl get service azure-vote-front --watch like the step 4. If you can not access the application, check your steps carefully again. 然后,通过命令kubectl get service azure-vote-front --watch获取IP地址,如步骤4所示。如果无法访问该应用程序,请再次仔细检查您的步骤。

Also, you can check all the pods status through the command kubectl describe pods or one pod with kubectl describe pod podName . 同样,您可以通过命令kubectl describe pods或带有kubectl describe pod podName一个Pod检查所有Pod的状态。

Update 更新

I test with the image you provide and the result here: 我用您提供的图片和结果进行测试:

在此处输入图片说明

And you can get the service information and know which port you should use to browse. 您可以获取服务信息,并知道应该使用哪个端口浏览。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问部署在 Kubernetes 集群上的 postgresql - How to access postgresql, deployed on Kubernetes cluster 无法使用kubernetes游乐场访问部署在kubernetes集群上的应用程序 - unable to access the application deployed on kubernetes cluster using kubernetes playground 无法访问 kubernetes 集群中的前端 pod - Not able to access frontend pod in a kubernetes cluster 通过 Kubernetes 部署后如何访问应用程序? - How to access app once deployed via Kubernetes? 无法访问部署在 Azure ACS Kubernetes 集群中的 Web API - Cannot access Web API deployed in Azure ACS Kubernetes Cluster 是否在群集中部署了Kubernetes Ingress对象 - Are Kubernetes Ingress objects deployed in cluster 当 vault 部署在专用集群上时,如何从另一个 kubernetes 集群访问 vault 机密? - How to access vault secrets from another kubernetes cluster when vault is deployed on a dedicated cluster? 访问部署在 Kubernetes 上的应用程序 - Access application deployed on Kubernetes 部署在Kubernetes上的Kafka Producer无法生产在本地计算机上运行的Kafka集群 - Kafka Producer deployed on Kubernetes not able to produce to Kafka cluster running on local machine 无法使用分配的公共IP访问部署在ACS kubernetes群集中的Windows容器? - Windows container deployed in ACS kubernetes cluster not able to be reached using the assigned Public IP?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM