Skip to content

Commit

Permalink
[Deployment] Fixed elasticsearch k8s access policy
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Jul 8, 2024
1 parent 42e7009 commit 4fe719d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
22 changes: 21 additions & 1 deletion kube/base-components/allowaccess-network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,24 @@ spec:
- from:
- namespaceSelector:
matchLabels:
name: starcoin-api
name: starcoin-api

---
# Default namespace access for elasticsearch
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-internal-elasticsearch
namespace: default
spec:
podSelector:
matchLabels:
app: elasticsearch
policyTypes:
- Ingress
ingress:
- from:
- podSelector: {}
ports:
- protocol: TCP
port: 9200
4 changes: 2 additions & 2 deletions kube/base-components/kibana-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
subPath: kibana.yml
env:
- name: ELASTICSEARCH_HOSTS
value: "http://elasticsearch:9200"
value: "http://elasticsearch.default.svc.cluster.local:9200"
- name: ES_USERNAME
valueFrom:
secretKeyRef:
Expand All @@ -55,7 +55,7 @@ data:
kibana.yml: |
server.name: kibana
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://elasticsearch:9200"]
elasticsearch.hosts: ["http://elasticsearch.default.svc.cluster.local:9200"]
elasticsearch.username: "${ES_USERNAME}"
elasticsearch.password: "${ES_PASSWORD}"
---
Expand Down
29 changes: 16 additions & 13 deletions kube/indexer/stc-scan/stcscan-vega-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: starcoin-indexer-deployment
name: starcoin-indexer-stcscan-deployment
namespace: starcoin-vega
labels:
app: starcoin-indexer
app: starcoin-indexer-stcscan
spec:
replicas: 1
selector:
matchLabels:
app: starcoin-indexer
app: starcoin-indexer-stcscan
template:
metadata:
labels:
app: starcoin-indexer
app: starcoin-indexer-stcscan
spec:
containers:
- name: starcoin-indexer
- name: starcoin-indexer-stcscan
image: starcoin/starcoin_indexer:dag_inspector_vega_6
ports:
- containerPort: 8300
Expand All @@ -28,34 +28,37 @@ spec:
- name: BG_TASK_JOBS
value: "indexer,secondary,market_cap,txn_payload,swap_stats,txn_global_idx_update"
- name: BULK_SIZE
value: "80"
value: "100"
- name: STARCOIN_ES_PWD
valueFrom:
secretKeyRef:
name: elasticsearch-pw-elastic
name: elasticsearch
key: password
- name: STARCOIN_ES_URL
value: "search-starcoin-es2-47avtmhexhbg7qtynzebcnnu64.ap-northeast-1.es.amazonaws.com"
value: "elasticsearch.default.svc.cluster.local"
- name: TXN_OFFSET
value: "0"
- name: STARCOIN_ES_PROTOCOL
value: "https"
value: "http"
- name: STARCOIN_ES_PORT
value: "443"
value: "9200"
- name: STARCOIN_ES_USER
value: elastic
- name: SWAP_API_URL
value: "https://swap-api.starswap.xyz"
- name: SWAP_CONTRACT_ADDR
value: "0xbd7e8be8fae9f60f2f5136433e36a091"
- name: DS_URL
value: "jdbc:postgresql://database-1.c0bz9kehdvnb.ap-northeast-1.rds.amazonaws.com/starcoin"
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
- name: DB_SCHEMA
value: "vega"
Expand Down

0 comments on commit 4fe719d

Please sign in to comment.