add ingress test
This commit is contained in:
parent
65da349caa
commit
7dbad5c606
54
.github/workflows/k3d-log-ci.yaml
vendored
54
.github/workflows/k3d-log-ci.yaml
vendored
@ -6,16 +6,14 @@ jobs:
|
|||||||
btrix-k3d-admin-logging-test:
|
btrix-k3d-admin-logging-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Create k3d Cluster
|
||||||
name: Create k3d Cluster
|
|
||||||
uses: AbsaOSS/k3d-action@v2
|
uses: AbsaOSS/k3d-action@v2
|
||||||
with:
|
with:
|
||||||
cluster-name: btrix-1
|
cluster-name: btrix-1
|
||||||
args: >-
|
args: >-
|
||||||
-p "30870:30870@agent:0:direct"
|
|
||||||
--agents 1
|
--agents 1
|
||||||
--no-lb
|
-p "443:443@loadbalancer"
|
||||||
--k3s-arg "--no-deploy=traefik,servicelb,metrics-server@server:*"
|
--k3s-arg "--no-deploy=traefik,metrics-server@server:*"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -30,12 +28,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Add hosts to /etc/hosts
|
- name: Add hosts to /etc/hosts
|
||||||
run: |
|
run: |
|
||||||
sudo echo "127.0.0.1 myhost" | sudo tee -a /etc/hosts
|
sudo echo "127.0.0.1 myhost.internal" | sudo tee -a /etc/hosts
|
||||||
|
|
||||||
|
- name: Install nginx ingress controller
|
||||||
|
run: |
|
||||||
|
helm install --namespace kube-system nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx
|
||||||
|
sleep 5
|
||||||
|
POD=$(kubectl get pods -A | grep nginx-ingress | head -n 1 | awk '{print $2}')
|
||||||
|
while [[ $(kubectl get pods $POD -n kube-system -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do kubectl get pods -n kube-system; sleep 5; done
|
||||||
|
sleep 20
|
||||||
|
|
||||||
- name: Start Cluster with Helm (chart/admin/logging)
|
- name: Start Cluster with Helm (chart/admin/logging)
|
||||||
run: |
|
run: |
|
||||||
./chart/admin/logging/scripts/eck_install.sh
|
./chart/admin/logging/scripts/eck_install.sh
|
||||||
helm upgrade --install -f ./chart/admin/logging/values.yaml btrix-admin-log ./chart/admin/logging --set logging.ingress.host=myhost
|
helm upgrade --install -f ./chart/admin/logging/values.yaml btrix-admin-log ./chart/admin/logging --set logging.ingress.host=myhost.internal
|
||||||
|
|
||||||
- name: Wait for all pods to be ready
|
- name: Wait for all pods to be ready
|
||||||
run: |
|
run: |
|
||||||
@ -45,25 +51,33 @@ jobs:
|
|||||||
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 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=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
|
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 pod -n btrix-admin -o wide
|
||||||
kubectl get svc -n btrix-admin
|
kubectl get svc -n btrix-admin -o wide
|
||||||
kubectl get ingress -A
|
kubectl get ingress -A -o wide
|
||||||
kubectl describe ingress kibana-main -n btrix-admin
|
kubectl describe ingress kibana-main -n btrix-admin
|
||||||
# check the auto-generated password for elastic
|
# 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
|
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
|
- name: Test Kibana via port-forward
|
||||||
run: |
|
run: |
|
||||||
sleep 30
|
sleep 20
|
||||||
kubectl port-forward service/btrixlog-kb-http -n btrix-admin 5601:5601 &
|
kubectl port-forward service/btrixlog-kb-http -n btrix-admin 5601:5601 &
|
||||||
sleep 5
|
sleep 5
|
||||||
curl --retry 10 --retry-delay 5 --retry-connrefused -k -v --header "Host: myhost" https://localhost:5601/kibana
|
curl -k -v https://myhost.internal:5601/kibana/ 2>&1 | grep -i "location"
|
||||||
|
|
||||||
# - name: Test Ingress
|
- name: Test Kibana via Ingress
|
||||||
# run: |
|
run: |
|
||||||
# curl --retry 10 --retry-delay 5 --retry-connrefused -k https://myhost/kibana
|
kubectl get ingress -A -o wide
|
||||||
|
# kubectl describe ingress kibana-main -n btrix-admin
|
||||||
|
# kubectl describe pod $POD -n kube-system
|
||||||
|
curl -v -k https://myhost.internal/kibana/ 2>&1 | grep -i "location"
|
||||||
|
|
||||||
# - name: Clean up
|
- name: Install Kibana dashboard
|
||||||
# run: |
|
run: |
|
||||||
# helm uninstall btrix-admin-log
|
cd ./chart/admin/logging/scripts
|
||||||
# ./chart/admin/logging/scripts/eck_uninstall.sh
|
./kibana_imports.sh
|
||||||
|
|
||||||
|
- name: Clean up
|
||||||
|
run: |
|
||||||
|
helm uninstall btrix-admin-log
|
||||||
|
./chart/admin/logging/scripts/eck_uninstall.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user