I am trying to create a PVC and mount to my sidecar using MongoDB cr version 1.19.0. When I look at the STS the metadata is empty. Below is an insert from the sts and the sidecar config. Im not sure why the metadata is not being recognized by the sts. Thank you for any insight.
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
spec:
accessModes:- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeMode: Filesystem
- ReadWriteOnce
###################
sidecars:
- image: public.ecr.aws/docker/library/busybox
command: ["/bin/sh"]
args:
- "-c"
- |
trap 'echo "got sigterm" ; exit 0' SIGTERM
tail -n 20 -F /var/lib/mysql/audit.log &
while true; do sleep 1; done
name: audit-tail
resources:
requests:
memory: 100M
cpu: 100m
limits:
memory: 200M
cpu: 200m
volumeMounts:
- mountPath: /data/db
name: mongod-data
- mountPath: /audit
name: audit-mount
#sidecarPVCs:
sidecarPVCs:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: audit-mount
spec:
resources:
requests:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
###ERROR MESSAGE##########
Warning FailedCreate 22h (x20 over 22h) statefulset-controller create Claim -test20-psmdb-db-rs0-0 for Pod test20-psmdb-db-rs0-0 in StatefulSet test20-psmdb-db-rs0 failed error: PersistentVolumeClaim “-test20-psmdb-db-rs0-0” is invalid: metadata.name: Invalid value: “-test20-psmdb-db-rs0-0”: a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, ‘-’ or ‘.’, and must start and end with an alphanumeric character (e.g. ‘example.com’, regex used for validation is ‘a-z0-9?(.a-z0-9?)*’)