Skip to content

Commit

Permalink
feat(ci): Get full cluster info and simplify docs pod deployment/tear…
Browse files Browse the repository at this point in the history
…down
  • Loading branch information
stevenj committed May 21, 2024
1 parent 4bb0158 commit 2785d78
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
19 changes: 18 additions & 1 deletion catalyst-gateway/event-db/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,24 @@ build:
FROM +builder

DO postgresql-ci+BUILD --image_name=event-db
DO postgresql-ci+DOCS --image_name=event-db
DO postgresql-ci+DOCS

# local : Make a locally runable container that can serve the db.
# --push will cause this image to be pushed to the local development cluster
# --local_registry : Set this to the hostname of your local registry or "" to inhibit.
local:
# Change this to point to another local registry, OR set to "" to disable
# pushing to a local registry even if `--push` is passed.
# this should be "registry.cluster.test:5000" but Earthly can not reliably locate it in a hosts file.
ARG local_registry="192.168.58.10:5000"

FROM +build

# Publish to the local development cluster
IF [ "$local_registry" != "" ]
SAVE IMAGE --push --insecure $local_registry/event-db:latest
END


# test the event db database schema
# CI target : true
Expand Down
1 change: 1 addition & 0 deletions docs/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ docs:
local:
# Change this to point to another local registry, OR set to "" to disable
# pushing to a local registry even if `--push` is passed.
# this should be "registry.cluster.test:5000" but Earthly can not reliably locate it in a hosts file.
ARG local_registry="192.168.58.10:5000"
# Build a self contained service to show built docs locally.
DO docs-ci+PACKAGE
Expand Down
24 changes: 15 additions & 9 deletions utilities/local-cluster/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,27 @@ kubernetes-base:
deploy-docs:
FROM +kubernetes-base

RUN kubectl apply -f manifests/docs.yml
RUN kubectl create namespace cat-voices || true
RUN kubectl apply -f manifests/cat-voices-docs.yml

# test target to stop the local documentation
stop-docs:
FROM +kubernetes-base

RUN kubectl delete deployment cat-gateway-docs
RUN kubectl delete service cat-gateway-docs
RUN kubectl delete ingress cat-gateway-docs -n cat-voices || true
RUN kubectl delete deployment cat-gateway-docs -n cat-voices || true
RUN kubectl delete service cat-gateway-docs -n cat-voices || true

# show-info : list important info about the running cluster
show-info:
FROM +kubernetes-base

# RUN kubectl --kubeconfig shared/k3s.yaml -o wide get nodes
RUN --no-cache kubectl -n kube-system get all
RUN --no-cache kubectl -o wide get nodes
RUN --no-cache kubectl -o wide get pods
RUN --no-cache kubectl -o wide get service
ARG local_file=""

# Get everything from all namespaces
RUN --no-cache kubectl -o wide get all --all-namespaces > cluster.info

IF [ "$local_file" == "" ]
RUN cat cluster.info
ELSE
SAVE ARTIFACT cluster.info AS LOCAL "$local_file"
END

0 comments on commit 2785d78

Please sign in to comment.