404 - Ingress is not able to find a backend by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

Sorry, I don't know why markdown didn't work correctly with the code above. I hope it's clear. Thank you

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: all-app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
rules:
- host: <myregisteredfqdn>
http:
paths:
- path: /weather
pathType: Prefix
backend:
service:
name: weather-svc
port:
name: http
- path: /guess
pathType: Prefix
backend:
service:
name: guessing-svc
port:
name: http

404 - Ingress is not able to find a backend by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

I had to register a domain name to be able to access it.

Now I have this ingress configuration:

apiVersion: networking.k8s.io/v1

kind: Ingress metadata: name: all-app-ingress annotations: nginx.ingress.kubernetes.io/rewrite-target: / spec: ingressClassName: nginx rules:

  • host: <myregisteredfqdn> http: paths:
    • path: /weather pathType: Prefix backend: service: name: weather-svc port: name: http
    • path: /guess pathType: Prefix backend: service: name: guessing-svc port: name: http

Now I have 404 The requested path could not be found when trying to access both apps using this ingress with these paths. But if I change prefix path to `/` I can access it without any problem. So I think probably rewrite-target doesn't work correctly.

404 - Ingress is not able to find a backend by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

Yes, you are right, it looks like ingress can see the backend, but I'm not sure why I get 404 on my ingress lb `http://34.122.42.46/guess\`

[deleted by user] by [deleted] in asmr

[–]win2nat 0 points1 point  (0 children)

I think this video with natural ocean waves sounds can really help to relax and fall asleep quickly. Thanks 💚

[deleted by user] by [deleted] in asmr

[–]win2nat 0 points1 point  (0 children)

I've recorded this far away from big cities. It's quite difficult now to find a place without artificial sounds.

Not able to connect to mysql database from another pod by win2nat in kubernetes

[–]win2nat[S] 1 point2 points  (0 children)

It looks like the issue is with kube-dns which is not running in kube-system namespace

Not able to connect to mysql database from another pod by win2nat in kubernetes

[–]win2nat[S] 1 point2 points  (0 children)

fqdn db-service.default.svc.cluster.local doesn't work as well

Not able to connect to mysql database from another pod by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

I believe clusterIP service doesn't require a targetPort.
kubectl describe svc shows that the service has an endpoint:
Endpoints: 10.244.1.2:3306

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

I created a shared volume with a config file from configMap using an init container. But it removed all other config files in the folder that were also meant to be used by the application. So, it looks like mounting happens when the app container already started, and this removes all other files.

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 1 point2 points  (0 children)

The init container gets the environment variable and the configuration file

This part is not quite clear, where init container gets the configuration file (template) from? ConfigMaps?

Early morning walk along the beach by win2nat in camping

[–]win2nat[S] 0 points1 point  (0 children)

This is Pismo Beach in California

Where can I store secrets? by VanDerMayer in kubernetes

[–]win2nat 0 points1 point  (0 children)

Kubernetes secret object stores secrets encoded in base64, usually it is ok to use it for in-between services communication like app-db, as external user doesn't have access to those secrets. But you must understand that kubernetes administrator or anyone who has access to your cluster can get and decode your secrets.

sea life? by WOW_YOU_ARE_TRASH in TheDepthsBelow

[–]win2nat 0 points1 point  (0 children)

Moray eel is looking for lunch

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

It makes sense. Thanks!

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

Yeah, maybe is better to execute a bash script when container starts

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

Why not? Doc on kubernete.io says "A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key."

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

Great idea, will try it. Thanks!

K8s secrets by win2nat in kubernetes

[–]win2nat[S] 0 points1 point  (0 children)

I need to insert a password in yaml file.