我创建了一个部署,并为该部署创建了一个 HPA(单节点 minikube 集群)。但是当我运行时kubectl get hpa,它显示目标为未知(下面的屏幕截图)
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
producer Deployment/producer <unknown>/1% 1 3 1 42m
Run Code Online (Sandbox Code Playgroud)
以下是deployment.yaml文件:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.1.0 (36652f6)
creationTimestamp: null
labels:
io.kompose.service: producer
name: producer
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: producer
spec:
containers:
- image: <image name>
name: producer
ports:
- containerPort: 8090
env:
- name: mongoUrl
value: mongodb://mongo:27017
- name: mongoHost
value: mongo
- name: mongoPort …Run Code Online (Sandbox Code Playgroud) 我尝试根据 vscode 中的 minikube 状态栏启动 minikube。
但它给了我一个错误:
启动 Minikube 时出错。错误: !指定的 Kubernetes 版本 1.10.0 小于支持的最旧版本: v1.13.0 ,!您可以通过 --force 标志强制不支持的 Kubernetes 版本,X 由于 K8S_OLD_UNSUPPORTED 退出:此版本的 minikube 不支持 Kubernetes 1.10.0
我已经通过brew install minikube命令安装了 minikube 。
当我尝试从命令启动 minikube 时:
minikube start
minikube v1.14.0 on Darwin 10.13.6
? Specified Kubernetes version 1.10.0 is less than the oldest supported version: v1.13.0
? You can force an unsupported Kubernetes version via the --force flag
? Exiting due to K8S_OLD_UNSUPPORTED: Kubernetes 1.10.0 is not supported …Run Code Online (Sandbox Code Playgroud) 我正在使用kubernetes在minikube. 使用命令部署后
minikube service helloworld-all-service --url
Run Code Online (Sandbox Code Playgroud)
其中显示了一些URL访问应用程序。就像是
http://192.168.49.2:32474
Run Code Online (Sandbox Code Playgroud)
我要从同一网络上的另一台计算机访问该应用程序。我试过port-forwarding
kubectl port-forward service/helloworld-all-service 8080:8080
Run Code Online (Sandbox Code Playgroud)
这允许我使用 访问应用程序localhost:8080/myApp。但是当我尝试使用我的系统 IP 时,它不起作用10.14.77.88:8080/myApp。我在这里做错了什么
I have two services deployed on the same k8s (minikube cluster). What is the url/approach I should use for one service to communicate with another service. I tried searching a bit on the web but most of them are communicating with an external db which is not what I'm after. This is what my deployments look like. I am looking for the goclient to be able to communicate with goserver. I know I need to go through the service but …
当我运行命令时出现以下错误minikube start:
无法选择默认驱动程序。以下是按优先顺序考虑的内容:
\n\xe2\x96\xaa docker: 不健康: "docker version --format {{.Server.Os}}-{{.Server.Version}}" exit status 1 :尝试连接到位于 unix:///var/run/docker.sock 的 Docker 守护程序套接字时权限被拒绝:获取“http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version”:拨号unix /var/run/docker.sock: 连接: 权限被拒绝
\n\xe2\x96\xaa docker: 建议: 将您的用户添加到 \'docker\' 组: \'sudo usermod -aG docker $USER && newgrp docker \' https://docs.docker.com/engine/install/linux-postinstall/ \n 或者,您可以安装以下驱动程序之一:
\n\xe2\x96\xaa kvm2:未安装:exec:“virsh”:在 $PATH \n\xe2\x96\xaa 中找不到可执行文件
vmware:未安装:exec:“docker-machine-driver-vmware”:在 $PATH \n\xe2\x96\xaa 中找不到可执行文件
podman:未安装安装:exec:“podman”:在 $PATH \n\xe2\x96\xaa 中找不到可执行文件
virtualbox:未安装:无法在 $PATH 中找到 VBoxManage
\xe2\x9d\x8c 由于 DRV_NOT_HEALTHY 而退出:找到驱动程序,但没有一个是健康的。有关如何修复已安装驱动程序的建议,请参阅上文。
\n我正在使用以下命令将新存储修补到volumeclaimtemplate:
minikube kubectl -- --namespace default patch pvc elasticsearch-data-elasticsearch-data-0 --patch '{\"spec\": {\"volumeClaimTemplate\": {\"requests\": {\"storage\": \"2Gi\"}}}}'
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误:
error: unable to parse "'{\"spec\":": YAML: found unexpected end of stream.
Run Code Online (Sandbox Code Playgroud)
我应该使用另一个转义字符而不是“”吗?请帮忙。
我正在尝试使用 Kubernetes 和 minikube 部署应用程序。但我有一个奇怪的问题:我可以在终端中使用curl 访问我的应用程序,但不能从浏览器访问我的应用程序。我正在使用“minikubetunnel”命令作为外部IP。
这是我的部署和服务文件
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodeapp-deployment
labels:
app: nodeapp
spec:
replicas: 1
selector:
matchLabels:
app: nodeapp
template:
metadata:
labels:
app: nodeapp
spec:
containers:
- name: nodeserver
image: tanyadovzhenko/chi-questionnaire-back
env:
- name: PORT
value: "4000"
- name: JWT_ACCESS_KEY
value: "111"
- name: JWT_REFRESH_KEY
value: "111"
- name: HASH_PASSWORD_ALGORITM
value: "sha256"
ports:
- containerPort: 4000Run Code Online (Sandbox Code Playgroud)
apiVersion: v1
kind: Service
metadata:
name: nodeapp-service
spec:
selector:
app: nodeapp
type: LoadBalancer
ports:
- protocol: TCP
port: 4000 …Run Code Online (Sandbox Code Playgroud)我已经使用Docker了一段时间进行了一些开发。现在,我正在尝试使用Kubernetes.
在某些课程中,我找到了我应该运行的信息
eval $(minikube docker-env)
Run Code Online (Sandbox Code Playgroud)
这将注册一些环境变量:DOCKER_TLS_VERIFY,DOCKER_HOST,DOCKER_CERT_PATH和DOCKER_API_VERSION。它会做什么?这不会破坏我与主机的默认值的日常工作吗?
另外,是否可以以某种方式为我的本地 Docker 切换上下文/配置kubectl config use-context?
我知道,它们基本上是相同的,区别在于当你在本地进行操作以及 Minikube 具有的功能类型时,但一定还有其他正确的地方,为什么人们更喜欢其中一个或另一个,Kubernetes 如何成为这另外两个工具的一部分?
我想安装 minikube,在启动命令后出现以下错误文本:
\n minikube v1.26.1 on Ubuntu 22.04\n\xe2\x9d\x97 minikube skips various validations when --force is supplied; this may lead to unexpected behavior\n\xe2\x9c\xa8 Using the docker driver based on existing profile\n The "docker" driver should not be used with root privileges. If you wish to continue as root, use --force.\n If you are running minikube within a VM, consider using --driver=none:\n https://minikube.sigs.k8s.io/docs/reference/drivers/none/\n Tip: To remove this root owned cluster, run: sudo minikube delete\n Starting control plane node minikube in cluster minikube\n …Run Code Online (Sandbox Code Playgroud) 我执行了这个命令: $ kubectl get services -n demo1
它返回了此服务列表
服务清单
请告诉我如何删除该服务
service kubernetes google-kubernetes-engine kubectl minikube
minikube ×11
kubernetes ×10
docker ×5
kubectl ×2
containers ×1
deployment ×1
devops ×1
docker-swarm ×1
service ×1