From a782fa46351c8c631c104925f14d1617951b926e Mon Sep 17 00:00:00 2001 From: Shahbaz Nazir Date: Thu, 22 Feb 2018 11:52:41 +0100 Subject: [PATCH] Hardcode static ports for k8s deployment (#2080) Description Currently we manually configure ports in deployment and service files for k8s deployment e.g here. Instead these ports should be constant since these are always the same for each deployment Issues This PR Fixes Fixes #2077 --- k8s/bigchaindb/bigchaindb-dep.yaml | 6 +++--- k8s/bigchaindb/bigchaindb-svc.yaml | 12 ++++++------ k8s/mongodb/mongo-ss.yaml | 2 +- k8s/mongodb/mongo-svc.yaml | 4 ++-- k8s/nginx-https/nginx-https-dep.yaml | 8 ++++---- k8s/nginx-https/nginx-https-svc.yaml | 16 ++++++++-------- k8s/tendermint/tendermint-ext-conn-svc.yaml | 4 ++-- k8s/tendermint/tendermint-ss.yaml | 6 +++--- k8s/tendermint/tendermint-svc.yaml | 12 ++++++------ 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/k8s/bigchaindb/bigchaindb-dep.yaml b/k8s/bigchaindb/bigchaindb-dep.yaml index be7da0d6..9c4d4804 100644 --- a/k8s/bigchaindb/bigchaindb-dep.yaml +++ b/k8s/bigchaindb/bigchaindb-dep.yaml @@ -120,13 +120,13 @@ spec: - | bigchaindb -l DEBUG start ports: - - containerPort: "" + - containerPort: 9984 protocol: TCP name: bdb-port - - containerPort: "" + - containerPort: 9985 protocol: TCP name: bdb-ws-port - - containerPort: "" + - containerPort: 46658 protocol: TCP name: tm-abci-port volumeMounts: diff --git a/k8s/bigchaindb/bigchaindb-svc.yaml b/k8s/bigchaindb/bigchaindb-svc.yaml index c5fef92d..6cc96b2b 100644 --- a/k8s/bigchaindb/bigchaindb-svc.yaml +++ b/k8s/bigchaindb/bigchaindb-svc.yaml @@ -9,16 +9,16 @@ spec: selector: app: bdb-instance-0-dep ports: - - port: "" - targetPort: "" + - port: 9984 + targetPort: 9984 name: bdb-api-port protocol: TCP - - port: "" - targetPort: "" + - port: 9985 + targetPort: 9985 name: bdb-ws-port protocol: TCP - - port: "" - targetPort: "" + - port: 46658 + targetPort: 46658 name: tm-abci-port protocol: TCP type: ClusterIP diff --git a/k8s/mongodb/mongo-ss.yaml b/k8s/mongodb/mongo-ss.yaml index e371a255..6f19007d 100644 --- a/k8s/mongodb/mongo-ss.yaml +++ b/k8s/mongodb/mongo-ss.yaml @@ -63,7 +63,7 @@ spec: add: - FOWNER ports: - - containerPort: "" + - containerPort: 27017 protocol: TCP name: mdb-api-port volumeMounts: diff --git a/k8s/mongodb/mongo-svc.yaml b/k8s/mongodb/mongo-svc.yaml index df3e7c87..180b777f 100644 --- a/k8s/mongodb/mongo-svc.yaml +++ b/k8s/mongodb/mongo-svc.yaml @@ -9,8 +9,8 @@ spec: selector: app: mdb-instance-0-ss ports: - - port: "" - targetPort: "" + - port: 27017 + targetPort: 27017 name: mdb-port protocol: TCP type: ClusterIP diff --git a/k8s/nginx-https/nginx-https-dep.yaml b/k8s/nginx-https/nginx-https-dep.yaml index e26323b8..9ba00d5d 100644 --- a/k8s/nginx-https/nginx-https-dep.yaml +++ b/k8s/nginx-https/nginx-https-dep.yaml @@ -90,15 +90,15 @@ spec: # HTTPS traffic. - containerPort: 80 protocol: TCP - - containerPort: "" + - containerPort: 443 protocol: TCP - - containerPort: "" + - containerPort: 8888 protocol: TCP name: ngx-port - - containerPort: "" + - containerPort: 9986 protocol: TCP name: tm-pub-key - - containerPort: "" + - containerPort: 46656 protocol: TCP name: tm-p2p-port livenessProbe: diff --git a/k8s/nginx-https/nginx-https-svc.yaml b/k8s/nginx-https/nginx-https-svc.yaml index 24b18cb1..e8501ba0 100644 --- a/k8s/nginx-https/nginx-https-svc.yaml +++ b/k8s/nginx-https/nginx-https-svc.yaml @@ -13,20 +13,20 @@ spec: selector: app: ngx-instance-0-dep ports: - - port: "" - targetPort: "" + - port: 443 + targetPort: 443 name: public-secure-cluster-port protocol: TCP - - port: "" - targetPort: "" + - port: 27017 + targetPort: 27017 name: public-mdb-port protocol: TCP - - port: "" - targetPort: "" + - port: 9986 + targetPort: 9986 name: tm-pub-key-access protocol: TCP - - port: "" - targetPort: "" + - port: 46656 + targetPort: 46656 protocol: TCP name: tm-p2p-port - port: 80 diff --git a/k8s/tendermint/tendermint-ext-conn-svc.yaml b/k8s/tendermint/tendermint-ext-conn-svc.yaml index 9b009fa3..40f99ac0 100644 --- a/k8s/tendermint/tendermint-ext-conn-svc.yaml +++ b/k8s/tendermint/tendermint-ext-conn-svc.yaml @@ -9,9 +9,9 @@ spec: ports: spec: ports: - - port: "" + - port: 46656 name: p2p - - port: "" + - port: 46657 name: pubkey # FQDN of remote cluster/NGINX instance externalName: "" diff --git a/k8s/tendermint/tendermint-ss.yaml b/k8s/tendermint/tendermint-ss.yaml index 1e0a4af9..4b3f9bfc 100644 --- a/k8s/tendermint/tendermint-ss.yaml +++ b/k8s/tendermint/tendermint-ss.yaml @@ -40,7 +40,7 @@ spec: name: tendermint-config key: tm-pub-key-access ports: - - containerPort: "" + - containerPort: 9986 name: tm-pk-access volumeMounts: - name: tm-config-data @@ -109,7 +109,7 @@ spec: - name: tm-config-data mountPath: /tendermint_node_data ports: - - containerPort: "" + - containerPort: 46656 name: p2p - - containerPort: "" + - containerPort: 46657 name: rpc diff --git a/k8s/tendermint/tendermint-svc.yaml b/k8s/tendermint/tendermint-svc.yaml index d79a2335..7c4ace48 100644 --- a/k8s/tendermint/tendermint-svc.yaml +++ b/k8s/tendermint/tendermint-svc.yaml @@ -9,16 +9,16 @@ spec: selector: app: tm-instance-1-ss ports: - - port: "" - targetPort: "" + - port: 46656 + targetPort: 46656 name: p2p protocol: TCP - - port: "" - targetPort: "" + - port: 46657 + targetPort: 46657 name: rpc protocol: TCP - - port: "" - targetPort: "" + - port: 9986 + targetPort: 9986 name: pub-key-access protocol: TCP clusterIP: None