Я пытаюсь заставить мою службу K8S GKE работать с портом 80, используя эту конфигурацию:
apiVersion: v1
kind: Service
metadata:
name: external-{{ .Release.Name }}
labels:
{{- include "release_labels" . | indent 4 }}
spec:
type: LoadBalancer
loadBalancerIP: 34.90.xx.xx
ports:
- name: proxy
port: 80
targetPort: 8080
protocol: TCP
selector:
{{- include "release_labels" . | indent 4 }}
Это прокси-служба HTTP.
Приведенная выше конфигурация работает с curl --proxy 34.90.xx.xx:80 gajus.com
, но он не работает, если порт не указан, т.е. curl --proxy 34.90.xx.xx gajus.com
.
Чего не хватает сделать curl --proxy 34.90.xx.xx gajus.com
работай?
Ответ можно найти на странице руководства curl:
-x, --proxy [protocol://]host[:port]
Use the specified proxy.
[...]
If the port number is not specified in the proxy string, it
is assumed to be 1080.
Разве вы не хотели попробовать что-то вроде:
curl --header 'Host: fqdn.example.com' http;//1.2.3.4