Skip to content

Commit

Permalink
simplify kubernetes example
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Jul 13, 2023
1 parent 282e8a7 commit 327cc7c
Showing 1 changed file with 7 additions and 51 deletions.
58 changes: 7 additions & 51 deletions kubernetes.example.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: info@opensanctions.org
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx
---
apiVersion: v1
kind: Service
metadata:
Expand All @@ -28,37 +13,6 @@ spec:
targetPort: 8000
name: http
---
# Supposes you have an ingress, and ideally cert-manager installed on your
# cluster. You should also consider running the service internally to the
# cluster without exposing it on an ingress.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: yente-ingress
annotations:
# you need to configure letsencrypt for your cluster:
# cert-manager.io/cluster-issuer: letsencrypt-prod
acme.cert-manager.io/http01-edit-in-place: "true"
labels:
app: opensanctions
spec:
ingressClassName: nginx
tls:
- hosts:
- api.opensanctions.org
secretName: tls-api.opensanctions.org
rules:
- host: api.opensanctions.org
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: yente
port:
number: 8000
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -67,7 +21,7 @@ data:
manifest.yml: |
catalogs:
- url: "https://data.opensanctions.org/datasets/latest/index.json"
scope: all
scope: default
resource_name: entities.ftm.json
# - url: "https://data.opensanctions.org/graph/catalog.json"
# resource_name: entities.ftm.json
Expand Down Expand Up @@ -107,10 +61,10 @@ spec:
name: http
resources:
requests:
memory: 300Mi
memory: 600Mi
cpu: 200m
limits:
memory: 300Mi
memory: 600Mi
cpu: 200m
securityContext:
readOnlyRootFilesystem: true
Expand All @@ -122,6 +76,8 @@ spec:
- mountPath: /tmp
name: tmp-volume
env:
- name: YENTE_PORT
value: 8000
- name: YENTE_TITLE
value: "OpenSanctions API"
- name: YENTE_LOG_JSON
Expand Down Expand Up @@ -205,10 +161,10 @@ spec:
- reindex
resources:
requests:
memory: 300M
memory: 600M
cpu: 400m
limits:
memory: 300M
memory: 600M
cpu: 400m
securityContext:
readOnlyRootFilesystem: true
Expand Down

0 comments on commit 327cc7c

Please sign in to comment.