jenkins - Kubernetes 在版本“extensions/v1beta1”中没有匹配类型“部署”
问题描述
我正在尝试使用 Jenkins 在 Kubernetes 中部署下一个 frontend-deployment.yaml,但我遇到了下一个错误:
[frontend] Running shell script
+ kubectl apply -f IKonnekt/frontend-deployment.yaml
error: unable to recognize "IKonnekt/frontend-deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
如果我kubectl apply -f IKonnekt/frontend-deployment.yaml
从 Kubernetes 集群内的机器运行,它工作正常。
Kubernetes Client Version: 1.12.1
Kubernetes Server Version: 1.11.0
这是我的前端部署.yaml:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ikonnekt-frontend-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: ikonnekt-frontend
spec:
containers:
- name: ikonnekt-frontend
image: ikonnektfrontend
imagePullPolicy: Always
env:
- name: REACT_APP_API
value: "http://IP:Port"
- name: REACT_APP_AUTH_ENDPOINT
value: "http://IP:Port/auth"
ports:
- containerPort: 80
imagePullSecrets:
- name: regcred
解决方案
只需将apiVersion更改为:apiVersion: apps/v1
推荐阅读
- html - 给它一个边框后按钮不再可点击
- python - 如何让笛卡尔积过滤出具有重复结果的元组对?
- groovy - Groovy - 插入方法后没有方法签名
- python - 在 tkinter 中调整画布大小和重绘画布
- java - Jframe.setContentPane(new JLabel([image])); 构建 .jar 后背景图像未加载
- java - 如何将文本换行数字?
- c# - C# - 方法签名中的泛型类型 - 为什么 CS1503,“无法从 IThing 转换为 ns.IThing”?
- java - 如何以编程方式获取音乐专辑封面
- c - C - 如何使用带有格式化字符串的 sscanf?
- azure - 应用程序的 Azure Active Directory 组声明