|
| 1 | +--- |
| 2 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 3 | +kind: ClusterRole |
| 4 | +metadata: |
| 5 | + name: litmus-server-cr |
| 6 | +rules: |
| 7 | + - apiGroups: [networking.k8s.io, extensions] |
| 8 | + resources: [ingresses] |
| 9 | + verbs: [get] |
| 10 | + - apiGroups: [""] |
| 11 | + resources: [services, nodes, pods/log] |
| 12 | + verbs: [get, watch] |
| 13 | + - apiGroups: [""] # To get TLS Cert from secrets incase of cluster scope |
| 14 | + resources: [secrets] |
| 15 | + verbs: [get] |
| 16 | +--- |
| 17 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 18 | +kind: ClusterRoleBinding |
| 19 | +metadata: |
| 20 | + name: litmus-server-crb |
| 21 | +roleRef: |
| 22 | + apiGroup: rbac.authorization.k8s.io |
| 23 | + kind: ClusterRole |
| 24 | + name: litmus-server-cr |
| 25 | +subjects: |
| 26 | + - kind: ServiceAccount |
| 27 | + name: litmus-server-account |
| 28 | + namespace: litmus |
| 29 | +## Control plane manifests |
| 30 | +--- |
| 31 | +apiVersion: v1 |
| 32 | +kind: Namespace |
| 33 | +metadata: |
| 34 | + name: litmus |
| 35 | +--- |
| 36 | +apiVersion: v1 |
| 37 | +kind: ServiceAccount |
| 38 | +metadata: |
| 39 | + name: litmus-server-account |
| 40 | + namespace: litmus |
| 41 | +--- |
| 42 | +apiVersion: v1 |
| 43 | +kind: Secret |
| 44 | +metadata: |
| 45 | + name: litmus-portal-admin-secret |
| 46 | + namespace: litmus |
| 47 | +stringData: |
| 48 | + JWT_SECRET: "litmus-portal@123" |
| 49 | + DB_USER: "root" |
| 50 | + DB_PASSWORD: "1234" |
| 51 | +--- |
| 52 | +apiVersion: v1 |
| 53 | +kind: ConfigMap |
| 54 | +metadata: |
| 55 | + name: litmus-portal-admin-config |
| 56 | + namespace: litmus |
| 57 | +data: |
| 58 | + DB_SERVER: mongodb://my-release-mongodb-0.my-release-mongodb-headless:27017,my-release-mongodb-1.my-release-mongodb-headless:27017,my-release-mongodb-2.my-release-mongodb-headless:27017/admin |
| 59 | + VERSION: "3.8.0" |
| 60 | + SKIP_SSL_VERIFY: "false" |
| 61 | + # Configurations if you are using dex for OAuth |
| 62 | + DEX_ENABLED: "false" |
| 63 | + OIDC_ISSUER: "http://<Your Domain>:32000" |
| 64 | + DEX_OAUTH_CALLBACK_URL: "http://<litmus-portal frontend exposed URL>:8080/auth/dex/callback" |
| 65 | + DEX_OAUTH_CLIENT_ID: "LitmusPortalAuthBackend" |
| 66 | + DEX_OAUTH_CLIENT_SECRET: "ZXhhbXBsZS1hcHAtc2VjcmV0" |
| 67 | + OAuthJwtSecret: "litmus-oauth@123" |
| 68 | +--- |
| 69 | +apiVersion: v1 |
| 70 | +kind: ConfigMap |
| 71 | +metadata: |
| 72 | + name: litmusportal-frontend-nginx-configuration |
| 73 | + namespace: litmus |
| 74 | +data: |
| 75 | + nginx.conf: | |
| 76 | + pid /tmp/nginx.pid; |
| 77 | +
|
| 78 | + events { |
| 79 | + worker_connections 1024; |
| 80 | + } |
| 81 | +
|
| 82 | + http { |
| 83 | + map $http_upgrade $connection_upgrade { |
| 84 | + default upgrade; |
| 85 | + '' close; |
| 86 | + } |
| 87 | +
|
| 88 | + client_body_temp_path /tmp/client_temp; |
| 89 | + proxy_temp_path /tmp/proxy_temp_path; |
| 90 | + fastcgi_temp_path /tmp/fastcgi_temp; |
| 91 | + uwsgi_temp_path /tmp/uwsgi_temp; |
| 92 | + scgi_temp_path /tmp/scgi_temp; |
| 93 | +
|
| 94 | + sendfile on; |
| 95 | + tcp_nopush on; |
| 96 | + tcp_nodelay on; |
| 97 | + keepalive_timeout 65; |
| 98 | + types_hash_max_size 2048; |
| 99 | + server_tokens off; |
| 100 | +
|
| 101 | + include /etc/nginx/mime.types; |
| 102 | +
|
| 103 | + gzip on; |
| 104 | + gzip_disable "msie6"; |
| 105 | +
|
| 106 | + access_log /var/log/nginx/access.log; |
| 107 | + error_log /var/log/nginx/error.log; |
| 108 | +
|
| 109 | + server { |
| 110 | + listen 8185 default_server; |
| 111 | + root /opt/chaos; |
| 112 | +
|
| 113 | + location /health { |
| 114 | + return 200; |
| 115 | + } |
| 116 | +
|
| 117 | + location / { |
| 118 | + proxy_http_version 1.1; |
| 119 | + add_header Cache-Control "no-cache"; |
| 120 | + try_files $uri /index.html; |
| 121 | + autoindex on; |
| 122 | + } |
| 123 | +
|
| 124 | + # redirect server error pages to the static page /50x.html |
| 125 | + # |
| 126 | + error_page 500 502 503 504 /50x.html; |
| 127 | + location = /50x.html { |
| 128 | + root /usr/share/nginx/html; |
| 129 | + } |
| 130 | +
|
| 131 | + location /auth/ { |
| 132 | + proxy_http_version 1.1; |
| 133 | + proxy_set_header Host $host; |
| 134 | + proxy_set_header X-Real-IP $remote_addr; |
| 135 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 136 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 137 | + proxy_pass "http://litmusportal-auth-server-service:9003/"; |
| 138 | + } |
| 139 | +
|
| 140 | + location /api/ { |
| 141 | + proxy_http_version 1.1; |
| 142 | + proxy_set_header Host $host; |
| 143 | + proxy_set_header X-Real-IP $remote_addr; |
| 144 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 145 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 146 | + proxy_pass "http://litmusportal-server-service:9002/"; |
| 147 | + } |
| 148 | +
|
| 149 | + location /ws/ { |
| 150 | + proxy_http_version 1.1; |
| 151 | + proxy_set_header Upgrade $http_upgrade; |
| 152 | + proxy_set_header Connection $connection_upgrade; |
| 153 | + proxy_set_header Host $host; |
| 154 | + proxy_set_header X-Real-IP $remote_addr; |
| 155 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 156 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 157 | + proxy_pass "http://litmusportal-server-service:9002/"; |
| 158 | + } |
| 159 | + } |
| 160 | + } |
| 161 | +--- |
| 162 | +apiVersion: apps/v1 |
| 163 | +kind: Deployment |
| 164 | +metadata: |
| 165 | + name: litmusportal-frontend |
| 166 | + namespace: litmus |
| 167 | + labels: |
| 168 | + component: litmusportal-frontend |
| 169 | +spec: |
| 170 | + replicas: 1 |
| 171 | + selector: |
| 172 | + matchLabels: |
| 173 | + component: litmusportal-frontend |
| 174 | + template: |
| 175 | + metadata: |
| 176 | + labels: |
| 177 | + component: litmusportal-frontend |
| 178 | + spec: |
| 179 | + automountServiceAccountToken: false |
| 180 | + containers: |
| 181 | + - name: litmusportal-frontend |
| 182 | + image: litmuschaos.docker.scarf.sh/litmuschaos/litmusportal-frontend:3.8.0 |
| 183 | + imagePullPolicy: Always |
| 184 | + # securityContext: |
| 185 | + # runAsUser: 2000 |
| 186 | + # allowPrivilegeEscalation: false |
| 187 | + # runAsNonRoot: true |
| 188 | + ports: |
| 189 | + - containerPort: 8185 |
| 190 | + volumeMounts: |
| 191 | + - name: nginx-config |
| 192 | + mountPath: /etc/nginx/nginx.conf |
| 193 | + subPath: nginx.conf |
| 194 | + volumes: |
| 195 | + - name: nginx-config |
| 196 | + configMap: |
| 197 | + name: litmusportal-frontend-nginx-configuration |
| 198 | +--- |
| 199 | +apiVersion: v1 |
| 200 | +kind: Service |
| 201 | +metadata: |
| 202 | + name: litmusportal-frontend-service |
| 203 | + namespace: litmus |
| 204 | +spec: |
| 205 | + type: NodePort |
| 206 | + ports: |
| 207 | + - name: http |
| 208 | + port: 9091 |
| 209 | + targetPort: 8185 |
| 210 | + selector: |
| 211 | + component: litmusportal-frontend |
| 212 | +--- |
| 213 | +apiVersion: apps/v1 |
| 214 | +kind: Deployment |
| 215 | +metadata: |
| 216 | + name: litmusportal-server |
| 217 | + namespace: litmus |
| 218 | + labels: |
| 219 | + component: litmusportal-server |
| 220 | +spec: |
| 221 | + replicas: 1 |
| 222 | + selector: |
| 223 | + matchLabels: |
| 224 | + component: litmusportal-server |
| 225 | + template: |
| 226 | + metadata: |
| 227 | + labels: |
| 228 | + component: litmusportal-server |
| 229 | + spec: |
| 230 | + volumes: |
| 231 | + - name: gitops-storage |
| 232 | + emptyDir: {} |
| 233 | + - name: hub-storage |
| 234 | + emptyDir: {} |
| 235 | + containers: |
| 236 | + - name: graphql-server |
| 237 | + image: litmuschaos.docker.scarf.sh/litmuschaos/litmusportal-server:3.8.0 |
| 238 | + volumeMounts: |
| 239 | + - mountPath: /tmp/ |
| 240 | + name: gitops-storage |
| 241 | + - mountPath: /tmp/version |
| 242 | + name: hub-storage |
| 243 | + securityContext: |
| 244 | + runAsUser: 2000 |
| 245 | + allowPrivilegeEscalation: false |
| 246 | + runAsNonRoot: true |
| 247 | + readOnlyRootFilesystem: true |
| 248 | + envFrom: |
| 249 | + - configMapRef: |
| 250 | + name: litmus-portal-admin-config |
| 251 | + - secretRef: |
| 252 | + name: litmus-portal-admin-secret |
| 253 | + env: |
| 254 | + # if self-signed certificate are used pass the k8s tls secret name created in portal ns, to allow agents to use tls for communication |
| 255 | + - name: TLS_SECRET_NAME |
| 256 | + value: "" |
| 257 | + - name: LITMUS_PORTAL_NAMESPACE |
| 258 | + valueFrom: |
| 259 | + fieldRef: |
| 260 | + fieldPath: metadata.namespace |
| 261 | + - name: CHAOS_CENTER_SCOPE |
| 262 | + value: "cluster" |
| 263 | + - name: ENABLE_GQL_INTROSPECTION |
| 264 | + value: "false" |
| 265 | + - name: SUBSCRIBER_IMAGE |
| 266 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/litmusportal-subscriber:3.8.0" |
| 267 | + - name: EVENT_TRACKER_IMAGE |
| 268 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/litmusportal-event-tracker:3.8.0" |
| 269 | + - name: ARGO_WORKFLOW_CONTROLLER_IMAGE |
| 270 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/workflow-controller:v3.3.1" |
| 271 | + - name: ARGO_WORKFLOW_EXECUTOR_IMAGE |
| 272 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/argoexec:v3.3.1" |
| 273 | + - name: LITMUS_CHAOS_OPERATOR_IMAGE |
| 274 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/chaos-operator:3.8.0" |
| 275 | + - name: LITMUS_CHAOS_RUNNER_IMAGE |
| 276 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/chaos-runner:3.8.0" |
| 277 | + - name: LITMUS_CHAOS_EXPORTER_IMAGE |
| 278 | + value: "litmuschaos.docker.scarf.sh/litmuschaos/chaos-exporter:3.8.0" |
| 279 | + - name: SERVER_SERVICE_NAME |
| 280 | + value: "litmusportal-server-service" |
| 281 | + - name: INFRA_DEPLOYMENTS |
| 282 | + value: '["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller", "app=event-tracker"]' |
| 283 | + - name: NODE_NAME |
| 284 | + valueFrom: |
| 285 | + fieldRef: |
| 286 | + fieldPath: spec.nodeName |
| 287 | + - name: CHAOS_CENTER_UI_ENDPOINT |
| 288 | + value: "" |
| 289 | + - name: INGRESS |
| 290 | + value: "false" |
| 291 | + - name: INGRESS_NAME |
| 292 | + value: "litmus-ingress" |
| 293 | + - name: CONTAINER_RUNTIME_EXECUTOR |
| 294 | + value: "k8sapi" |
| 295 | + - name: DEFAULT_HUB_BRANCH_NAME |
| 296 | + value: "v3.8.x" |
| 297 | + - name: LITMUS_AUTH_GRPC_ENDPOINT |
| 298 | + value: "litmusportal-auth-server-service" |
| 299 | + - name: LITMUS_AUTH_GRPC_PORT |
| 300 | + value: ":3030" |
| 301 | + - name: WORKFLOW_HELPER_IMAGE_VERSION |
| 302 | + value: "3.8.0" |
| 303 | + - name: REMOTE_HUB_MAX_SIZE |
| 304 | + value: "5000000" |
| 305 | + - name: INFRA_COMPATIBLE_VERSIONS |
| 306 | + value: '["3.8.0"]' |
| 307 | + ports: |
| 308 | + - containerPort: 8080 |
| 309 | + - containerPort: 8000 |
| 310 | + imagePullPolicy: Always |
| 311 | + serviceAccountName: litmus-server-account |
| 312 | +--- |
| 313 | +apiVersion: v1 |
| 314 | +kind: Service |
| 315 | +metadata: |
| 316 | + name: litmusportal-server-service |
| 317 | + namespace: litmus |
| 318 | +spec: |
| 319 | + type: NodePort |
| 320 | + ports: |
| 321 | + - name: graphql-server |
| 322 | + port: 9002 |
| 323 | + targetPort: 8080 |
| 324 | + - name: graphql-rpc-server |
| 325 | + port: 8000 |
| 326 | + targetPort: 8000 |
| 327 | + selector: |
| 328 | + component: litmusportal-server |
| 329 | +--- |
| 330 | +apiVersion: apps/v1 |
| 331 | +kind: Deployment |
| 332 | +metadata: |
| 333 | + name: litmusportal-auth-server |
| 334 | + namespace: litmus |
| 335 | + labels: |
| 336 | + component: litmusportal-auth-server |
| 337 | +spec: |
| 338 | + replicas: 1 |
| 339 | + selector: |
| 340 | + matchLabels: |
| 341 | + component: litmusportal-auth-server |
| 342 | + template: |
| 343 | + metadata: |
| 344 | + labels: |
| 345 | + component: litmusportal-auth-server |
| 346 | + spec: |
| 347 | + automountServiceAccountToken: false |
| 348 | + containers: |
| 349 | + - name: auth-server |
| 350 | + image: litmuschaos.docker.scarf.sh/litmuschaos/litmusportal-auth-server:3.8.0 |
| 351 | + securityContext: |
| 352 | + runAsUser: 2000 |
| 353 | + allowPrivilegeEscalation: false |
| 354 | + runAsNonRoot: true |
| 355 | + readOnlyRootFilesystem: true |
| 356 | + envFrom: |
| 357 | + - configMapRef: |
| 358 | + name: litmus-portal-admin-config |
| 359 | + - secretRef: |
| 360 | + name: litmus-portal-admin-secret |
| 361 | + env: |
| 362 | + - name: STRICT_PASSWORD_POLICY |
| 363 | + value: "false" |
| 364 | + - name: ADMIN_USERNAME |
| 365 | + value: "admin" |
| 366 | + - name: ADMIN_PASSWORD |
| 367 | + value: "litmus" |
| 368 | + - name: LITMUS_GQL_GRPC_ENDPOINT |
| 369 | + value: "litmusportal-server-service" |
| 370 | + - name: LITMUS_GQL_GRPC_PORT |
| 371 | + value: ":8000" |
| 372 | + ports: |
| 373 | + - containerPort: 3000 |
| 374 | + - containerPort: 3030 |
| 375 | + imagePullPolicy: Always |
| 376 | +--- |
| 377 | +apiVersion: v1 |
| 378 | +kind: Service |
| 379 | +metadata: |
| 380 | + name: litmusportal-auth-server-service |
| 381 | + namespace: litmus |
| 382 | +spec: |
| 383 | + type: NodePort |
| 384 | + ports: |
| 385 | + - name: auth-server |
| 386 | + port: 9003 |
| 387 | + targetPort: 3000 |
| 388 | + - name: auth-rpc-server |
| 389 | + port: 3030 |
| 390 | + targetPort: 3030 |
| 391 | + selector: |
| 392 | + component: litmusportal-auth-server |
0 commit comments