mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00

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
116 lines
3.4 KiB
YAML
116 lines
3.4 KiB
YAML
#################################################################################
|
|
# This YAML file desribes a StatefulSet with a service for running and exposing #
|
|
# a Tendermint instance. It depends on the tendermint-config-db-claim #
|
|
# and tendermint-db-claim k8s pvc. #
|
|
#################################################################################
|
|
|
|
apiVersion: apps/v1beta1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: tm-instance-0-ss
|
|
namespace: default
|
|
spec:
|
|
serviceName: tm-instance-0
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
name: tm-instance-0-ss
|
|
labels:
|
|
app: tm-instance-0-ss
|
|
spec:
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: tm-data
|
|
persistentVolumeClaim:
|
|
claimName: tendermint-db-claim
|
|
- name: tm-config-data
|
|
persistentVolumeClaim:
|
|
claimName: tendermint-config-db-claim
|
|
containers:
|
|
# Treating nginx + tendermint as a POD because they should not
|
|
# exist without each other
|
|
# Nginx container for hosting public key of this ndoe
|
|
- name: nginx
|
|
imagePullPolicy: Always
|
|
image: bigchaindb/nginx_pub_key_access:unstable
|
|
env:
|
|
- name: TM_PUB_KEY_ACCESS_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-pub-key-access
|
|
ports:
|
|
- containerPort: 9986
|
|
name: tm-pk-access
|
|
volumeMounts:
|
|
- name: tm-config-data
|
|
mountPath: /usr/share/nginx
|
|
readOnly: true
|
|
#Tendermint container
|
|
- name: tendermint
|
|
imagePullPolicy: Always
|
|
image: bigchaindb/tendermint:unstable
|
|
env:
|
|
- name: TM_SEEDS
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-seeds
|
|
- name: TM_VALIDATOR_POWER
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-validator-power
|
|
- name: TM_VALIDATORS
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-validators
|
|
- name: TM_PUB_KEY_ACCESS_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-pub-key-access
|
|
- name: TM_GENESIS_TIME
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-genesis-time
|
|
- name: TM_CHAIN_ID
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-chain-id
|
|
- name: TM_P2P_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-p2p-port
|
|
- name: TMHOME
|
|
value: /tendermint
|
|
- name: TM_PROXY_APP
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: vars
|
|
key: bdb-instance-name
|
|
- name: TM_ABCI_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: tendermint-config
|
|
key: tm-abci-port
|
|
# Resource constraint on the pod, can be changed
|
|
resources:
|
|
limits:
|
|
cpu: 200m
|
|
memory: 5G
|
|
volumeMounts:
|
|
- name: tm-data
|
|
mountPath: /tendermint
|
|
- name: tm-config-data
|
|
mountPath: /tendermint_node_data
|
|
ports:
|
|
- containerPort: 46656
|
|
name: p2p
|
|
- containerPort: 46657
|
|
name: rpc
|