Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
420 views
in Technique[技术] by (71.8m points)

kubernetes - Why am I getting tis OCI runtime error even though deployment is created

My Yaml file looks like this

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb-deployment
  labels:
    app: mongodb
spec:
  replicas: 1
  selector: 
    matchLabels: 
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo
        ports:
        - name: mongodbport
          containerPort: 27017
          protocol: TCP
        env:
        - name: MONGO_INITDB_ROOT_USERNAME
          valueFrom:
            secretKeyRef:
              name: mongodb-secret
              key: mongo-root-username
        - name: MONGO_INITDB_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mongodb-secret
              key: mongo-root-password
          

My secret yaml file

apiVersion: v1
kind: Secret
metadata:
    name: mongodb-secret
type: opaque
data:
    mongo-root-username: JwB2AG8AbABoAGEAcgBkACcA
    mongo-root-password: JwBEAGgAYQBuAHUAcwBoACcA

Error image: Description of error could be found here

There is also a reference for DB credentials if you observe ,if that's needed to debug then I would love to provide. Thanks in advance !

question from:https://stackoverflow.com/questions/65902117/why-am-i-getting-tis-oci-runtime-error-even-though-deployment-is-created

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Something is wrong with your secret. Are you trying to store binary value or null byte in your secret?

Please take a look: https://github.com/kubernetes/kubernetes/issues/89906


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...