Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argo kubecost #1449

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
409f8d6
Optionally import recipes for local development/testing
aajimal Apr 14, 2024
d8fd42d
Fix typo
aajimal Apr 18, 2024
4ec7d09
Create dir if not existing
aajimal Apr 18, 2024
3c765c9
Debug conductor image
aajimal Apr 18, 2024
0721487
testing
aajimal Apr 18, 2024
923e5da
testing
aajimal Apr 18, 2024
4d52284
Minimal app/appset configs from argocd-apps
aajimal Apr 18, 2024
1628f77
Cleanup markdown
aajimal Apr 18, 2024
959a8f8
Cleanup markdown again
aajimal Apr 18, 2024
ec61469
Add clarifying comments
aajimal Apr 19, 2024
8d87630
Move configs tracking main
aajimal Apr 19, 2024
830ffb4
Copy chart-release configs
aajimal Apr 19, 2024
e32ac8f
Forgot to save file
aajimal Apr 19, 2024
bfc93d1
Move appset configs
aajimal Apr 19, 2024
c2b15ad
Init container
aajimal Apr 22, 2024
07d4b73
Init container
aajimal Apr 22, 2024
602fbec
init
aajimal Apr 22, 2024
34e5e68
init
aajimal Apr 22, 2024
443caf3
init
aajimal Apr 22, 2024
d9caaf0
Merge branch 'main' into argo-pe-charts
aajimal Apr 22, 2024
a11ef01
Version bump to pass lint check
aajimal Apr 22, 2024
b54bd8b
init
aajimal Apr 22, 2024
185a88c
Test values
aajimal Apr 22, 2024
8aff3a1
Test values
aajimal Apr 22, 2024
1552eba
Merge branch 'main' into argo-pe-charts
aajimal Apr 23, 2024
431f78e
Use devtag for sequencer because default crashloops
aajimal Apr 23, 2024
48d2570
Comment out values
aajimal Apr 23, 2024
2c79490
Set main to dev
aajimal Apr 23, 2024
1986146
Set some ids to match
aajimal Apr 23, 2024
906b982
sequencer-faucet: secretProvider.enabled=false
aajimal Apr 24, 2024
bbc620d
Merge branch 'main' into argo-pe-charts
aajimal Apr 24, 2024
4bcde44
Moving appsets to use PR-XX docker images again
aajimal Apr 24, 2024
2510394
Merge branch 'main' into argo-pe-charts
aajimal May 9, 2024
78cfd37
Enable metrics for preview envs
aajimal May 9, 2024
adfc8d7
Enable metrics for main-tracking apps
aajimal May 9, 2024
636ab25
lint
aajimal May 10, 2024
1c43037
Merge branch 'main' into argo-pe-charts
aajimal May 10, 2024
9dbbddb
Merge branch 'main' into argo-pe-charts
aajimal May 15, 2024
8695d32
Example kubecost app
aajimal May 15, 2024
f3842c2
Update w/ gcp info
aajimal May 20, 2024
1ddf6d3
Update w/ gcp info
aajimal May 20, 2024
21d8bd5
Update gcp info
aajimal May 20, 2024
4e1489c
Update gcp info
aajimal May 20, 2024
111c850
Save WIP
aajimal May 31, 2024
895821f
Debug info
aajimal Jun 17, 2024
1323f8d
comment
aajimal Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ target/

# We don't want to commit the dependency directory of charts
charts/*/charts

# justfiles
*.just
62 changes: 62 additions & 0 deletions argocd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# ArgoCD Guide

ArgoCD apps and appsets can be applied and edited with the ArgoCD CLI or with kubectl.

## Kubectl

To apply an app or appset with kubectl, use the following command:

kubectl -n argocd apply -f <APP_OR_APPSET_YAML>
Note: The namespace `argocd` is the default namespace for an ArgoCD instance.

## ArgoCD CLI

### Prerequisites

- Download and install the ArgoCD CLI from the official ArgoCD repository
or from your package manager (e.g. `brew install argocd`).

### Usage

1. Ensure that you are logged in to your ArgoCD server using the following command:

argocd login <ARGOCD_SERVER_URL> --grpc-web --sso

Replace `<ARGOCD_SERVER_URL>` with the URL of your ArgoCD server.

2. After login you can use the CLI to add/create/update/view apps and appsets:

For example:

argocd app list -o name

and

argocd appset list -o name

will list all apps and appsets in your ArgoCD server.

3. To create/update your apps or appsets use the following commands:

argocd app create -f <APP_YAML> --upsert

or

argocd appset create -f <APPSET_YAML> --upsert

Note: The `--upsert` flag will update the app or appset if it already exists
(otherwise it will create a new one).

4. To delete an app or appset, use the following commands:

argocd app delete <APP_NAME>

or

argocd appset delete <APPSET_NAME>

Note: The `--cascade` flag will delete all resources associated with the app
or appset.

There are various other commands available for the ArgoCD CLI.
For more information, refer to the official ArgoCD documentation.
153 changes: 153 additions & 0 deletions argocd/apps/dev/main/rollup-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Source: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: main-rollup
namespace: argocd
spec:
project: default
destination:
server: https://kubernetes.default.svc
namespace: main-dev-cluster
sources:
- repoURL: https://github.com/astriaorg/astria.git
targetRevision: main
path: charts/evm-rollup
helm:
# https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-value-precedence
# Order of precedence is as follows:
# lowest -> valueFiles
# -> values
# -> valuesObject
# highest -> parameters


# valueFiles:
# - $values/apps/rollup/dusk-4/values.yaml


valuesObject:
global:
dev: true
rollup:
metrics:
enabled: true
serviceMonitor:
enabled: true
# celestia-node:
# enabled: false
# ingress:
# services:
# rpc:
# annotations:
# external-dns.alpha.kubernetes.io/ttl: "120"
# external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
# kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# ws:
# annotations:
# external-dns.alpha.kubernetes.io/ttl: "120"
# external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
# kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# faucet:
# annotations:
# external-dns.alpha.kubernetes.io/ttl: "120"
# external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
# kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# explorer:
# annotations:
# external-dns.alpha.kubernetes.io/ttl: "120"
# external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
# kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"


parameters:
# Use parameter overrides w/ strings because templating with values/valuesObjects doesn't work
# https://argo-cd.readthedocs.io/en/stable/user-guide/build-environment
# Build environment vars:
# ARGOCD_APP_NAME
# ARGOCD_APP_NAMESPACE
# ARGOCD_APP_REVISION
# ARGOCD_APP_REVISION_SHORT
# ARGOCD_APP_SOURCE_PATH
# ARGOCD_APP_SOURCE_REPO_URL
# ARGOCD_APP_SOURCE_TARGET_REVISION)

- name: global.namespace
value: $ARGOCD_APP_NAMESPACE
- name: ingress.hostname
value: $ARGOCD_APP_NAMESPACE.dev.astria.org

- name: config.rollup.name
value: $ARGOCD_APP_NAME
- name: config.rollup.chainId
value: $ARGOCD_APP_NAME

- name: config.sequencer.chainId
value: "astria-pr-{{.number}}"
- name: config.sequencer.grpc
value: "http://node0-sequencer-grpc-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:8080"
- name: config.sequencer.rpc
value: "http://node0-sequencer-rpc-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:26657"

- name: config.celestia.rpc
value: "http://celestia-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:26658"
- name: config.celestia.ws
value: "ws://celestia-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:26658"
- name: config.celestia.token
value: "http://celestia-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:5353"

# https://github.com/argoproj/argo-cd/issues/6940
# https://github.com/argoproj/argo-cd/issues/8464
- name: ingress.services.rpc.annotations\.external-dns\.alpha\.kubernetes\.io/hostname
value: "rpc.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"
- name: ingress.services.rpc.hosts[0]
value: "rpc.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"

- name: ingress.services.ws.annotations\.external-dns\.alpha\.kubernetes\.io/hostname
value: "ws.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"
- name: ingress.services.ws.hosts[0]
value: "ws.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"

- name: ingress.services.faucet.annotations\.external-dns\.alpha\.kubernetes\.io/hostname
value: "faucet.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"
- name: ingress.services.faucet.hosts[0]
value: "faucet.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"

- name: ingress.services.explorer.annotations\.external-dns\.alpha\.kubernetes\.io/hostname
value: "explorer.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"
- name: ingress.services.explorer.hosts[0]
value: "explorer.evm.$ARGOCD_APP_NAMESPACE.dev.astria.org"


# - repoURL: https://github.com/astriaorg/argocd-apps.git
# ref: values
# targetRevision: main

syncPolicy:
automated:
prune: true
selfHeal: false
allowEmpty: true
# For automatic namespace cleanup, ensure argocd-cm sets application.resourceTrackingMethod to
#
# application.resourceTrackingMethod: annotation
#
# or
#
# application.resourceTrackingMethod: annotation+label
#
# https://github.com/argoproj/argo-cd/issues/7875#issuecomment-1948588656
# managedNamespaceMetadata:
# labels:
# # # <$ARGOCD_APP_NAME>
# argocd.argoproj.io/instance: main-rollup
# annotations:
# # <$ARGOCD_APP_NAME>:/Namespace:$ARGOCD_APP_NAMESPACE
# argocd.argoproj.io/tracking-id: >-
# main-rollup:/Namespace:main-dev-cluster
syncOptions:
- CreateNamespace=true
81 changes: 81 additions & 0 deletions argocd/apps/dev/main/sequencer-faucet-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Source: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: main-sequencer-faucet
namespace: argocd
spec:
project: default
destination:
server: https://kubernetes.default.svc
namespace: main-dev-cluster
sources:
- repoURL: https://github.com/astriaorg/astria.git
targetRevision: main
path: charts/sequencer-faucet
helm:
# https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-value-precedence
# Order of precedence is as follows:
# lowest -> valueFiles
# -> values
# -> valuesObject
# highest -> parameters


# valueFiles:
# - $values/apps/sequencer-faucet/dev/values.yaml


valuesObject:
secretProvider:
enabled: false
# ingress:
# annotations:
# external-dns.alpha.kubernetes.io/ttl: "120"
# external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
# kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"


parameters:
# Use parameter overrides w/ strings because templating with values/valuesObjects doesn't work
- name: global.namespace
value: $ARGOCD_APP_NAMESPACE
- name: ingress.hostname
value: $ARGOCD_APP_NAMESPACE.dev.astria.org

- name: config.sequencerRpcUrl
value: http://node0-sequencer-rpc-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:26657

# - name: ingress.annotations\.external-dns\.alpha\.kubernetes\.io/hostname
# value: "faucet.sequencer.$ARGOCD_APP_NAMESPACE.dev.astria.org"
# - name: ingress.hosts[0]
# value: "faucet.sequencer.$ARGOCD_APP_NAMESPACE.dev.astria.org"

# - repoURL: https://github.com/astriaorg/argocd-apps.git
# ref: values
# targetRevision: main
syncPolicy:
automated:
prune: true
selfHeal: false
allowEmpty: true
# For automatic namespace cleanup, ensure argocd-cm sets application.resourceTrackingMethod to
#
# application.resourceTrackingMethod: annotation
#
# or
#
# application.resourceTrackingMethod: annotation+label
#
# https://github.com/argoproj/argo-cd/issues/7875#issuecomment-1948588656
# managedNamespaceMetadata:
# labels:
# # # <$ARGOCD_APP_NAME>
# argocd.argoproj.io/instance: main-sequencer-faucet
# annotations:
# # <$ARGOCD_APP_NAME>:/Namespace:$ARGOCD_APP_NAMESPACE
# argocd.argoproj.io/tracking-id: >-
# main-sequencer-faucet:/Namespace:main-dev-cluster
syncOptions:
- CreateNamespace=true
90 changes: 90 additions & 0 deletions argocd/apps/dev/main/sequencer-validator-0-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Source: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: main-sequencer-0
namespace: argocd
spec:
project: default
destination:
server: https://kubernetes.default.svc
namespace: main-dev-cluster
sources:
- repoURL: https://github.com/astriaorg/astria.git
targetRevision: main
path: charts/sequencer
helm:
# https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-value-precedence
# Note: Order of precedence is as follows:
# lowest -> valueFiles
# -> values
# -> valuesObject
# highest -> parameters


# valueFiles:
# - $values/apps/sequencer/dev/values-node-0.yaml


valuesObject:
global:
dev: true
ingress:
grpc:
enabled: true
config:
sequencer:
metrics:
enabled: true
serviceMonitor:
enabled: true
# sequencer-relayer:
# enabled: true


parameters:
# Use parameter overrides w/ strings because templating with values/valuesObjects doesn't work
- name: global.namespace
value: $ARGOCD_APP_NAMESPACE
- name: ingress.hostname
value: $ARGOCD_APP_NAMESPACE.dev.astria.org
- name: ingress.rpc.hostname
value: $ARGOCD_APP_NAMESPACE.dev.astria.org
- name: ingress.grpc.hostname
value: $ARGOCD_APP_NAMESPACE.dev.astria.org

- name: sequencer-relayer.config.relayer.celestiaRpc
value: http://celestia-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:26658
- name: sequencer-relayer.config.relayer.cometbftRpc
value: http://node0-sequencer-rpc-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:26657
- name: sequencer-relayer.config.relayer.sequencerGrpc
value: http://node0-sequencer-grpc-service.$ARGOCD_APP_NAMESPACE.svc.cluster.local:8080


# - repoURL: https://github.com/astriaorg/argocd-apps.git
# ref: values
# targetRevision: main
syncPolicy:
automated:
prune: true
selfHeal: false
allowEmpty: true
# For automatic namespace cleanup, ensure argocd-cm sets application.resourceTrackingMethod to
#
# application.resourceTrackingMethod: annotation
#
# or
#
# application.resourceTrackingMethod: annotation+label
#
# https://github.com/argoproj/argo-cd/issues/7875#issuecomment-1948588656
# managedNamespaceMetadata:
# labels:
# # # <$ARGOCD_APP_NAME>
# argocd.argoproj.io/instance: main-sequencer-0
# annotations:
# # <$ARGOCD_APP_NAME>:/Namespace:$ARGOCD_APP_NAMESPACE
# argocd.argoproj.io/tracking-id: >-
# main-sequencer-0:/Namespace:main-dev-cluster
syncOptions:
- CreateNamespace=true
Loading