Skip to content

Commit

Permalink
update logs and deployment manifests (#3176)
Browse files Browse the repository at this point in the history
* update logs and deployment manifests

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* updated okteto manifest

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>
  • Loading branch information
gdsoumya authored Aug 27, 2021
1 parent a69bd5c commit 7a88df7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 933 deletions.
746 changes: 0 additions & 746 deletions litmus-portal/cluster-agents/subscriber/go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ClusterConnect(clusterData map[string]string) {

c, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
if err != nil {
logrus.Fatal("dial:", err)
logrus.WithError(err).Fatal("failed to open websocket connection")
}
defer c.Close()

Expand All @@ -39,12 +39,12 @@ func ClusterConnect(clusterData map[string]string) {
}
data, err := json.Marshal(payload)
if err != nil {
logrus.WithError(err).Fatal("failed to write message")
logrus.WithError(err).Fatal("failed to marshal message")
}

err = c.WriteMessage(websocket.TextMessage, data)
if err != nil {
logrus.WithError(err).Fatal("failed to write message")
logrus.WithError(err).Fatal("failed to write message after init")
return
}

Expand All @@ -56,7 +56,7 @@ func ClusterConnect(clusterData map[string]string) {
data, err = json.Marshal(payload)
err = c.WriteMessage(websocket.TextMessage, data)
if err != nil {
logrus.WithError(err).Fatal("failed to write message")
logrus.WithError(err).Fatal("failed to write message after start")
return
}
}()
Expand Down
6 changes: 3 additions & 3 deletions litmus-portal/cluster-agents/subscriber/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ func init() {

isConfirmed, newKey, err := k8s.IsClusterConfirmed()
if err != nil {
logrus.Fatal(err)
logrus.WithError(err).Fatal("failed to check cluster confirmed status")
}

if isConfirmed == true {
clusterData["ACCESS_KEY"] = newKey
} else if isConfirmed == false {
clusterConfirmByte, err := k8s.ClusterConfirm(clusterData)
if err != nil {
logrus.Fatal(err)
logrus.WithError(err).WithField("data", string(clusterConfirmByte)).Fatal("failed to confirm cluster")
}

var clusterConfirmInterface types.Payload
err = json.Unmarshal(clusterConfirmByte, &clusterConfirmInterface)
if err != nil {
logrus.Fatal(err)
logrus.WithError(err).WithField("data", string(clusterConfirmByte)).Fatal("failed to parse cluster confirm data")
}

if clusterConfirmInterface.Data.ClusterConfirm.IsClusterConfirmed == true {
Expand Down
71 changes: 11 additions & 60 deletions litmus-portal/cluster-k8s-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,10 @@ metadata:
name: litmus-portal-admin-config
namespace: litmus
data:
AgentScope: cluster
AgentNamespace: litmus
DataBaseServer: "mongodb://mongo-service:27017"
JWTSecret: "litmus-portal@123"
AGENT_SCOPE: cluster
AGENT_NAMESPACE: litmus
DB_SERVER: "mongodb://mongo-service:27017"
JWT_SECRET: "litmus-portal@123"
DB_USER: "admin"
DB_PASSWORD: "1234"
VERSION: "ci"
Expand Down Expand Up @@ -497,7 +497,7 @@ spec:
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentScope
key: AGENT_SCOPE
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -541,48 +541,16 @@ spec:
containers:
- name: graphql-server
image: litmuschaos/litmusportal-server:ci
envFrom:
- configMapRef:
name: litmus-portal-admin-config
env:
- name: VERSION
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: VERSION
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DataBaseServer
- name: JWT_SECRET
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: JWTSecret
- name: SELF_CLUSTER
value: "true"
- name: AGENT_SCOPE
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentScope
- name: AGENT_NAMESPACE
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentNamespace
- name: LITMUS_PORTAL_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: DB_USER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_USER
- name: DB_PASSWORD
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_PASSWORD
- name: PORTAL_SCOPE
value: "cluster"
- name: SUBSCRIBER_IMAGE
Expand Down Expand Up @@ -620,29 +588,12 @@ spec:
imagePullPolicy: Always
- name: auth-server
image: litmuschaos/litmusportal-auth-server:ci
envFrom:
- configMapRef:
name: litmus-portal-admin-config
env:
- name: STRICT_PASSWORD_POLICY
value: "false"
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DataBaseServer
- name: JWT_SECRET
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: JWTSecret
- name: DB_USER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_USER
- name: DB_PASSWORD
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_PASSWORD
- name: ADMIN_USERNAME
value: "admin"
- name: ADMIN_PASSWORD
Expand Down
71 changes: 11 additions & 60 deletions litmus-portal/namespaced-k8s-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ kind: ConfigMap
metadata:
name: litmus-portal-admin-config
data:
AgentScope: namespace
AgentNamespace: ${LITMUS_PORTAL_NAMESPACE}
DataBaseServer: "mongodb://mongo-service:27017"
JWTSecret: "litmus-portal@123"
AGENT_SCOPE: namespace
AGENT_NAMESPACE: ${LITMUS_PORTAL_NAMESPACE}
DB_SERVER: "mongodb://mongo-service:27017"
JWT_SECRET: "litmus-portal@123"
DB_USER: "admin"
DB_PASSWORD: "1234"
VERSION: "ci"
Expand Down Expand Up @@ -503,7 +503,7 @@ spec:
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentScope
key: AGENT_SCOPE
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -537,48 +537,16 @@ spec:
containers:
- name: graphql-server
image: litmuschaos/litmusportal-server:ci
envFrom:
- configMapRef:
name: litmus-portal-admin-config
env:
- name: VERSION
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: VERSION
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DataBaseServer
- name: JWT_SECRET
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: JWTSecret
- name: LITMUS_PORTAL_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SELF_CLUSTER
value: "true"
- name: AGENT_SCOPE
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentScope
- name: AGENT_NAMESPACE
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentNamespace
- name: DB_USER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_USER
- name: DB_PASSWORD
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_PASSWORD
- name: PORTAL_SCOPE
value: "namespace"
- name: AGENT_DEPLOYMENTS
Expand Down Expand Up @@ -608,33 +576,16 @@ spec:
imagePullPolicy: Always
- name: auth-server
image: litmuschaos/litmusportal-auth-server:ci
envFrom:
- configMapRef:
name: litmus-portal-admin-config
env:
- name: STRICT_PASSWORD_POLICY
value: "false"
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DataBaseServer
- name: JWT_SECRET
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: JWTSecret
- name: ADMIN_USERNAME
value: "admin"
- name: ADMIN_PASSWORD
value: "litmus"
- name: DB_USER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_USER
- name: DB_PASSWORD
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_PASSWORD
ports:
- containerPort: 3000
imagePullPolicy: Always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ kind: ConfigMap
metadata:
name: litmus-portal-admin-config
data:
AgentScope: namespace
AgentNamespace: ${OKTETO_NAMESPACE}
DataBaseServer: "mongodb://mongo-service:27017"
JWTSecret: "litmus-portal@123"
AGENT_SCOPE: namespace
AGENT_NAMESPACE: ${OKTETO_NAMESPACE}
DB_SERVER: "mongodb://mongo-service:27017"
JWT_SECRET: "litmus-portal@123"
DB_USER: "admin"
DB_PASSWORD: "1234"
VERSION: "ci"
Expand Down Expand Up @@ -540,45 +540,10 @@ spec:
cpu: 200m
memory: 400Mi
env:
- name: VERSION
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: VERSION
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DataBaseServer
- name: JWT_SECRET
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: JWTSecret
- name: LITMUS_PORTAL_NAMESPACE
value: ${OKTETO_NAMESPACE}
- name: SELF_CLUSTER
value: "true"
- name: AGENT_SCOPE
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentScope
- name: AGENT_NAMESPACE
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: AgentNamespace
- name: DB_USER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_USER
- name: DB_PASSWORD
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_PASSWORD
- name: PORTAL_SCOPE
value: "namespace"
- name: AGENT_DEPLOYMENTS
Expand Down Expand Up @@ -612,29 +577,12 @@ spec:
limits:
cpu: 200m
memory: 250Mi
envFrom:
- configMapRef:
name: litmus-portal-admin-config
env:
- name: STRICT_PASSWORD_POLICY
value: "false"
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DataBaseServer
- name: JWT_SECRET
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: JWTSecret
- name: DB_USER
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_USER
- name: DB_PASSWORD
valueFrom:
configMapKeyRef:
name: litmus-portal-admin-config
key: DB_PASSWORD
- name: ADMIN_USERNAME
value: "admin"
- name: ADMIN_PASSWORD
Expand Down Expand Up @@ -690,6 +638,9 @@ spec:
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
envFrom:
- configMapRef:
name: litmus-portal-admin-config
env:
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ spec:
image: litmuschaos/upgrade-agent-cp:ci
envFrom:
- configMapRef:
name: chaos-litmus-admin-config
name: litmus-portal-admin-config
imagePullPolicy: Always
restartPolicy: Never

0 comments on commit 7a88df7

Please sign in to comment.