英文:
Problem running Micronaut example in my own environment
问题
我正在尝试在我的环境中运行以下存储库:https://github.com/piomin/sample-micronaut-kubernetes
我使用 kubectl apply -f file.yaml
命令在每个 k8s 目录中应用了 kubernetes yamls 文件,就像教程中所示我还执行了以下命令:
kubectl create clusterrolebinding admin --clusterrole=cluster-admin --serviceaccount=default:default
教程链接:https://piotrminkowski.com/2020/01/07/guide-to-micronaut-kubernetes/
当我在 employee 文件夹上运行 Skaffold dev 时,会出现以下错误:
- 无法解码 "STDIN":在 "{...}" 中缺少对象 'Kind'。
- 无法解码 "STDIN":在 "{...}" 中缺少对象 'Kind'。
看起来两个数据部分确实都缺少了 Kind,这里的 kind 值应该是什么?我相信我的版本比教程中使用的版本更新。有没有网站或参考资料可以帮我解决这些差异?
- Minikube 版本为 1.29.0
- Skaffold 版本为 2.1.0
- Kubectl:客户端版本为 v1.26.1
Kustomize 版本为 v4.5.7
服务器版本为 v1.26.1
英文:
I am trying to run the following repository in my own environment:
https://github.com/piomin/sample-micronaut-kubernetes
I applied the kubernetes yamls file in each k8s directory using kubectl apply -f file.yaml
as indicated in the tutorial I also did
kubectl create clusterrolebinding admin --clusterrole=cluster-admin --serviceaccount=default:default
tutorial is available at https://piotrminkowski.com/2020/01/07/guide-to-micronaut-kubernetes/
when I run Skaffold dev on the employee folder I will get the error:
- unable to decode "STDIN": Object 'Kind' is missing in '{"data":{"application.yaml":"mongodb:\n collection: employee\n database: admin\nin-memory-store.enabled: true\ntest.employees:\n - id: 1\n organizationId: 1\n departmentId: 1\n name: John Smith\n age: 22\n position: Developer\n - id: 2\n organizationId: 1\n departmentId: 2\n name: Paul Walker\n age: 33\n position: Tester"}}'
- unable to decode "STDIN": Object 'Kind' is missing in '{"data":{"mongodb.uri":"bW9uZ29kYjovL21pY3JvbmF1dDptaWNyb25hdXRfMTIzQG1vbmdvZGI6MjcwMTcvYWRtaW4="}}'
It does look like Kind is indeed missing in both data sections, what should be the value of kind here? I believe my version of kubernetes is more recent than the one used in the tutorial. Is there any website/reference I could use to fix the discrepencies?
- Minikube is 1.29.0
- Skaffold is 2.1.0
- Kubectl: Client Version: v1.26.1
Kustomize Version: v4.5.7
Server Version: v1.26.1
答案1
得分: 0
问题是文件使用了Windows换行符而不是Unix换行符...
英文:
The problem was that the file was using windows line endings instead of unix line endings...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论