-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(repo): General improvements for Cluster structure (#328)
* build(repo): use nats helm template instead of duplicate it * build(repo): refactor to use local publisher instead * build(repo): general improvements for the cluster * build(repo): adjust publisher chart
- Loading branch information
1 parent
55bcfc7
commit 5dfaff9
Showing
96 changed files
with
728 additions
and
3,495 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 |
---|---|---|
|
@@ -19,3 +19,5 @@ profile.json | |
.rust-version | ||
coverage/ | ||
docs/ | ||
**/**/charts/**.tgz | ||
values-publisher-env.yaml |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ exclude: | | |
(?x)^( | ||
CHANGELOG.md| | ||
pnpm-lock.yaml| | ||
helm/.*| | ||
cluster/charts/.*| | ||
node_modules/.* | ||
)$ | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,5 @@ extend-exclude = [ | |
"crates/fuel-indexer/*", | ||
"docker/chain-config", | ||
"docker/monitoring", | ||
"helm", | ||
"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
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 |
---|---|---|
@@ -1,79 +1,95 @@ | ||
#!/usr/bin/env python | ||
load('ext://restart_process', 'docker_build_with_restart') | ||
load('ext://color', 'color') | ||
load('ext://dotenv', 'dotenv') | ||
|
||
analytics_settings(True) # Enable telemetry dialogue in web UI | ||
disable_snapshots() # Disable TiltCloud Snapshots | ||
version_settings(True) # Enable 'new version' banner | ||
|
||
# parse Tiltfile config | ||
config.define_string(name="env", args=False, usage="This argument defines the build env (dev or release)") | ||
settings = config.parse() | ||
environment=settings.get('env', "dev") #dev or release | ||
# Load environment variables from .env file | ||
dotenv() | ||
|
||
# load ingresses | ||
k8s_yaml('./cluster/charts/fuel-local/crds/traefik-resources.yaml') | ||
k8s_kind('IngressRoute') | ||
# Build publisher image with proper configuration for Minikube | ||
custom_build( | ||
ref='fuel-streams-publisher:latest', | ||
command=['./cluster/scripts/build_publisher.sh'], | ||
deps=[ | ||
'./src', | ||
'./Cargo.toml', | ||
'./Cargo.lock', | ||
'./docker/fuel-streams-publisher.Dockerfile' | ||
], | ||
live_update=[ | ||
sync('./src', '/usr/src'), | ||
sync('./Cargo.toml', '/usr/src/Cargo.toml'), | ||
sync('./Cargo.lock', '/usr/src/Cargo.lock'), | ||
run('cargo build', trigger=['./src', './Cargo.toml', './Cargo.lock']) | ||
], | ||
skips_local_docker=True, | ||
ignore=['./target'] | ||
) | ||
|
||
# disable unused image | ||
update_settings(suppress_unused_image_warnings=["k8s-tools:latest"]) | ||
|
||
# project namespace | ||
namespace = "fuel-local" | ||
|
||
# load fuel helm chart | ||
fuel_chart_name = "fuel" | ||
fuel_chart_dir = "cluster/charts/fuel-local" | ||
fuel_values = "cluster/charts/fuel-local/values.yaml" | ||
k8s_yaml(helm(fuel_chart_dir, name=fuel_chart_name, namespace=namespace, values=[fuel_values], set=[])) | ||
|
||
# load nats helm chart | ||
nats_chart_name = "nats" | ||
nats_chart_dir = "cluster/charts/fuel-nats" | ||
nats_values = "cluster/charts/fuel-nats/values.yaml" | ||
k8s_yaml(helm(nats_chart_dir, name=nats_chart_name, namespace=namespace, values=[nats_values], set=[])) | ||
|
||
# load surrealdb helm chart | ||
surrealdb_chart_name = "surrealdb" | ||
surrealdb_chart_dir = "cluster/charts/fuel-surrealdb" | ||
surrealdb_values = "cluster/charts/fuel-surrealdb/values.yaml" | ||
k8s_yaml(helm(surrealdb_chart_dir, name=surrealdb_chart_name, namespace=namespace, values=[surrealdb_values], set=[])) | ||
|
||
# build publisher image | ||
# ref = 'fuel-publisher:{}' | ||
# command = 'make build-fuel-publisher-{} && docker tag fuel-publisher:{} $EXPECTED_REF'.format(environment, environment) | ||
# deps = ["./fuel-publisher/Cargo.lock", "./fuel-publisher/Cargo.toml", "./fuel-publisher/src", "./fuel-publisher/target/release/**/*"] | ||
# custom_build(ref=ref, command=command, deps=deps) | ||
|
||
# build k8s tools (tag is always latest!) | ||
ref = "k8s-tools:latest" | ||
command = "make build-k8s-tools && docker tag k8s-tools:latest $EXPECTED_REF" | ||
custom_build(ref=ref, command=command, deps=[]) | ||
# Deploy the Helm chart with values from .env | ||
k8s_yaml(helm( | ||
'cluster/charts/fuel-local', | ||
name='local', | ||
namespace='fuel-local', | ||
values=[ | ||
'cluster/charts/fuel-local/values.yaml', | ||
'cluster/charts/fuel-local/values-publisher-env.yaml', | ||
] | ||
)) | ||
|
||
# k8s resources | ||
ports = { | ||
"monitoring": ["9090:9090", "3000:3000"], | ||
"surrealdb": ["8000:8000", "8001:8001"], | ||
"elasticsearch": ["9200:9200", "9300:9300"], | ||
"kibana": ["5601:5601"], | ||
"fuel-publisher": ["4000:4000", "8080:8080"], | ||
"publisher": ["4000:4000", "8080:8080"], | ||
"nats": ["4222:4222"], | ||
"nats-box": [], | ||
} | ||
|
||
deps = { | ||
"monitoring": [], | ||
"surrealdb": [], | ||
"elasticsearch": [], | ||
"kibana": ["elasticsearch"], | ||
"fuel-publisher": [], | ||
"publisher": [], | ||
"nats": [], | ||
"nats-box": [], | ||
} | ||
|
||
k8s_resource("monitoring", port_forwards=ports["monitoring"], resource_deps=deps["monitoring"], labels="monitoring") | ||
k8s_resource("surrealdb", port_forwards=ports["surrealdb"], resource_deps=deps["surrealdb"], labels="indexer") | ||
k8s_resource("elasticsearch", port_forwards=ports["elasticsearch"], resource_deps=deps["elasticsearch"], labels="logging") | ||
k8s_resource("kibana", port_forwards=ports["kibana"], resource_deps=deps["kibana"], labels="logging") | ||
k8s_resource("fuel-publisher", port_forwards=ports["fuel-publisher"], resource_deps=deps["fuel-publisher"], labels="publisher") | ||
k8s_resource("nats", port_forwards=ports["nats"], resource_deps=deps["nats"], labels="nats") | ||
k8s_resource("nats-box", port_forwards=ports["nats-box"], resource_deps=deps["nats-box"], labels="nats") | ||
k8s_resource("monitoring", | ||
port_forwards=ports["monitoring"], | ||
resource_deps=deps["monitoring"], | ||
labels="monitoring" | ||
) | ||
k8s_resource("elasticsearch", | ||
port_forwards=ports["elasticsearch"], | ||
resource_deps=deps["elasticsearch"], | ||
labels="logging" | ||
) | ||
k8s_resource("kibana", | ||
port_forwards=ports["kibana"], | ||
resource_deps=deps["kibana"], | ||
labels="logging" | ||
) | ||
k8s_resource("local-fuel-streams-publisher", | ||
new_name="publisher", # Override the display name | ||
resource_deps=deps["publisher"], | ||
port_forwards=ports["publisher"], | ||
labels="publisher" | ||
) | ||
k8s_resource("local-nats", | ||
new_name="nats", | ||
port_forwards=ports["nats"], | ||
resource_deps=deps["nats"], | ||
labels="nats" | ||
) | ||
k8s_resource("local-nats-box", | ||
new_name="nats-box", | ||
port_forwards=ports["nats-box"], | ||
resource_deps=deps["nats-box"], | ||
labels="nats" | ||
) |
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,9 @@ | ||
dependencies: | ||
- name: fuel-streams-publisher | ||
repository: file://../fuel-streams-publisher | ||
version: 0.3.7 | ||
- name: fuel-nats | ||
repository: file://../fuel-nats | ||
version: 0.1.0 | ||
digest: sha256:4362071bef367c36d9433fa948178f176614e65a69cd5e08f880937f2c4795df | ||
generated: "2024-11-30T00:12:23.285838-03:00" |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
apiVersion: v1 | ||
apiVersion: v2 | ||
appVersion: "1.0" | ||
description: A Helm chart for Kubernetes | ||
name: fuel-local | ||
version: 0.2.0 | ||
dependencies: | ||
- name: fuel-streams-publisher | ||
version: "0.3.7" | ||
repository: "file://../fuel-streams-publisher" | ||
- name: fuel-nats | ||
version: "0.1.0" | ||
repository: "file://../fuel-nats" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Release.Name }}-fuel-streams-publisher | ||
labels: | ||
{{- include "fuel-streams-publisher.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: | ||
{{- range $key, $value := index .Values "fuel-streams-publisher" "secrets" }} | ||
{{ $key }}: {{ $value | default "" | quote }} | ||
{{- end }} |
Oops, something went wrong.