From feb95553945c704a26fbd3f74325fcfc50ed5f74 Mon Sep 17 00:00:00 2001 From: Bob Ong Date: Fri, 12 Jul 2024 23:40:16 +0800 Subject: [PATCH] [Deployment] Path namespace and network configuration for other Nets --- .../allowaccess-network-policy.yaml | 104 ++++++++++++++++++ kube/base-components/namespaces.yaml | 55 +++++++++ .../stc-scan/stcscan-main-deployment.yaml | 2 +- kube/scan-api/scan-api-deployment.yaml | 2 +- 4 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 kube/base-components/namespaces.yaml diff --git a/kube/base-components/allowaccess-network-policy.yaml b/kube/base-components/allowaccess-network-policy.yaml index dd4c0f2..9bfdd10 100644 --- a/kube/base-components/allowaccess-network-policy.yaml +++ b/kube/base-components/allowaccess-network-policy.yaml @@ -32,6 +32,110 @@ spec: matchLabels: name: starcoin-vega +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-access-pg-from-main + namespace: default +spec: + podSelector: + matchLabels: + app: postgres-service + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + name: starcoin-main +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-access-es-from-main + namespace: default +spec: + podSelector: + matchLabels: + app: elasticsearch + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + name: starcoin-main + +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-access-pg-from-barnard + namespace: default +spec: + podSelector: + matchLabels: + app: postgres-service + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + name: starcoin-barnard +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-access-es-from-barnard + namespace: default +spec: + podSelector: + matchLabels: + app: elasticsearch + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + name: starcoin-barnard + +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-access-pg-from-proxima + namespace: default +spec: + podSelector: + matchLabels: + app: postgres-service + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + name: starcoin-proxima +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-access-es-from-proxima + namespace: default +spec: + podSelector: + matchLabels: + app: elasticsearch + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + name: starcoin-proxima --- # Postgres service for starcoin-api diff --git a/kube/base-components/namespaces.yaml b/kube/base-components/namespaces.yaml new file mode 100644 index 0000000..fa61572 --- /dev/null +++ b/kube/base-components/namespaces.yaml @@ -0,0 +1,55 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: starcoin-main + labels: + app: starcoin + kubernetes.io/metadata.name: starcoin-main + name: starcoin-main + network: main + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: starcoin-barnard + labels: + app: starcoin + kubernetes.io/metadata.name: starcoin-barnard + name: starcoin-barnard + network: barnard + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: starcoin-proxima + labels: + app: starcoin + kubernetes.io/metadata.name: starcoin-proxima + name: starcoin-proxima + network: proxima + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: starcoin-halley + labels: + app: starcoin + kubernetes.io/metadata.name: starcoin-halley + name: starcoin-halley + network: halley + + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: starcoin-vega + labels: + app: starcoin + kubernetes.io/metadata.name: starcoin-vega + name: starcoin-vega + network: vega \ No newline at end of file diff --git a/kube/indexer/stc-scan/stcscan-main-deployment.yaml b/kube/indexer/stc-scan/stcscan-main-deployment.yaml index c31d1ea..229eaab 100644 --- a/kube/indexer/stc-scan/stcscan-main-deployment.yaml +++ b/kube/indexer/stc-scan/stcscan-main-deployment.yaml @@ -26,7 +26,7 @@ spec: - name: NETWORK value: "main.0727" - name: BG_TASK_JOBS - value: "indexer,secondary,market_cap,txn_payload" + value: "indexer,secondary,market_cap,txn_payload,txn_global_idx_update" - name: TXN_OFFSET value: "0" - name: BULK_SIZE diff --git a/kube/scan-api/scan-api-deployment.yaml b/kube/scan-api/scan-api-deployment.yaml index 950589e..0659cbe 100644 --- a/kube/scan-api/scan-api-deployment.yaml +++ b/kube/scan-api/scan-api-deployment.yaml @@ -17,7 +17,7 @@ spec: spec: containers: - name: scan-api - image: starcoin/starcoin_scan:sha-1223fc3 + image: starcoin/starcoin_scan:scan_api_dag_2 ports: - name: http containerPort: 8500