add logging service CI with k3d

This commit is contained in:
DongWoo Lee 2023-01-04 22:52:41 -08:00
parent 6a228bb370
commit 539a4556aa
2 changed files with 61 additions and 1 deletions

59
.github/workflows/k3d-log-ci.yaml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Cluster Run (K3d-Admin-Logging)
on: [push, pull_request]
jobs:
btrix-k3d-admin-logging-test:
runs-on: ubuntu-latest
steps:
-
name: Create k3d Cluster
uses: AbsaOSS/k3d-action@v2
with:
cluster-name: btrix-1
args: >-
-p "30870:30870@agent:0:direct"
--agents 1
--no-lb
--k3s-arg "--no-deploy=traefik,servicelb,metrics-server@server:*"
- name: Checkout
uses: actions/checkout@v3
- name: Install Kubectl
uses: azure/setup-kubectl@v3
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 3.10.2
- name: Start Cluster with Helm (chart/admin/logging)
run: |
./chart/admin/logging/scripts/eck_install.sh
helm upgrade --install -f ./chart/admin/logging/values.yaml btrix-admin-log ./chart/admin/logging
- name: Wait for all pods to be ready
run: |
# waiting fluentd
kubectl wait --for=condition=ready pod --all --timeout=200s -n btrix-admin
# waiting elastic-operator and ES/Kibana
while [[ $(kubectl get pods -n elastic-system -l control-plane=elastic-operator -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do kubectl get pods -n elastic-system; sleep 5; done
while [[ $(kubectl get pods -n btrix-admin -l common.k8s.elastic.co/type=elasticsearch -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do kubectl get pods -n btrix-admin; sleep 5; done
while [[ $(kubectl get pods -n btrix-admin -l common.k8s.elastic.co/type=kibana -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do kubectl get pods -n btrix-admin; sleep 5; done
kubectl get pod -n btrix-admin
kubectl get svc -n btrix-admin
kubectl get ingress -A
kubectl describe ingress kibana-main -n btrix-admin
# check the auto-generated password for elastic
while kubectl get secret btrixlog-es-elastic-user -n btrix-admin -o go-template='{{.data.elastic | base64decode}}'; ret=$?; [ $ret -ne 0 ]; do sleep 5; done
- name: Test Kibana
run: |
kubectl port-forward service/btrixlog-kb-http -n btrix-admin 5601:5601 &
curl --retry 20 --retry-delay 10 --retry-connrefused -k https://localhost:5601/kibana
# - name: Clean up
# run: |
# helm uninstall btrix-admin-log
# ./chart/admin/logging/scripts/eck_uninstall.sh

View File

@ -4,5 +4,6 @@ kubectl create namespace btrix-admin
kubectl create -f https://download.elastic.co/downloads/eck/2.5.0/crds.yaml
kubectl apply -f https://download.elastic.co/downloads/eck/2.5.0/operator.yaml
kubectl label nodes docker-desktop nodeType=admin
# kubectl label nodes docker-desktop nodeType=admin
kubectl get nodes
kubectl get nodes -o wide -o jsonpath='{.items[*].metadata.labels}' | jq .