From 5f726039f94c3f9bd8b440df1bcf4ea3205000c6 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 6 Jul 2023 14:09:23 +0100 Subject: [PATCH] Deploy HeyFil API on dev and prod with persistent storage Deploy the latest HeyFil service on dev and prod that introduces a REST API for querying SP information as well as local storage for quick resumption of metrics on restart. --- deploy/manifests/base/heyfil/deployment.yaml | 2 ++ .../manifests/base/heyfil/kustomization.yaml | 1 + deploy/manifests/base/heyfil/service.yaml | 14 +++++++++++ .../storetheindex/heyfil/deployment.yaml | 9 ++++++- .../tenant/storetheindex/heyfil/ingress.yaml | 24 +++++++++++++++++++ .../storetheindex/heyfil/kustomization.yaml | 4 +++- .../tenant/storetheindex/heyfil/pvc.yaml | 13 ++++++++++ .../storetheindex/heyfil/deployment.yaml | 11 ++++++++- .../tenant/storetheindex/heyfil/ingress.yaml | 24 +++++++++++++++++++ .../storetheindex/heyfil/kustomization.yaml | 4 +++- .../tenant/storetheindex/heyfil/pvc.yaml | 13 ++++++++++ 11 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 deploy/manifests/base/heyfil/service.yaml create mode 100644 deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/ingress.yaml create mode 100644 deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/pvc.yaml create mode 100644 deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/ingress.yaml create mode 100644 deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/pvc.yaml diff --git a/deploy/manifests/base/heyfil/deployment.yaml b/deploy/manifests/base/heyfil/deployment.yaml index 53f5f5a27..fbf59227e 100644 --- a/deploy/manifests/base/heyfil/deployment.yaml +++ b/deploy/manifests/base/heyfil/deployment.yaml @@ -23,3 +23,5 @@ spec: ports: - containerPort: 8080 name: metrics + - containerPort: 8081 + name: api diff --git a/deploy/manifests/base/heyfil/kustomization.yaml b/deploy/manifests/base/heyfil/kustomization.yaml index 8ce77984f..8e845e599 100644 --- a/deploy/manifests/base/heyfil/kustomization.yaml +++ b/deploy/manifests/base/heyfil/kustomization.yaml @@ -3,6 +3,7 @@ kind: Kustomization resources: - deployment.yaml + - service.yaml commonLabels: app: heyfil diff --git a/deploy/manifests/base/heyfil/service.yaml b/deploy/manifests/base/heyfil/service.yaml new file mode 100644 index 000000000..9e1ce5d59 --- /dev/null +++ b/deploy/manifests/base/heyfil/service.yaml @@ -0,0 +1,14 @@ +kind: Service +apiVersion: v1 +metadata: + name: heyfil +spec: + ports: + - name: metrics + port: 8080 + targetPort: metrics + - name: api + port: 8081 + targetPort: api + selector: + app: heyfil diff --git a/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/deployment.yaml b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/deployment.yaml index 88cf78916..9ddeb6f3b 100644 --- a/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/deployment.yaml +++ b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/deployment.yaml @@ -9,6 +9,7 @@ spec: - name: heyfil args: - '--httpIndexerEndpoint=https://dev.cid.contact' + - '--storePath=/store' resources: limits: cpu: "2" @@ -16,4 +17,10 @@ spec: requests: cpu: "2" memory: 2Gi - + volumeMounts: + - name: store + mountPath: /store + volumes: + - name: store + persistentVolumeClaim: + claimName: heyfil diff --git a/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/ingress.yaml b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/ingress.yaml new file mode 100644 index 000000000..3528850bd --- /dev/null +++ b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: heyfil + annotations: + kubernetes.io/ingress.class: "nginx" + cert-manager.io/cluster-issuer: "letsencrypt" + nginx.ingress.kubernetes.io/enable-cors: "true" +spec: + tls: + - hosts: + - heyfil.dev.cid.contact + secretName: heyfil-ingress-tls + rules: + - host: heyfil.dev.cid.contact + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: heyfil + port: + name: api diff --git a/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml index 8af68bab9..0145636e7 100644 --- a/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml +++ b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml @@ -6,6 +6,8 @@ namespace: storetheindex resources: - ../../../../../base/heyfil - monitor.yaml + - pvc.yaml + - ingress.yaml patchesStrategicMerge: - deployment.yaml @@ -13,4 +15,4 @@ patchesStrategicMerge: images: - name: heyfil newName: 407967248065.dkr.ecr.us-east-2.amazonaws.com/ipni/heyfil - newTag: 20230614095932-b27edd5517dd460dda4ea456cd55c323046df5c4 + newTag: 20230706124905-cf3b03385090e32fdf35fd6974dbc8e881f1cab1 diff --git a/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/pvc.yaml b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/pvc.yaml new file mode 100644 index 000000000..8c74d34c1 --- /dev/null +++ b/deploy/manifests/dev/us-east-2/tenant/storetheindex/heyfil/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: heyfil + name: heyfil +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 200Mi + storageClassName: gp3 \ No newline at end of file diff --git a/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/deployment.yaml b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/deployment.yaml index 584afc836..95beabfe5 100644 --- a/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/deployment.yaml +++ b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/deployment.yaml @@ -7,6 +7,9 @@ spec: spec: containers: - name: heyfil + args: + - '--httpIndexerEndpoint=https://cid.contact' + - '--storePath=/store' resources: limits: cpu: "2" @@ -14,4 +17,10 @@ spec: requests: cpu: "2" memory: 2Gi - + volumeMounts: + - name: store + mountPath: /store + volumes: + - name: store + persistentVolumeClaim: + claimName: heyfil diff --git a/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/ingress.yaml b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/ingress.yaml new file mode 100644 index 000000000..70ce3af1b --- /dev/null +++ b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: heyfil + annotations: + kubernetes.io/ingress.class: "nginx" + cert-manager.io/cluster-issuer: "letsencrypt" + nginx.ingress.kubernetes.io/enable-cors: "true" +spec: + tls: + - hosts: + - heyfil.cid.contact + secretName: heyfil-ingress-tls + rules: + - host: heyfil.cid.contact + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: heyfil + port: + name: api diff --git a/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml index 8af68bab9..0145636e7 100644 --- a/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml +++ b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/kustomization.yaml @@ -6,6 +6,8 @@ namespace: storetheindex resources: - ../../../../../base/heyfil - monitor.yaml + - pvc.yaml + - ingress.yaml patchesStrategicMerge: - deployment.yaml @@ -13,4 +15,4 @@ patchesStrategicMerge: images: - name: heyfil newName: 407967248065.dkr.ecr.us-east-2.amazonaws.com/ipni/heyfil - newTag: 20230614095932-b27edd5517dd460dda4ea456cd55c323046df5c4 + newTag: 20230706124905-cf3b03385090e32fdf35fd6974dbc8e881f1cab1 diff --git a/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/pvc.yaml b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/pvc.yaml new file mode 100644 index 000000000..8c74d34c1 --- /dev/null +++ b/deploy/manifests/prod/us-east-2/tenant/storetheindex/heyfil/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: heyfil + name: heyfil +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 200Mi + storageClassName: gp3 \ No newline at end of file