SpotiByeAds icon indicating copy to clipboard operation
SpotiByeAds copied to clipboard

Unable to deploy on Kubernetes

Open kopal2212 opened this issue 4 years ago • 15 comments

I am trying to deploy Hygieia on Kubernetes but I am unable to do it. I have successfully deployed the Hygieia UI on K8s but unable to get the API and mongo working together. FYI, I am using MongoDB replica sets in k8s. Also, I am unable to figure out what should I write in api.properties(dbhost: ) I tried with the service name of mongo and the label of service of mongo pod, but still no success. If someone has deployed it on k8s or has some documentation, please share.

kopal2212 avatar Mar 02 '20 05:03 kopal2212

we are lookin for help in this area. If you find success we would greatly appreciate

rvema avatar Mar 06 '20 06:03 rvema

Use below env on your deployment files. API_HOST, API_PORT, DB_HOST, DB_PORT

ramachittala avatar Mar 10 '20 07:03 ramachittala

Hi! Im also working on this. Should we setup a meeting somehow someday?

cmarquezrusso avatar Mar 12 '20 11:03 cmarquezrusso

I've managed to run these services on kubernetes:

  • API
  • UI
  • Audit-API
  • Jira Collector
  • GitHub Collector

There are some caveats regarding the state for the collectors and scaling them up, but it works!

I am currently working on the AWS Collector for the Cloud view and I will create helm charts for the deployment.

Did you manage to deploy this?

cmarquezrusso avatar Mar 17 '20 08:03 cmarquezrusso

Hello @cristian04, sounds cool. I was able to deploy API, UI in Kubernetes but when I was trying to signup in my dashboard I was getting error user already exists, i also increases the auth. expiration time still the same issue, Later I figure out I had some cors issue as well so I solved it anyhow but then when i tried to signup, it took me to the home page with a cross sign-on API connectivity. Problem is UI ana Api are working fine individually but when api is getting called via ui its not working fine, basically ui pod and api pod is not able to communicate properly

kopal2212 avatar Mar 18 '20 08:03 kopal2212

It would be really helpful @cristian04 if u share your deployment, service, and ingress YAML files. And one thing more are u using replica sets for MongoDB pods?

kopal2212 avatar Mar 18 '20 08:03 kopal2212

Hi we have deployed on kubernetes and that are working fine

This would be the file for hygieia-ui deployment

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: hygieia-ui
  labels:
    app: hygieia-ui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hygieia-ui
  template:
    metadata:
      labels:
        name: hygieia-ui
        app: hygieia-ui
    spec:
      hostname: hygieia-ui
      containers:
      - name: hygieia-ui
        image: <image name here>
        imagePullPolicy: IfNotPresent
        env:
        - name: API_HOST
          value: "hygieia-api"
        - name: API_PORT
          value: <port for api>
        resources:
            limits:
              cpu: <max cpu needed >
              memory: <max mem needed>
            requests:
              cpu: <min cpu needed >
              memory: <min mem needed>
        ports:
        - containerPort: <port>

Ayush-Goyal-coding avatar May 06 '20 09:05 Ayush-Goyal-coding

Thanks @Ayush-Goyal-coding for sharing for deployment file, but are you using the replica sets for MongoDb?

kopal2212 avatar May 06 '20 10:05 kopal2212

@kopal2212 no We can't have replica sets of mongodb pod it seems

There is some documentation on mongodb official page check that out and let me know if that's useful

Ayush-Goyal-coding avatar May 06 '20 13:05 Ayush-Goyal-coding

@Ayush-Goyal-coding Thanks but it is not like that, For High Availability, we often use multiple MongoDB pods. So for Hygieia also I did the same, deployed multiple pods of MongoDB in K8s with stateful sets, but I am stuck with the communication with the pods. Let me figure out if i can have a workaround for it. Alternatively, I have deployed Hygieia on EC2 by configuring the collectors as services with Systemd. It is also working fine for now.

kopal2212 avatar May 06 '20 17:05 kopal2212

Hi all! Apologies for the delay sharing my manifests. Please find them on this repo: https://github.com/clvr-cloud/hygiea-devops-poc

cmarquezrusso avatar May 07 '20 04:05 cmarquezrusso

Thanks @cristian04

kopal2212 avatar May 07 '20 07:05 kopal2212

Thanks @cristian04

Ayush-Goyal-coding avatar May 08 '20 07:05 Ayush-Goyal-coding

Thanks @kopal2212 for your comments too

Ayush-Goyal-coding avatar May 08 '20 07:05 Ayush-Goyal-coding

Hi @kopal2212 I am trying to deploy Hygieia dashboard on k8s but not able to do so!! can you please share the Hygieia - UI and api deployment yaml and service yaml file so that I can refer that for deploying in K8s... It will be great help!!!

Kishore-kalastri avatar Jun 04 '21 09:06 Kishore-kalastri