有什么问题吗?
我无法运行我的吊舱,因为它使用的是一个卷。在Kubernetes仪表板中,我得到了以下错误:
运行用于pod的"VolumeBinding“过滤器插件”influxdb 6979bff6f9-hpf89 89“:pod有未绑定的即时PersistentVolumeClaims
我做错什么了?
在将Kompose convert运行到我的docker-compose.yml文件后,我尝试用micro8ks kubectl apply -f . (我正在使用micro8ks)启动pods,我不得不用networking.k8s.io/v1替换networkpolicy yaml文件的版本(参见这里),但除了这个更改之外,我没有做任何更改。
YAML档案
influxdb-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: ./kompose convert
kompose.version: 1.21.0 (992df58d8)
creationTimestamp: null
labels:
io.kompose.service: influxdb
name: influxdb
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: influxdb
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: ./kompose convert
kompose.version: 1.21.0 (992df58d8)
creationTimestamp: null
labels:
io.kompose.network/cloud-net: "true"
io.kompose.network/default: "true"
io.kompose.service: influxdb
spec:
containers:
- env:
- name: INFLUXDB_HTTP_LOG_ENABLED
value: "false"
image: influxdb:1.8
imagePullPolicy: ""
name: influxdb
ports:
- containerPort: 8086
resources: {}
volumeMounts:
- mountPath: /var/lib/influxdb
name: influx
restartPolicy: Always
serviceAccountName: ""
volumes:
- name: influx
persistentVolumeClaim:
claimName: influx
status: {} influxdb-service.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: ./kompose convert
kompose.version: 1.21.0 (992df58d8)
creationTimestamp: null
labels:
io.kompose.service: influxdb
name: influxdb
spec:
ports:
- name: "8087"
port: 8087
targetPort: 8086
selector:
io.kompose.service: influxdb
status:
loadBalancer: {} influx-persistenvolumeclaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: influx
name: influx
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {} 发布于 2020-06-23 15:04:13
如果集群没有可以动态提供PersistentVolumeClaim的StorageClass,或者没有手动创建的PersistentVolume来满足PersistentVolumeClaim,则PersistentVolumeClaim将被解除绑定。
要解决当前的情况,可以手动创建PV。
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"请注意,hostPath的使用只是一个例子。它不建议用于生产使用。考虑使用支持类型这里的外部块或文件存储。
https://stackoverflow.com/questions/62537761
复制相似问题