Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
422 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...