Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Context menu to expose a `Deployment` as a `Route` or `Ingress`.

Aperta
#3,072 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #3080 di @datho7561 — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
kubernetes, typescript, vscode
Ambito
cloud, devtools

Direzione di ricerca

Non vengono indicati file o test. Inizia individuando le azioni esistenti del menu contestuale di Deployment e il modo in cui vengono gestite le risorse Kubernetes aggiuntive di devfile. Definisci se la funzionalità crea una Route, un Ingress o entrambi, quindi tratta la gestione del ciclo di vita, la conferma dell’esposizione pubblica e il comportamento dell’ingress-controller descritto nell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/enhancement

It would be nice to expose a running service to the internet using a Route (in the case of OpenShift) or Ingress (in the case of other Kubernetes distributions).

Here's how to create a Route in OpenShift, given that $NAME_OF_DEPLOYMENT is a deployment that's in the current name:

oc expose deployment $NAME_OF_DEPLOYMENT

Here's an example of an Ingress yaml in Kubernetes:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: wildwest-backend-ingress
spec:
  defaultBackend:
    service:
      name: wildwest-backend-app
      port:
        number: 8080

The values we will have to change depending on the deployment are:

  • metadata.name to the name of the deployment but with the suffix -ingress to help distinguish it
  • spec.defaultBackend.service.name to the name of the deployment
  • spec.defaultBackend.service.port.number to the port that the deployment exposes its service on

In order to create the ingress, you will need to run oc apply -f ingress-definition.yaml.

A few final thoughts:

  1. It might also be possible to include the route or ingress in the devfile by embedding the YAML using the additional Kubernetes resources feature. For instance, this is how odo creates ServiceBindings:
// ...
components:
- kubernetes:
    inlined: |
      apiVersion: binding.operators.coreos.com/v1alpha1
      kind: ServiceBinding
      metadata:
        creationTimestamp: null
        name: my-binding
      spec:
        application:
          group: apps
          kind: Deployment
          name: using-go-app
          version: v1
        bindAsFiles: true
        detectBindingResources: true
        services:
        - group: postgres-operator.crunchydata.com
          id: my-binding
          kind: PostgresCluster
          name: example-postgres
          namespace: default
          resource: postgresclusters
          version: v1beta1
      status:
        secret: ""
  name: my-binding
// ...

The benefit of this approach is that, if I understand correctly, odo will manage the lifecycle of this Kubernetes object by creating it when dev is started and deleting it when dev is stopped

  1. A final aspect of this change is that we should alert the user that this will expose the service to the public if the cluster is capable of exposing services to the public, and require an additional confirmation in order to do this. We shouldn't try to detect if the cluster is capable of exposing public endpoints, since that is really difficult. Instead we should always show this warning.

  2. Not all Kubernetes clusters are capable of creating an ingress. They require an ingress controller. On minikube the ingress controller that is automatically set up is the nginx one. Maybe we should hide the UI option if the cluster is not OpenShift and doesn't have an ingress controller set up?

Lingua principale
TypeScript
Stelle
124
Fork
63
Merge medio
2h 59m
PR unite (30g)
86

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di redhat-developer/vscode-openshift-tools

Tutte le issue di redhat-developer/vscode-openshift-tools

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.