diff --git a/kubernetes-manifests/activemq.yml b/kubernetes-manifests/activemq.yml new file mode 100644 index 000000000..bf973ad19 --- /dev/null +++ b/kubernetes-manifests/activemq.yml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Service +metadata: + name: queue +spec: + selector: + app.kubernetes.io/name: queue + ports: + - port: 5672 + targetPort: conn + # type: LoadBalancer +--- +apiVersion: v1 +kind: Service +metadata: + name: queue-admin +spec: + selector: + app.kubernetes.io/name: queue + ports: + - port: 8161 + targetPort: admin + type: LoadBalancer +--- +apiVersion: v1 +kind: Pod +metadata: + name: queue + labels: + app.kubernetes.io/name: queue +spec: + containers: + - name: queue + image: symptoma/activemq:5.16.3 + ports: + - containerPort: 5672 + name: conn + - containerPort: 8161 + name: admin diff --git a/kubernetes-manifests/armonik.yml b/kubernetes-manifests/armonik.yml new file mode 100644 index 000000000..89e15442a --- /dev/null +++ b/kubernetes-manifests/armonik.yml @@ -0,0 +1,216 @@ +apiVersion: v1 +kind: Service +metadata: + name: control-plane +spec: + selector: + app.kubernetes.io/name: control-plane + ports: + - port: 1081 + targetPort: metrics + name: metrics + - port: 1080 + targetPort: submitter + name: submitter +--- +apiVersion: v1 +kind: Pod +metadata: + name: control-plane + labels: + app.kubernetes.io/name: control-plane +spec: + containers: + - name: control-plane + image: dockerhubaneo/armonik_control:0.24.4 + ports: + - containerPort: 1081 + name: metrics + - containerPort: 1080 + name: submitter + # docker inspect armonik.control.submitter | jq -r '.[].Config.Env | map(split("=") | {name:.[0], value:.[1]})' | yq -P + env: + - name: Amqp__Port + value: "5672" + - name: Submitter__DefaultPartition + value: TestPartition0 + - name: Components__TableStorage + value: ArmoniK.Adapters.MongoDB.TableStorage + - name: MongoDB__DatabaseName + value: database + - name: MongoDB__ReplicaSet + value: repSet0 + - name: MongoDB__DirectConnection + value: "true" + - name: MongoDB__Host + value: database + - name: MongoDB__Port + value: "27017" + - name: Components__QueueAdaptorSettings__AdapterAbsolutePath + value: /adapters/queue/amqp/ArmoniK.Core.Adapters.Amqp.dll + - name: Components__QueueAdaptorSettings__ClassName + value: ArmoniK.Core.Adapters.Amqp.QueueBuilder + - name: Amqp__Host + value: queue + - name: Amqp__Scheme + value: AMQP + - name: Amqp__Password + value: admin + - name: Amqp__MaxRetries + value: "10" + - name: Amqp__LinkCredit + value: "2" + - name: Amqp__MaxPriority + value: "10" + - name: Amqp__User + value: admin + - name: ASPNETCORE_URLS + value: http://+:1080, http://+:1081 + - name: Components__ObjectStorage + value: ArmoniK.Adapters.Redis.ObjectStorage + - name: Redis__EndpointUrl + value: object:6379 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: compute-plane + labels: + app: armonik + service: compute-plane +spec: + replicas: 3 + selector: + matchLabels: + app: armonik + service: compute-plane + template: + metadata: + labels: + app: armonik + service: compute-plane + name: compute-plane + spec: + containers: + - name: agent + image: dockerhubaneo/armonik_pollingagent:0.24.4 + # docker inspect armonik.compute.pollingagent0 | jq -r '.[].Config.Env | map(split("=") | {name:.[0], value:.[1]})' | yq -P + env: + - name: Amqp__Port + value: "5672" + - name: Components__TableStorage + value: ArmoniK.Adapters.MongoDB.TableStorage + - name: MongoDB__DatabaseName + value: database + - name: MongoDB__ReplicaSet + value: repSet0 + - name: MongoDB__DirectConnection + value: "true" + - name: MongoDB__Host + value: database + - name: MongoDB__Port + value: "27017" + - name: Components__QueueAdaptorSettings__AdapterAbsolutePath + value: /adapters/queue/amqp/ArmoniK.Core.Adapters.Amqp.dll + - name: Components__QueueAdaptorSettings__ClassName + value: ArmoniK.Core.Adapters.Amqp.QueueBuilder + - name: Amqp__Host + value: queue + - name: Amqp__Scheme + value: AMQP + - name: Amqp__Password + value: admin + - name: Amqp__MaxRetries + value: "10" + - name: Amqp__LinkCredit + value: "2" + - name: Amqp__MaxPriority + value: "10" + - name: Amqp__User + value: admin + # how to say on which partition is the instance of the pod + - name: Amqp__PartitionId + value: TestPartition0 + - name: ASPNETCORE_URLS + value: http://+:1080 + - name: Components__ObjectStorage + value: ArmoniK.Adapters.Redis.ObjectStorage + - name: Redis__EndpointUrl + value: object:6379 + - name: ComputePlane__WorkerChannel__Address + value: /cache/armonik_worker.sock + - name: ComputePlane__WorkerChannel__SocketType + value: unixdomainsocket + - name: ComputePlane__AgentChannel__Address + value: /cache/armonik_agent.sock + - name: ComputePlane__AgentChannel__SocketType + value: unixdomainsocket + - name: Pollster__SharedCacheFolder + value: /cache/shared + - name: Pollster__InternalCacheFolder + value: /cache/internal + - name: InitWorker__WorkerCheckDelay + value: 00:00:01 + - name: InitWorker__WorkerCheckRetries + value: "10" + volumeMounts: + - mountPath: /cache + name: cache-volume + - name: worker + image: dockerhubaneo/armonik_core_bench_test_worker:0.24.4 + env: + - name: ComputePlane__WorkerChannel__Address + value: /cache/armonik_worker.sock + - name: ComputePlane__WorkerChannel__SocketType + value: unixdomainsocket + - name: ComputePlane__AgentChannel__Address + value: /cache/armonik_agent.sock + - name: ComputePlane__AgentChannel__SocketType + value: unixdomainsocket + volumeMounts: + - mountPath: /cache + name: cache-volume + volumes: + - name: cache-volume + emptyDir: + sizeLimit: 10Gi +--- +apiVersion: v1 +kind: Service +metadata: + name: gui +spec: + selector: + app: armonik + service: admin-gui + ports: + - port: 2080 + targetPort: app-port +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: armonik + service: admin-gui + name: admin-gui +spec: + replicas: 1 + selector: + matchLabels: + app: armonik + service: admin-gui + template: + metadata: + labels: + app: armonik + service: admin-gui + name: admin-gui + spec: + containers: + - image: dockerhubaneo/armonik_admin_app:0.12.4 + name: admin-app + ports: + - containerPort: 1080 + name: app-port + protocol: TCP diff --git a/kubernetes-manifests/ingress.yml b/kubernetes-manifests/ingress.yml new file mode 100644 index 000000000..ca71743ea --- /dev/null +++ b/kubernetes-manifests/ingress.yml @@ -0,0 +1,191 @@ +apiVersion: v1 +data: + environment.json: '{"color":"blue","description":"Local development environment","name":"local-dev","version":"0.0.0"}' + gui_configuration: '{}' +immutable: false +kind: ConfigMap +metadata: + name: ingress-nginx-static +--- +apiVersion: v1 +data: + armonik.conf: | + map $http_accept_language $accept_language { + default en; + ~*^en en; + } + + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + server { + listen 8080; + listen [::]:8080; + listen 9080 http2; + listen [::]:9080 http2; + + sendfile on; + resolver kube-dns.kube-system ipv6=off; + + location = / { + rewrite ^ $scheme://$http_host/admin/$accept_language/; + } + + location = /admin { + rewrite ^ $scheme://$http_host/admin/$accept_language/; + } + location = /admin/ { + rewrite ^ $scheme://$http_host/admin/$accept_language/; + } + location = /admin/en { + rewrite ^ $scheme://$http_host/admin/en/; + } + set $admin_app_upstream http://gui.default.svc.cluster.local:2080; + location /admin/ { + proxy_pass $admin_app_upstream$uri$is_args$args; + } + set $armonik_upstream grpc://control-plane.default.svc.cluster.local:1080; + location ~* ^/armonik\. { + grpc_pass $armonik_upstream; + + # Apparently, multiple chunks in a grpc stream is counted has a single body + # So disable the limit + client_max_body_size 0; + + # add a timeout of 1 month to avoid grpc exception for long task + # TODO: find better configuration + proxy_read_timeout 30d; + proxy_send_timeout 1d; + grpc_read_timeout 30d; + grpc_send_timeout 1d; + + # Try force keep alive + add_header Connection Keep-Alive; + add_header Proxy-Connection Keep-Alive; + } + + location /static/ { + alias /static/; + } + + + proxy_buffering off; + proxy_request_buffering off; + + + + set $seq_upstream http://10.43.150.249:8080; + location = /seq { + rewrite ^ $scheme://$http_host/seq/ permanent; + } + location /seq/ { + proxy_set_header Host $http_host; + proxy_set_header Accept-Encoding ""; + rewrite ^/seq/(.*) /$1 break; + proxy_pass $seq_upstream$uri$is_args$args; + sub_filter '' ''; + sub_filter_once on; + proxy_hide_header content-security-policy; + } + set $grafana_upstream http://10.43.130.56:3000; + location = /grafana { + rewrite ^ $scheme://$http_host/grafana/ permanent; + } + location /grafana/ { + rewrite ^/grafana/(.*) /$1 break; + proxy_set_header Host $http_host; + proxy_pass $grafana_upstream$uri$is_args$args; + sub_filter '' ''; + sub_filter_once on; + proxy_intercept_errors on; + error_page 301 302 307 =302 ${scheme}://${http_host}${upstream_http_location}; + } + location /grafana/api/live { + rewrite ^/grafana/(.*) /$1 break; + proxy_http_version 1.1; + proxy_set_header Host $http_host; + proxy_pass $grafana_upstream$uri$is_args$args; + } + } +immutable: false +kind: ConfigMap +metadata: + name: ingress-nginx +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: armonik + service: ingress + name: ingress +spec: + replicas: 1 + selector: + matchLabels: + app: armonik + service: ingress + template: + metadata: + labels: + app: armonik + service: ingress + name: ingress + spec: + containers: + - envFrom: + - configMapRef: + name: ingress-nginx + optional: false + image: nginxinc/nginx-unprivileged:1.27.0-alpine-slim + name: ingress + ports: + - containerPort: 8080 + name: ingress-p-http + protocol: TCP + - containerPort: 9080 + name: ingress-p-grpc + protocol: TCP + volumeMounts: + - mountPath: /etc/nginx/conf.d + name: ingress-nginx + readOnly: true + - mountPath: /static + name: static + readOnly: true + restartPolicy: Always + volumes: + - configMap: + defaultMode: 420 + name: ingress-nginx + optional: false + name: ingress-nginx + - configMap: + defaultMode: 420 + name: ingress-nginx-static + optional: false + name: static +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: armonik + service: ingress + name: ingress +spec: + ports: + - name: ingress-p-http + port: 5000 + protocol: TCP + targetPort: ingress-p-http + - name: ingress-p-grpc + port: 5001 + protocol: TCP + targetPort: ingress-p-grpc + selector: + app: armonik + service: ingress + type: LoadBalancer diff --git a/kubernetes-manifests/mongo.yml b/kubernetes-manifests/mongo.yml new file mode 100644 index 000000000..b86bc52ec --- /dev/null +++ b/kubernetes-manifests/mongo.yml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Service +metadata: + name: database +spec: + selector: + app.kubernetes.io/name: database + ports: + - port: 27017 + targetPort: conn + # type: LoadBalancer +--- +apiVersion: v1 +kind: Pod +metadata: + name: database + labels: + app.kubernetes.io/name: database +spec: + containers: + - name: database + image: mongo:7.0.5 + command: + - mongod + - --bind_ip_all + - --replSet + - repSet0 + ports: + - containerPort: 27017 + name: conn + +# kubectl exec database -- mongosh mongodb://localhost:27017/database --eval 'rs.initiate()' +# kubectl exec database -- mongosh mongodb://localhost:27017/database --eval 'db.PartitionData.insertOne({_id:"TestPartition0"})' diff --git a/kubernetes-manifests/redis.yml b/kubernetes-manifests/redis.yml new file mode 100644 index 000000000..e61b930c3 --- /dev/null +++ b/kubernetes-manifests/redis.yml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: object +spec: + selector: + app.kubernetes.io/name: object + ports: + - port: 6379 + targetPort: conn + # type: LoadBalancer +--- +apiVersion: v1 +kind: Pod +metadata: + name: object + labels: + app.kubernetes.io/name: object +spec: + containers: + - name: object + image: redis:7.2.5-alpine + command: + - redis-server + ports: + - containerPort: 6379 + name: conn