-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt to blue-green deployment (#500)
* Adding deployment * quoting * change * Revert * adding green * Change GCP Bucket * adding environment * adding annotation * Adding config map * Scale down * update replicas * fixing * change format * adding quotes * fixing * update python sdk used version * Changing rpc provider * Fix url * Update data * Scale up * Enable * Change version * increase threshold * bump ct staging to rc.4 * ct staging to 2.1.0-rc.4-commit.4b864fc1 * scale 0 * update staging blue nodes to rc.4-pr.6206 * update identities * fix typo * Fix review * revert * fix review --------- Co-authored-by: Jean Demeusy <[email protected]>
- Loading branch information
1 parent
c5cd31d
commit ed019e0
Showing
29 changed files
with
862 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
name: ctdapp | ||
description: Cover Traffic dApp | ||
type: application | ||
version: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "ctdapp.name" -}} | ||
{{- default .Chart.Name .Values.ctdapp.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "ctdapp.fullname" -}} | ||
{{- if .Values.ctdapp.fullnameOverride }} | ||
{{- .Values.ctdapp.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.ctdapp.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "ctdapp.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "ctdapp.labels" -}} | ||
helm.sh/chart: {{ include "ctdapp.chart" . }} | ||
{{ include "ctdapp.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "ctdapp.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "ctdapp.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "ctdapp.serviceAccountName" -}} | ||
{{- if .Values.ctdapp.serviceAccount.create }} | ||
{{- default (include "ctdapp.fullname" .) .Values.ctdapp.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.ctdapp.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
name: core-config | ||
data: | ||
FLAG_CORE_HEALTHCHECK: "60" | ||
FLAG_CORE_CHECK_SUBGRAPH_URLS: "200" | ||
FLAG_CORE_GET_FUNDINGS: "600" | ||
FLAG_CORE_AGGREGATE_PEERS: "30" | ||
FLAG_CORE_GET_TOPOLOGY_DATA: "30" | ||
FLAG_CORE_GET_SUBGRAPH_DATA: "30" | ||
FLAG_CORE_APPLY_ECONOMIC_MODEL: "20" | ||
FLAG_CORE_DISTRIBUTE_REWARDS: "1" | ||
FLAG_CORE_GET_TICKET_PRICE: "60" | ||
FLAG_NODE_HEALTHCHECK: "60" | ||
FLAG_NODE_RETRIEVE_PEERS: "60" | ||
FLAG_NODE_RETRIEVE_OUTGOING_CHANNELS: "60" | ||
FLAG_NODE_RETRIEVE_INCOMING_CHANNELS: "60" | ||
FLAG_NODE_RETRIEVE_BALANCES: "900" | ||
FLAG_NODE_OPEN_CHANNELS: "60" | ||
_FLAG_NODE_CLOSE_OLD_CHANNELS: "900" | ||
_FLAG_NODE_CLOSE_PENDING_CHANNELS: "900" | ||
FLAG_NODE_FUND_CHANNELS: "60" | ||
FLAG_NODE_GET_TOTAL_CHANNEL_FUNDS: "60" | ||
DISTRIBUTION_MIN_ELIGIBLE_PEERS: "5" | ||
DISTRIBUTION_MAX_APR_PERCENTAGE: "100.0" | ||
PEER_MIN_VERSION: "0.0.0" | ||
GCP_FILE_PREFIX: expected_reward | ||
GCP_FOLDER: expected_rewards | ||
GCP_BUCKET: hoprnet-ctdapp-{{ .Values.environmentName }} | ||
ECONOMIC_MODEL_FILENAME: parameters-staging.json | ||
ECONOMIC_MODEL_MIN_SAFE_ALLOWANCE: "0.000000001" | ||
CHANNEL_MIN_BALANCE: "0.05" | ||
CHANNEL_FUNDING_AMOUNT: "0.2" | ||
CHANNEL_MAX_AGE_SECONDS: "172800" | ||
RABBITMQ_TASK_NAME: send_1_hop_message | ||
RABBITMQ_PROJECT_NAME: ct-app | ||
SUBGRAPH_PAGINATION_SIZE: "1000" | ||
SUBGRAPH_SAFES_BALANCE_QUERY: "{ safes(first: valfirst, skip: valskip) { registeredNodesInNetworkRegistry { node { id } safe { id balance { wxHoprBalance } allowance { wxHoprAllowance } } } } }" | ||
SUBGRAPH_WXHOPR_TXS_QUERY: "{ transactions(where: { from: valfrom, to: valto }) { from to amount }} " | ||
SUBGRAPH_FROM_ADDRESS: "0xd9a00176cf49dfb9ca3ef61805a2850f45cb1d05" | ||
{{- if .Values.ctdapp.core.extraEnvVars }} | ||
{{ .Values.ctdapp.core.extraEnvVars | toYaml | nindent 2 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
name: hoprd-nodes | ||
data: | ||
NODE_ADDRESS_1: http://hoprd-ctdapp-1:3001 | ||
NODE_ADDRESS_2: http://hoprd-ctdapp--2:3001 | ||
NODE_ADDRESS_3: http://hoprd-ctdapp--3:3001 | ||
NODE_ADDRESS_4: http://hoprd-ctdapp--4:3001 | ||
NODE_ADDRESS_5: http://hoprd-ctdapp--5:3001 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
name: postman-config | ||
data: | ||
PARAM_BATCH_SIZE: "100" | ||
PARAM_DELAY_BETWEEN_TWO_MESSAGES: "0.3" | ||
PARAM_MESSAGE_DELIVERY_TIMEOUT: "20" | ||
PARAM_MAX_ATTEMPTS: "4" | ||
RABBITMQ_PROJECT_NAME: ct-app | ||
{{- if .Values.ctdapp.postman.extraEnvVars }} | ||
{{ .Values.ctdapp.postman.extraEnvVars | toYaml | nindent 2 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "4" | ||
name: {{ include "ctdapp.fullname" . }}-core | ||
labels: | ||
{{- include "ctdapp.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.ctdapp.core.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "ctdapp.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: core | ||
template: | ||
metadata: | ||
{{- with .Values.ctdapp.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
app.kubernetes.io/component: core | ||
{{- include "ctdapp.labels" . | nindent 8 }} | ||
{{- with .Values.ctdapp.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "ctdapp.serviceAccountName" . }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.ctdapp.image.core.repository }}:{{ .Values.ctdapp.image.core.tag }}" | ||
imagePullPolicy: {{ .Values.ctdapp.image.core.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.ctdapp.service.port }} | ||
protocol: TCP | ||
envFrom: | ||
- configMapRef: | ||
name: core-config | ||
- configMapRef: | ||
name: hoprd-nodes | ||
- secretRef: | ||
name: hoprd-nodes | ||
- secretRef: | ||
name: subgraph | ||
- secretRef: | ||
name: rabbitmq-ctdapp | ||
args: | ||
- python | ||
- '-m' | ||
- core | ||
resources: | ||
{{- toYaml .Values.ctdapp.core.resources | nindent 12 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "4" | ||
name: {{ include "ctdapp.fullname" . }}-postman | ||
labels: | ||
{{- include "ctdapp.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.ctdapp.postman.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "ctdapp.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: postman | ||
template: | ||
metadata: | ||
{{- with .Values.ctdapp.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
app.kubernetes.io/component: postman | ||
{{- include "ctdapp.labels" . | nindent 8 }} | ||
{{- with .Values.ctdapp.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "ctdapp.serviceAccountName" . }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.ctdapp.image.postman.repository }}:{{ .Values.ctdapp.image.postman.tag }}" | ||
imagePullPolicy: {{ .Values.ctdapp.image.postman.pullPolicy }} | ||
envFrom: | ||
- configMapRef: | ||
name: postman-config | ||
- configMapRef: | ||
name: hoprd-nodes | ||
- secretRef: | ||
name: hoprd-nodes | ||
- secretRef: | ||
name: postgres | ||
- secretRef: | ||
name: rabbitmq-ctdapp | ||
args: | ||
- /bin/sh | ||
- -c | ||
- | | ||
celery -A postman.postman_tasks.app worker -c 4 -n worker@%h -l info -E -Q "send_messages" | ||
resources: | ||
{{- toYaml .Values.ctdapp.postman.resources | nindent 12 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
apiVersion: rabbitmq.com/v1beta1 | ||
kind: Permission | ||
metadata: | ||
name: ctdapp | ||
namespace: rabbitmq | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "3" | ||
spec: | ||
permissions: | ||
configure: .* | ||
read: .* | ||
write: .* | ||
userReference: | ||
name: ctdapp | ||
vhost: ctdapp | ||
rabbitmqClusterReference: | ||
name: rabbitmq-ha-cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
name: hoprd-nodes | ||
data: | ||
NODE_KEY_1: {{ .Values.wallet.hoprdApiToken | b64enc }} | ||
NODE_KEY_2: {{ .Values.wallet.hoprdApiToken | b64enc }} | ||
NODE_KEY_3: {{ .Values.wallet.hoprdApiToken | b64enc }} | ||
NODE_KEY_4: {{ .Values.wallet.hoprdApiToken | b64enc }} | ||
NODE_KEY_5: {{ .Values.wallet.hoprdApiToken | b64enc }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
name: postgres | ||
data: | ||
PGDATABASE: {{ .Values.ctdapp.postgres.database | b64enc }} | ||
PGHOST: {{ .Values.ctdapp.postgres.host | b64enc }} | ||
PGPASSWORD: {{ .Values.ctdapp.postgres.password | b64enc }} | ||
PGPORT: {{ .Values.ctdapp.postgres.port | b64enc }} | ||
PGUSER: {{ .Values.ctdapp.postgres.username | b64enc }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
replicator.v1.mittwald.de/replicate-to: rabbitmq | ||
name: rabbitmq-ctdapp | ||
data: | ||
CELERY_BROKER_URL: {{ .Values.ctdapp.rabbitmq.celeryBrokerUrl | b64enc }} | ||
RABBITMQ_HOST: {{ .Values.ctdapp.rabbitmq.host | b64enc }} | ||
RABBITMQ_PASSWORD: {{ .Values.ctdapp.rabbitmq.password | b64enc }} | ||
RABBITMQ_USERNAME: {{ .Values.ctdapp.rabbitmq.username | b64enc }} | ||
RABBITMQ_VIRTUALHOST: {{ .Values.ctdapp.rabbitmq.virtualhost | b64enc }} | ||
password: {{ .Values.ctdapp.rabbitmq.password | b64enc }} | ||
username: {{ .Values.ctdapp.rabbitmq.username | b64enc }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
name: subgraph | ||
data: | ||
SUBGRAPH_SAFES_BALANCE_URL: {{ .Values.ctdapp.subgraph.safesBalanceUrl | b64enc }} | ||
SUBGRAPH_SAFES_BALANCE_URL_BACKUP: {{ .Values.ctdapp.subgraph.safesBalanceUrlBackup | b64enc }} | ||
SUBGRAPH_WXHOPR_TXS_URL: {{ .Values.ctdapp.subgraph.wxhporTxsUrl | b64enc }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "5" | ||
name: {{ include "ctdapp.fullname" . }} | ||
labels: | ||
{{- include "ctdapp.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.ctdapp.service.type }} | ||
ports: | ||
- port: {{ .Values.ctdapp.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "ctdapp.selectorLabels" . | nindent 4 }} | ||
app.kubernetes.io/component: core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.ctdapp.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "ctdapp.serviceAccountName" . }} | ||
labels: | ||
{{- include "ctdapp.labels" . | nindent 4 }} | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
iam.gke.io/gcp-service-account: ctdapp@hopr-{{ .Values.environmentName }}.iam.gserviceaccount.com | ||
{{- with .Values.ctdapp.serviceAccount.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
automountServiceAccountToken: {{ .Values.ctdapp.serviceAccount.automount }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: rabbitmq.com/v1beta1 | ||
kind: User | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "2" | ||
name: ctdapp | ||
namespace: rabbitmq | ||
spec: | ||
importCredentialsSecret: | ||
name: rabbitmq-ctdapp | ||
rabbitmqClusterReference: | ||
name: rabbitmq-ha-cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
apiVersion: rabbitmq.com/v1beta1 | ||
kind: Vhost | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "2" | ||
name: ctdapp | ||
namespace: rabbitmq | ||
spec: | ||
name: ctdapp | ||
rabbitmqClusterReference: | ||
name: rabbitmq-ha-cluster |
Oops, something went wrong.