Skip to content

Commit

Permalink
feat: use ghcr.io container image for kubernetes devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
glebiller committed Aug 9, 2022
1 parent 9b90f73 commit b3c3bc0
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- k3d-devnet

jobs:
release:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /workspace
COPY . .
RUN LEDGER_ENABLED=false make build

FROM scratch
FROM ghcr.io/glebiller/tendermint-readiness:0.1.0
COPY --from=build /workspace/build/elestod /elestod

ENTRYPOINT ["/elestod"]
1 change: 1 addition & 0 deletions scripts/devnet/kubernetes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registries.yaml
4 changes: 2 additions & 2 deletions scripts/devnet/kubernetes/2-genesis/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
spec:
initContainers:
- name: init-blockchain
image: elestod-init:local
image: ghcr.io/elesto-dao/elesto-init:22.217-1659728311-910d4da
command:
- init-genesis.sh
env:
Expand All @@ -49,7 +49,7 @@ spec:
mountPath: /home/
containers:
- name: application
image: us-central1-docker.pkg.dev/elesto/elesto/elestod:2.0.0-rc2-snapshots
image: ghcr.io/elesto-dao/elesto:22.217-1659728311-910d4da
args: [
"start",
"--db_backend", "goleveldb",
Expand Down
4 changes: 2 additions & 2 deletions scripts/devnet/kubernetes/3-seed/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
spec:
initContainers:
- name: init-seed
image: elestod-init:local
image: ghcr.io/elesto-dao/elesto-init:22.217-1659728311-910d4da
command:
- init-seed.sh
env:
Expand All @@ -46,7 +46,7 @@ spec:
mountPath: /home/
containers:
- name: application
image: us-central1-docker.pkg.dev/elesto/elesto/elestod:2.0.0-rc2-snapshots
image: ghcr.io/elesto-dao/elesto:22.217-1659728311-910d4da
args: [
"start",
"--db_backend", "memdb",
Expand Down
4 changes: 2 additions & 2 deletions scripts/devnet/kubernetes/4-validator/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
spec:
initContainers:
- name: init-validator
image: elestod-init:local
image: ghcr.io/elesto-dao/elesto-init:22.217-1659728311-910d4da
command:
- init-validator.sh
env:
Expand All @@ -46,7 +46,7 @@ spec:
mountPath: /home/
containers:
- name: application
image: us-central1-docker.pkg.dev/elesto/elesto/elestod:2.0.0-rc2-snapshots
image: ghcr.io/elesto-dao/elesto:22.217-1659728311-910d4da
args: [
"start",
"--moniker", "$(MONIKER)",
Expand Down
10 changes: 5 additions & 5 deletions scripts/devnet/kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
INIT_IMAGE_TAG ?= elestod-init:local
NODE_IMAGE_TAG ?= us-central1-docker.pkg.dev/elesto/elesto/elestod:2.0.0-rc2-snapshots
INIT_IMAGE_TAG ?= ghcr.io/elesto-dao/elesto-init:22.217-1659728311-910d4da
NODE_IMAGE_TAG ?= ghcr.io/elesto-dao/elesto:22.217-1659728311-910d4da

k3d-start:
k3d cluster create --config k3d.yaml --wait || k3d cluster list | grep elesto
k3d cluster create --config k3d.yaml --registry-config registries.yaml --wait || k3d cluster list | grep elesto
.PHONY: k3d-start

build-init:
Expand All @@ -13,7 +13,7 @@ import-images: build-init
k3d image import $(INIT_IMAGE_TAG) $(NODE_IMAGE_TAG) --cluster elesto
.PHONY: import-init

k3d-deploy: import-images
k3d-deploy:
kubectl apply -k . --wait=true
.PHONY: k3d-deploy

Expand All @@ -22,5 +22,5 @@ k3d-stop k3d-delete:
.PHONY:k3d-stop k3d-delete

port-forward:
kubectl port-forward --namespace local svc/gensis 26657
kubectl port-forward --namespace local svc/genesis 26657
.PHONY:port-forward
9 changes: 9 additions & 0 deletions scripts/devnet/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@

## Using k3d

⚠️ While the elesto repository is private,
GitHub credentials are required to access the GitHub Container Registry.
Copy the `registries.yaml.sample` into `registries.yaml`and replace username, password
with an active and valid [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).

`make k3d-start k3d-deploy`

## Accessing a node

`make port-forward` or `kubectl port-forward --namespace local svc/genesis 26657`
Then `curl localhost:26657/validators | jq '.result.validators[].address'`

## Download the genesis file

`kubectl get configmap --namespace local genesis --output jsonpath='{.data.genesis\.json}' | jq`

## Entity relationship diagram

```mermaid
Expand Down
5 changes: 5 additions & 0 deletions scripts/devnet/kubernetes/registries.yaml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
configs:
ghcr.io:
auth:
username: github-username
password: ghp_personal-access-token-key

0 comments on commit b3c3bc0

Please sign in to comment.