Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy https://host to https://pod and http://host to http://pod #7967

Closed
batleforc opened this issue Nov 24, 2021 · 9 comments
Closed

Proxy https://host to https://pod and http://host to http://pod #7967

batleforc opened this issue Nov 24, 2021 · 9 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@batleforc
Copy link

batleforc commented Nov 24, 2021

What do you want to happen?

Hello, I'm in a case where I need to redirect all flux from my ingress domain and subdomain to a pod ( *. and ).

If the incoming data come from 443 (https) I want it to go to 443 of my pod and the same for 80

Is there currently another issue associated with this?

Not at the moment, just my use case

Does it require a particular kubernetes version?

Not actually

@batleforc batleforc added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 24, 2021
@k8s-ci-robot
Copy link
Contributor

@batleforc: This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Nov 24, 2021
@kundan2707
Copy link
Contributor

@batleforc can you share detail steps for your use cases ?

@batleforc
Copy link
Author

Hello, Yep, no problem.

I actually have one main cluster (Single node microk8s) named weebo for my personal purpose who has direct access to the web with a public ip.
In add to that I have a second cluster named kluster (k3s cluster with 3 node), this one doesn't have a direct acces to the web (no public ip).
I want with the help of weebo to expose kluster to the web (everything that go throught my subdomain has to be redirected to kluster).
With lots of magic and OpenVpn it actually work (It cost me my soul billie).

In order to have some service working correctly (thanks Keycloack) I need to properly redirect http to my service and https to it but on a different port

@longwuyuan
Copy link
Contributor

@theunrealgeek fyi

@theunrealgeek
Copy link
Contributor

Would something like this work ?

# Create ExternalName services to talk to something outside the cluster
kind: Service
apiVersion: v1
metadata:
  name: to-kluster-http
spec:
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
  type: ExternalName
  externalName: <dns-for-kluster>
---
kind: Service
apiVersion: v1
metadata:
  name: to-kluster-https
spec:
  ports:
  - protocol: TCP
    port: 443
    targetPort: 443
  type: ExternalName
  externalName: <dns-for-kluster>
---
# Ingress objects to proxy to the ExternalName service
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: https-kluster
  namespace: namespace-name 
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  tls:
  - hosts:
    - example.com
    secretName: tls-secret 
  rules:
  - http:
      paths:
      - backend:
          serviceName: to-kluster-https
          servicePort: 443
        path: /
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: http-kluster
  namespace: namespace-name 
spec: 
  rules:
  - http:
      paths:
      - backend:
          serviceName: to-kluster-http
          servicePort: 80
        path: /

I haven’t actually tried this, but I’m just piecing together different things that might fit your use case.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 11, 2022
@longwuyuan
Copy link
Contributor

No activity so assume solved hence closing
/close

@k8s-ci-robot
Copy link
Contributor

@longwuyuan: Closing this issue.

In response to this:

No activity so assume solved hence closing
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@batleforc
Copy link
Author

Yo, no it didn't work, but the main project was put on hiatus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

6 participants