production: Deploy graph for testing in production
This prepares the deployment for:
- 1 grpc instance (which will run in rancher-node-metal05 for specific access to the graph dataset)
- 1 rpc instance
For the grpc instance, this creates a local-persistent volume onto which we plan to mount the current graph dataset (zfs mount point).
For now, no service is started since we need to prepare the volume dataset for the graph to run properly. Other commits will follow once this lands and the volume are ready.
helm diff
[swh] Comparing changes between branches production and mr/test-graph-in-production (per environment)...
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for environment staging, namespace swh...
[swh] Generate config in production branch for environment staging, namespace swh-cassandra...
[swh] Generate config in production branch for environment staging, namespace swh-cassandra-next-version...
[swh] Generate config in mr/test-graph-in-production branch for environment staging...
[swh] Generate config in mr/test-graph-in-production branch for environment staging...
[swh] Generate config in mr/test-graph-in-production branch for environment staging...
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for environment production, namespace swh...
[swh] Generate config in production branch for environment production, namespace swh-cassandra...
[swh] Generate config in production branch for environment production, namespace swh-cassandra-next-version...
[swh] Generate config in mr/test-graph-in-production branch for environment production...
[swh] Generate config in mr/test-graph-in-production branch for environment production...
[swh] Generate config in mr/test-graph-in-production branch for environment production...
------------- diff for environment staging namespace swh -------------
No differences
------------- diff for environment staging namespace swh-cassandra -------------
No differences
------------- diff for environment staging namespace swh-cassandra-next-version -------------
No differences
------------- diff for environment production namespace swh -------------
No differences
------------- diff for environment production namespace swh-cassandra -------------
--- /tmp/swh-chart.swh.XsPC1hjG/production-swh-cassandra.before 2024-10-10 14:15:57.173399359 +0200
+++ /tmp/swh-chart.swh.XsPC1hjG/production-swh-cassandra.after 2024-10-10 14:16:00.805246892 +0200
@@ -813,20 +813,45 @@
},
"root": {
"handlers": [
"console"
],
"level": "INFO"
},
"version": 1
}
---
+# Source: swh/templates/graph/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ namespace: swh-cassandra
+ name: graph-grpc-20230906-configuration-template
+data:
+ config.yml.template: |
+ graph:
+ max_ram: 500g
+---
+# Source: swh/templates/graph/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ namespace: swh-cassandra
+ name: graph-rpc-2023-09-06-configuration-template
+data:
+ config.yml.template: |
+ graph:
+ cls: remote
+ grpc_server:
+ port: 80
+ url: graph-grpc-20230926-ingress:80
+---
# Source: swh/templates/graphql/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
namespace: swh-cassandra
name: graphql-archive-configuration-template
data:
# TODO: rename to not have a dot in the name to allow testing
config.yml: |
storage:
@@ -9821,20 +9846,54 @@
brokers:
- kafka1.internal.softwareheritage.org:9092
- kafka2.internal.softwareheritage.org:9092
- kafka3.internal.softwareheritage.org:9092
- kafka4.internal.softwareheritage.org:9092
auto_offset_reset: latest
group_id: swh-archive-prod-webhooks
object_types:
- origin_visit_status
---
+# Source: swh/templates/graph/persistent-volume-claims.yaml
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: graph-20230906-inmemory-pvc
+ namespace: swh-cassandra
+ labels:
+ app: graph-grpc-20230906
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 1Gi
+ storageClassName: local-path
+ volumeMode: Filesystem
+---
+# Source: swh/templates/graph/persistent-volume-claims.yaml
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: graph-20230906-persistent-pvc
+ namespace: swh-cassandra
+ labels:
+ app: graph-grpc-20230906
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 1Gi
+ storageClassName: local-persistent
+ volumeMode: Filesystem
+---
# Source: swh/templates/counters/rpc-service.yaml
apiVersion: v1
kind: Service
metadata:
name: counters-rpc
namespace: swh-cassandra
labels:
app: counters-rpc
spec:
type: ClusterIP
@@ -10169,20 +10228,54 @@
# Source: swh/templates/external-services/cname.yaml
apiVersion: v1
kind: Service
metadata:
name: vault-rpc-ingress-swh-cassandra
namespace: swh-cassandra
spec:
type: ExternalName
externalName: archive-production-rke2-ingress-nginx-controller.ingress-nginx.svc.cluster.local
---
+# Source: swh/templates/graph/service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+ name: graph-grpc-20230906
+ namespace: swh-cassandra
+ labels:
+ app: graph-grpc-20230906
+spec:
+ type: ClusterIP
+ selector:
+ app: graph-grpc-20230906
+ ports:
+ - port: 50091
+ targetPort: 50091
+ name: grpc
+---
+# Source: swh/templates/graph/service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+ name: graph-rpc-2023-09-06
+ namespace: swh-cassandra
+ labels:
+ app: graph-rpc-2023-09-06
+spec:
+ type: ClusterIP
+ selector:
+ app: graph-rpc-2023-09-06
+ ports:
+ - port: 5009
+ targetPort: 5009
+ name: rpc
+---
# Source: swh/templates/graphql/service.yaml
apiVersion: v1
kind: Service
metadata:
name: graphql-archive
namespace: swh-cassandra
labels:
app: graphql-archive
spec:
type: ClusterIP
@@ -27662,20 +27755,101 @@
number: 5006
- path: /static
pathType: Prefix
backend:
service:
name: deposit
port:
number: 80
---
+# Source: swh/templates/graph/ingress.yaml
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ namespace: swh-cassandra
+ name: graph-grpc-20230906-ingress-default
+ labels:
+ app: graph-grpc-20230906
+ endpoint-definition: default
+ annotations:
+ nginx.ingress.kubernetes.io/backend-protocol: GRPC
+ nginx.ingress.kubernetes.io/client-body-buffer-size: 128K
+ nginx.ingress.kubernetes.io/proxy-body-size: 4G
+ nginx.ingress.kubernetes.io/proxy-buffering: "on"
+ nginx.ingress.kubernetes.io/service-upstream: "true"
+ nginx.ingress.kubernetes.io/ssl-redirect: "true"
+ nginx.ingress.kubernetes.io/whitelist-source-range: 10.42.0.0/16,10.43.0.0/16,127.0.0.0/8,192.168.100.0/24,192.168.101.0/24,192.168.200.0/22
+spec:
+ ingressClassName: nginx
+ rules:
+ - host: graph-grpc.internal.softwareheritage.org
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: graph-grpc-20230906
+ port:
+ number: 50091
+
+ - host: graph-grpc-20230906-ingress
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: graph-grpc-20230906
+ port:
+ number: 50091
+---
+# Source: swh/templates/graph/ingress.yaml
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ namespace: swh-cassandra
+ name: graph-rpc-2023-09-06-ingress-default
+ labels:
+ app: graph-rpc-2023-09-06
+ endpoint-definition: default
+ annotations:
+ nginx.ingress.kubernetes.io/client-body-buffer-size: 128K
+ nginx.ingress.kubernetes.io/proxy-body-size: 4G
+ nginx.ingress.kubernetes.io/proxy-buffering: "on"
+ nginx.ingress.kubernetes.io/service-upstream: "true"
+ nginx.ingress.kubernetes.io/whitelist-source-range: 10.42.0.0/16,10.43.0.0/16,127.0.0.0/8,192.168.100.0/24,192.168.101.0/24,192.168.200.0/22
+spec:
+ rules:
+ - host: graph-rpc.internal.softwareheritage.org
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: graph-rpc-2023-09-06
+ port:
+ number: 5009
+
+ - host: graph-rpc-20230906-ingress
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: graph-rpc-2023-09-06
+ port:
+ number: 5009
+---
# Source: swh/templates/graphql/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: swh-cassandra
name: graphql-archive-ingress-default
labels:
app: graphql-archive
endpoint-definition: default
annotations:
Edited by Antoine R. Dumont