Skip to content

Commit

Permalink
[Deployment] DigtalOcean, Add api policy and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Jul 6, 2024
1 parent 16060d1 commit fc6373a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
39 changes: 39 additions & 0 deletions kube/base-components/allowaccess-network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,42 @@ spec:
- namespaceSelector:
matchLabels:
name: starcoin-vega


---
# Postgres service for starcoin-api
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-access-pg-from-api
namespace: default
spec:
podSelector:
matchLabels:
app: postgres-service
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: starcoin-api

---
# Elasticsearch service for starcoin-api
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-access-es-from-api
namespace: default
spec:
podSelector:
matchLabels:
app: elasticsearch
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: starcoin-api
26 changes: 11 additions & 15 deletions kube/scan-api/scan-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: scan-api-deployment
namespace: starcoin-api
labels:
app: scan-api
spec:
Expand All @@ -24,35 +25,30 @@ spec:
containerPort: 5701
env:
- name: STARCOIN_ES_URL
value: "search-starcoin-es2-47avtmhexhbg7qtynzebcnnu64.ap-northeast-1.es.amazonaws.com"
value: "elasticsearch.default.svc.cluster.local"
- name: STARCOIN_ES_PROTOCOL
value: "https"
value: "http"
- name: STARCOIN_ES_PORT
value: "443"
value: "9200"
- name: STARCOIN_ES_USER
value: elastic
- name: STARCOIN_ES_INDEX_VERSION
value: ".0727"
- name: STARCOIN_ES_PWD
valueFrom:
secretKeyRef:
name: elasticsearch-pw-elastic
name: elasticsearch
key: password
- name: MAIN_DS_URL
value: "jdbc:postgresql://scan-db.c0bz9kehdvnb.ap-northeast-1.rds.amazonaws.com/starcoin?currentSchema=main"
- name: DS_URL
value: "jdbc:postgresql://scan-db.c0bz9kehdvnb.ap-northeast-1.rds.amazonaws.com/starcoin"
- name: BARNARD_DS_URL
value: "jdbc:postgresql://scan-db.c0bz9kehdvnb.ap-northeast-1.rds.amazonaws.com/starcoin?currentSchema=barnard"
- name: HALLEY_DS_URL
value: "jdbc:postgresql://scan-db.c0bz9kehdvnb.ap-northeast-1.rds.amazonaws.com/starcoin?currentSchema=halley"
- name: STARCOIN_USER_DS_URL
value: "jdbc:postgresql://scan-db.c0bz9kehdvnb.ap-northeast-1.rds.amazonaws.com/starcoin?currentSchema=starcoin_user"
value: "jdbc:postgresql://postgres-service.default.svc.cluster.local/starcoin"
- name: DB_USER_NAME
value: "starcoin"
valueFrom:
secretKeyRef:
name: postgresql
key: username
- name: DB_PWD
valueFrom:
secretKeyRef:
name: postgresql-starcoin-yu
name: postgresql
key: password

1 change: 1 addition & 0 deletions kube/scan-api/service-scan-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
labels:
app: scan-api
name: scan-api
namespace: starcoin-api
spec:
ports:
- port: 80
Expand Down
1 change: 1 addition & 0 deletions kube/scan-api/service-scan-hazelcast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
labels:
app: scan-api
name: hazelcast-service
namespace: starcoin-api
spec:
selector:
app: scan-api
Expand Down

0 comments on commit fc6373a

Please sign in to comment.