parse ingress logs towards opensearch
you need to know if you’re using docker or cri engine
– we will use cri
here
#minikube delete --all minikube start --driver=docker --container-runtime=containerd # --container-runtime=containerd # --container-runtime=cri-o # --container-runtime=docker
check that you will get the CRI format with containerd (last column)
kubectl get nodes -o wide # docker://24.0.4 # containerd://1.6.21 minikube ssh pgrep -a kubelet # --container-runtime-endpoint=unix:///var/run/cri-dockerd.sock # --container-runtime-endpoint=unix:///run/containerd/containerd.sock ^D
#kubectl create deploy web --image=gcr.io/google-samples/hello-app:1.0 #kubectl expose deploy web --type=ClusterIP --port=8080 kubectl create deploy web --image=pbraun9/sabotage-nginx-debug:latest kubectl expose deploy web --type=ClusterIP --port=80 kubectl get deploy -o wide kubectl get svc -o wide kubectl describe endpoints web
minikube addons enable ingress kubectl get pods -n ingress-nginx vi ingress-logtest.yaml
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-logtest spec: rules: - host: hello-world.info http: paths: - path: / pathType: Prefix backend: service: name: web port: number: 80
kubectl apply -f ingress-logtest.yaml kubectl get ingress
see k8s-ingress-logs-acceptance
you can now proceed with data-stream setup and fluent-bit
https://opensearch.org/docs/latest/dashboards/dql
https://fluentbit.io/blog/2021/01/25/logging-fluentd-with-kubernetes/
https://serverfault.com/questions/862308/how-do-i-view-logs-for-my-kubernetes-ingress-controller ==> kubectl logs -l
https://www.nginx.com/blog/guide-to-choosing-ingress-controller-part-4-nginx-ingress-controller-options/ ==> ingress-nginx vs. kubernetes-ingress
https://minikube.sigs.k8s.io/docs/handbook/config/
https://minikube.sigs.k8s.io/docs/runtimes/
https://stackoverflow.com/questions/54314250/gzip-in-gke-with-nginx-ingress
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/
https://stackoverflow.com/questions/15999606/enable-gzip-compression-with-nginx
https://github.com/google/ngx_brotli