Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
Same IP list for multiple ingresses as a whitelist-source-range config

I have multiple ingresses that I want to attach the same IP list as a whitelist-source. I can't use this list in the ConfigMap for the ingress-controller as it serves other ingresses as well. What would be a way to do this?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Updated answer for the updated question:

Yes, you can apply it to a single 'Ingress' by using the nginx.ingress.kubernetes.io/whitelist-source-range annotation. For example:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-myservice
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/whitelist-source-range: "CIDR1,CIDR2,CIDR3"
spec:
  rules:
...

Original answer for the original question:

Yes, you can. Essentially, the 'Ingresses' will use the same ingress controller as long as they have the ingress controller annotation. For example, for an Nginx ingress controller, an Ingress would look something like this:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-myservice
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  rules:
...

Then on the ConfigMap you can add something like this:

data:
  ...
  whitelist-source-range: "CIDR1,CIDR2,CIDR3"
  ...
over 4 years ago · Santiago Trujillo Relatório

0

    whitelist-source-range: >- 
      "{{- $.Values.ingress.CIDR1 }},
       {{- $.Values.ingress.CIDR1 }},
       {{- $.Values.ingress.CIDR3 }}"

with values.yaml

ingress:
  enabled: true
  annotations: {}
  hosts:
    - host: chart-example.local
      paths: []
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

  CIDR1: A.B.C.D/32,A.B.C.D/32
  CIDR2: A.B.C.D/32,A.B.C.D/32
  CIDR3: A.B.C.D/32,A.B.C.D/32

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda