![]() ![]() Now test it with the error code 413, we see it works as expected, curl -i " " HTTP/1.1 413 Request Entity Too Large Server: nginx/1.15.10 Date: Sun, 10:59:18 GMT Content-Type: text/plain charset=utf-8 Content-Length: 8 Connection: keep-alive Code=413 Problem with the default Nginx default-backend ( I have removed the default traefik ingress controller from K3s, deployed the nginx ingress helm chart with the default settings.) apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx /rewrite-target: / labels: app: err-status-test name: err-status-test spec: backend: serviceName: err-status-test servicePort: 80 rules: - host: err-test.192.168.64.5.nip.io http: paths: - path: / backend: serviceName: err-status-test servicePort: 8080 - apiVersion: v1 kind: Service metadata: name: err-status-test labels: app: err-status-test spec: type: NodePort ports: - port: 80 targetPort: 8080 protocol: TCP name: http selector: app: err-status-test - apiVersion: apps/v1 kind: Deployment metadata: name: err-status-test labels: app: err-status-test spec: replicas: 1 selector: matchLabels: app: err-status-test template: metadata: labels: app: err-status-test spec: containers: - name: err-status-test image: zhiminwen/error-test-app imagePullPolicy: Always func errHandler(w http.ResponseWriter, r *http.Request) īuild the docker image, push into docker hub, deploy it into my test K3s instance with the following Ingress, Service, and Deployment. It accepts a URL param and returns the HTTP status based on this param. To illustrate let's create a sample application with the following HTTP handler implemented. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |