我正在努力使用Helm Charts和Gitlab Auto Devops将应用程序部署到GKE。我觉得我已经取得了很大的进步,但是我已经达到了我似乎无法弄清的东西。
我现在只有两个阶段,即“构建”和“生产”。在“生产”阶段,它在使用消息Error from server (NotFound): deployments.extensions "production" not found
部署到Kubernetes后失败。我看过类似的SO问题,但似乎无法将其解决方案与我的环境相匹配。我是整个kubernetes的新手,正在竭尽全力将事情拼凑在一起,一次解决一个问题...而且有很多问题!
这是我的deployment.yml
文件。我使用kompose开始使用Helm图表。
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c
kompose.version: 1.19.0 ()
creationTimestamp: null
labels:
io.kompose.service: api
name: api
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
namespace: {{ .Release.Namespace }}
annotations:
kompose.cmd: kompose convert -c
kompose.version: 1.19.0 ()
creationTimestamp: null
labels:
io.kompose.service: api
spec:
imagePullSecrets:
- name: gitlab-registry
containers:
- image: git.company.com/company/inventory-api
name: api
env:
- name: RAILS_ENV
value: "production"
ports:
- containerPort: 5000
resources: {}
volumeMounts:
- mountPath: /app
name: api-claim0
restartPolicy: Always
volumes:
- name: api-claim0
persistentVolumeClaim:
claimName: api-claim0
status: {}
最佳答案
这里有很多自动化步骤,其中任何一个都可能隐藏了问题。我很想一次运行一个阶段并建立自动化。
例如。我首先尝试通过kubectl从您的计算机手动将yaml list 文件部署到集群。
我还发现,与GitLab Auto DevOps和GitLab Kubernetes集成使用起来特别尴尬,并且倾向于将手动配置与kubetcl一起使用,生产率更高。
关于kubernetes - 来自服务器的错误(未找到):找不到deployments.extensions “production”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59166765/