Where are these ENVVARS coming from???
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- docker, kubernetes
- Área
- infrastructure
Línea de trabajo
Empieza con los manifiestos de Kubernetes Deployment y Service y el comportamiento del contenedor descrito en el issue. Investiga cómo Kubernetes expone variables de entorno relacionadas con Service a los pods y, después, comprueba si el repositorio documenta o controla este comportamiento. Se considera terminado cuando se explica la fuente y se identifica cualquier cambio necesario en la documentación o el código.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I've got a simple blue/green Kubernetes deployment using this container as described below:
apiVersion: apps/v1
kind: Deployment
metadata:
name: green-app
spec:
replicas: 1
selector:
matchLabels:
app: green-app
template:
metadata:
labels:
app: green-app
spec:
containers:
- name: http-https-echo
image: mendhak/http-https-echo
ports:
- containerPort: 8080
env:
- name: ECHO_INCLUDE_ENV_VARS
value: "1"
- name: APP_COLOR
value: "GREEN"
---
apiVersion: v1
kind: Service
metadata:
name: green-app
spec:
selector:
app: green-app
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: blue-app
spec:
replicas: 1
selector:
matchLabels:
app: blue-app
template:
metadata:
labels:
app: blue-app
spec:
containers:
- name: http-https-echo
image: mendhak/http-https-echo
ports:
- containerPort: 8080
env:
- name: ECHO_INCLUDE_ENV_VARS
value: "1"
- name: APP_COLOR
value: "BLUE"
---
apiVersion: v1
kind: Service
metadata:
name: blue-app
spec:
selector:
app: blue-app
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: color-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
# tls:
# - hosts:
# - '*.com'
rules:
- http:
paths:
- path: /green
pathType: Prefix
backend:
service:
name: green-app
port:
number: 80
- path: /blue
pathType: Prefix
backend:
service:
name: blue-app
port:
number: 80
Everything spins up and the /blue and /green endpoints work as they should.
But inside the blue are all of these environment variables referencing the green app (and vice versa)
/app $ env
KUBERNETES_PORT=tcp://172.20.0.1:443
GREEN_APP_PORT_80_TCP=tcp://172.20.144.83:80
KUBERNETES_SERVICE_PORT=443
NODE_VERSION=22.21.0
HOSTNAME=blue-app-64bd4f854f-x9v4j
YARN_VERSION=1.22.22
BLUE_APP_PORT_80_TCP=tcp://172.20.108.198:80
SHLVL=1
HOME=/home/node
ECHO_INCLUDE_ENV_VARS=1
GREEN_APP_SERVICE_HOST=172.20.144.83
BLUE_APP_SERVICE_HOST=172.20.108.198
TERM=xterm
KUBERNETES_PORT_443_TCP_ADDR=172.20.0.1
HTTP_PORT=8080
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GREEN_APP_PORT=tcp://172.20.144.83:80
KUBERNETES_PORT_443_TCP_PORT=443
GREEN_APP_SERVICE_PORT=80
KUBERNETES_PORT_443_TCP_PROTO=tcp
HTTPS_PORT=8443
BLUE_APP_PORT=tcp://172.20.108.198:80
BLUE_APP_SERVICE_PORT=80
APP_COLOR=BLUE
GREEN_APP_PORT_80_TCP_ADDR=172.20.144.83
KUBERNETES_SERVICE_PORT_HTTPS=443
GREEN_APP_PORT_80_TCP_PORT=80
KUBERNETES_PORT_443_TCP=tcp://172.20.0.1:443
BLUE_APP_PORT_80_TCP_ADDR=172.20.108.198
GREEN_APP_PORT_80_TCP_PROTO=tcp
KUBERNETES_SERVICE_HOST=172.20.0.1
PWD=/app
BLUE_APP_PORT_80_TCP_PORT=80
BLUE_APP_PORT_80_TCP_PROTO=tcp
/app $
How can a simple pod that only has 2 environment variables defined (APP_COLOR and ECHO_INCLUDE_ENV_VARS) pickup all of these other variables? Where are they coming from!??!
- Lenguaje dominante
- Shell
- Estrellas
- 792
- Forks
- 152
- Merge medio
- 3 d 18 h
- PR fusionados (30 d)
- 3
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mendhak/docker-http-https-echo
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
mendhak/docker-http-https-echo#80 · 2 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
mendhak/docker-http-https-echo#60 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
mendhak/docker-http-https-echo#59 · 1 comentario ·
Todos los issues de mendhak/docker-http-https-echo
Issues similares
-
out-of-date
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
CachyOS/CachyOS-PKGBUILDS#1894 ·
-
[InvoiceShelf] No database info Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
community-scripts/ProxmoxVE#17396 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mattpocock/skills#1099 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
No-op if nothing loads zsh/zle Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100