简体   繁体   中英

deploy Restheart at kubernetes running mongodb sharded db

I have a running mongodb using sharding. I have made all the services i need, and i have mongodb uri to connect to mongos router. Now i want to use restheart container for http requests. I tried this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: restheart
  labels:
    app: restheart
spec:
  replicas: 1
  selector:
    matchLabels:
      app: restheart
  template:
    metadata:
      labels:
        app: restheart
    spec:
      containers:
      - name: restheart-demo
        image: softinstigate/restheart
        #command:
                #- "--envFile /opt/restheart/etc/default.properties"
        ports:
        - containerPort: 8080
          protocol: TCP
        env:
        - name: MONGO_URI
          value: "mongodb://(uri here)"

then i used:

kubectl expose deploy restheart  --port 8080 --type NodePort

but get Requests return 401 code. I have to mention here that at my mongo uri i also included username:password, so that restheart not need to authenticate. how can i change the default settings of restheart at my yaml so that i can use it properly. There no documentation at all for restheart running at kubernetes My problem is that i dont know how to configure restheart when building my deploy with yaml file

If you will check this URL .

You can see default value for mongo-uri = mongodb://127.0.0.1 You cant override this with environment variable. Instead, use volume mounts to replace that specific file with a configmap containing this file with changes and things should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM