We changed our privacy policy. Read more.

Hot answers tagged

6

It's would be better if you will use ClusterIP type as a service than apply Ingress resource on it https://kubernetes.io/docs/concepts/services-networking/ingress/#single-service-ingress


2

It just works Your configuration is correct. Provided YAML file generates nginx config like this: ... server { listen 80; server_name example.com; ... location ~* "^/service/test" { root /var/www/example.com/htdocs; } } Testing this config via this cool tester shows that location filter works: http://example.com/service/test1 -> ...


2

For your first question: When using a Kubernetes LoadBalancer or Ingress, is the normal NodePort used as the underlying connection point? Technically it depends on the cloud network for LoadBalancers (e.g. Google Compute Engine does not technically require this although one may be created). However, I believe a NodePort and ClusterIP are generally ...


2

I would suggest at least one for production and one for npe. The nginx-ingress helm chart appears to only support setting a scope to all namespaces or just one namespace (a frustrating limitation not in other ingress controller options): https://github.com/helm/charts/tree/master/stable/nginx-ingress controller.scope.namespace


2

First of all 404 error is resource error in kubernetes. It means your container in the pod is not created by your first script. Even if it is created and you can see it then your labeling is wrong in the second script. I would suggest you check matchlabels of both YAML scripts. So in your case I can see that matchlabel is docker-registry in the spec ...


2

I was able to combine your two example files by first converting them to JSON. foo.json { "apiVersion": "extensions/v1beta1", "kind": "Ingress", "metadata": { "name": "nginx-ingress" }, "spec": { "tls": [ { "hosts": [ "foo.bar.com" ], "secretName": "tls-secret" } ], "rules": [ { ...


2

You can't configure your Ingress to serve static data (from your host files for example) alone because the Ingress resource is just a way to configure a way of understanding for Kubernetes on how to access a specific internal resource from outside the cluster. An API object that manages external access to the services in a cluster, typically HTTP. Ingress ...


1

You explained what each does pretty well! I strongly suggest reading the documentation, especially for the commands, don't rely on tutorials only.helm commands helm repo add => This is what it stands for, it adds a new helm chart repository. helm repo update => Update gets the latest information about charts from the respective chart repositories. When ...


1

Same TLS secret will not be mapped to two ingress at the same time within a namespace.It will map to the first deployed ingress. Create the same secret with a different name and map it to the other ingress for it to work.


1

Your ServiceMonitor seems to be correct with the exception that you have defined no path under spec.endpoints. You also need to define the port named prometheus under the ingress-nginx service or deployment. ServiceMonitors can be debugged this way:- Check if the ServiceMonitor created is being read by the Prometheus:- Look at the /targets URL. (There ...


1

Set automountServiceAccountToken: true in your pod specification in both of the jobs and the deployment. Ref: https://discuss.kubernetes.io/t/nginx-ingress-install-failure/5379/4


1

Try using this:- use-forwarded-headers apiVersion: v1 kind: ConfigMap data: use-forwarded-headers: "true" metadata: name: nginx-configuration namespace: default


1

I don't think it is the compatibility, need to really see your configuration to be sure. But most likely, you block something wrongly. If you use the default network policy api networking.k8s.io/v1 notice that it only allows what is defined.


1

The ConfigMap and Annotation configuration have different purposes. As per nginx-configuration/configmap/#ssl-protocols: Sets the SSL protocols to use. The default is: TLSv1.2 TLSv1.3 ngx_http_ssl_module.html#ssl_protocols Context: http, server i.e., enable the specified protocols to your Nginx Controller. client --ssl-protocols-> controller --> ...


1

I'm trying to architect a micro-service application, that runs in Kubernetes. It consists of several RESTful APIs. I want a central point to implement authentication for these APIs. This is a good idea. So what I'm looking for is a/the way to have central authentication in Kubernetes for users accessing the APIs. I would also require to be able to ...


1

The thing I was looking for was external-auth in ingress-nginx. I created a simple service with nodejs which took over all the basic-auth logic. Then I used an external link to this service in k8s annotations for restricted resources. annotation snippet: annotations: nginx.ingress.kubernetes.io/auth-url: http://service-name.default.svc.cluster.local:...


1

There are two main reasons for this issue to happen: Your dns are not exposed. Your code is redirecting to a https address (and since you are working in your local machine, most likely you don't have a secure certificate) CASE 1 - Exposing DNS On linux you can solve it like: minikube ip vim /etc/hosts Add the ip from the first step and the hostname you ...


1

There is no built-in configuration/annotation to handle this. Although, you can use the server-snippet annotation to create a custom configuration that intercepts the error 503, proxying the request to a service that is serving your custom error page. Example: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress annotations: ...


1

Found out that there is no specific 'default' storageclass(SC) type for Docker EE or others, it depends on the requirement and specific to Kubernetes provider(s). I went ahead and created a sc with 'local' provisioner type.


1

Could I have these two different definitions which creates a single Ingress with two rules (based on having the same name)? Lets investigate whether that would be possible. According to https://kubernetes.io/docs/concepts/services-networking/ingress/ one could update an existing ingress yaml and subsequently run kubectl replace -f. From a microservice ...


1

I learned that it's not required to set the ingress class to nginx as I did in kubernetes.io/ingress.class: nginx. All annotations prefixed with nginx.ingress.kubernetes.io apply to the default Kubernetes ingress. Setting the timeouts is also not required. The only important annotation is nginx.ingress.kubernetes.io/proxy-body-size: "0" because the default ...


1

Kubernetes ingress is implemented by changing the configuration of another container or the cloud load balancer to route traffic to the service port/ip. Docker by itself is fairly lightweight, only runs the containers you start, and does not have external dependencies on things like your cloud load balancer. The solutions to setup a reverse proxy inside a ...


1

I assume you've created your nginx ingress controller in it's own namespace? By default it's called ingress-nginx. You can create your second Nginx Ingress controller in a seperate namespace so that it's logically isolated from your first. You'll need to give it a different name, but I see no reason why you can't do that. Doing so will spin up a seperate ...


Only top voted, non community-wiki answers of a minimum length are eligible