我正在关注此链接Jenkins
以在Kubernetes
集群上进行设置。当我尝试应用jenkins-svc.yaml
它失败并出现错误。
jenkins-svc.yaml
文件内容如下,
apiVersion: v1
kind: Service
metadata:
name: jenkins-ui-service
namespace: jenkins
spec:
type: ClusterIP # NodePort, LoadBalancer
ports:
- protocol: TCP
port: 8080
targetPort: 8080
# nodePort: 30100
name: ui
selector:
app: jenkins
---
apiVersion: v1
kind: Service
metadata:
name: jenkins-jnlp-service
namespace: jenkins
spec:
type: ClusterIP # NodePort, LoadBalancer
ports:
- port: 50000
targetPort: 50000
selector:
app: jenkins
我尝试申请时遇到的错误jenkins-svc.yaml
。
# kubectl apply -f jenkins-svc.yaml -n jenkins
error: error parsing jenkins-svc.yaml: error converting YAML to JSON: yaml: line 7: did not find expected key
请让我知道如何解决这个问题?