英文:
Localstack not accessible on localhost:4566 using Helm chart
问题
我无法在浏览器上访问http://localhost:4566/health,尽管检查日志后,svc和pods正在运行且健康。我尝试使用服务名称进行端口转发,仍然出现相同的错误
无法访问此网站
curl http://localhost:4566/health
curl: (7) 无法在5毫秒后连接到localhost的4566端口:无法连接到服务器
以下是粘贴的helm chart localstack.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Release.Name }}
spec:
replicas: {{ .Values.localstack.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: localstack
image: "{{ .Values.localstack.image.repository }}:{{ .Values.localstack.image.tag }}"
ports:
- containerPort: 4566
protocol: TCP
env:
- name: AWS_ACCESS_KEY_ID
value: {{ .Values.localstack.aws_access_key_id }}
- name: AWS_SECRET_ACCESS_KEY
value: {{ .Values.localstack.aws_secret_access_key }}
- name: AWS_DEFAULT_REGION
value: {{ .Values.localstack.aws_default_region }}
- name: AWS_ENDPOINT_URL
value: {{ .Values.localstack.endpoint_url }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-localstack-service
spec:
selector:
app: {{ .Release.Name }}-localstack
ports:
- protocol: TCP
port: {{ .Values.localstack.service.port }}
targetPort: 4566
values.yaml如下:
localstack:
fullnameOverride: localstack
chart: localstack-chart
nameOverride: localstack
version: 1.0.0
image:
repository: localstack/localstack
tag: latest
aws_access_key_id: test
aws_secret_access_key: test
aws_default_region: eu-west-2
service:
type: NodePort
port: 4566
endpoint_url: http://localstack:4566
我希望能够在本地浏览器上访问localstack的端点。
英文:
I could not access the http://localhost:4566/health on the browser even though the svc, pods are running and healthy after checking the logs. I tried to use port-forwarding with the service name and still same error
This site can’t be reached
curl http://localhost:4566/health
curl: (7) Failed to connect to localhost port 4566 after 5 ms: Couldn't connect to server
The helm chart is pasted below localstack.yaml
`apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Release.Name }}
spec:
replicas: {{ .Values.localstack.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: localstack
image: "{{ .Values.localstack.image.repository }}:{{ .Values.localstack.image.tag }}"
ports:
- containerPort: 4566
protocol: TCP
env:
- name: AWS_ACCESS_KEY_ID
value: {{ .Values.localstack.aws_access_key_id }}
- name: AWS_SECRET_ACCESS_KEY
value: {{ .Values.localstack.aws_secret_access_key }}
- name: AWS_DEFAULT_REGION
value: {{ .Values.localstack.aws_default_region }}
- name: AWS_ENDPOINT_URL
value: {{ .Values.localstack.endpoint_url }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-localstack-service
spec:
selector:
app: {{ .Release.Name }}-localstack
ports:
- protocol: TCP
port: {{ .Values.localstack.service.port }}
targetPort: 4566`
The values.yaml is
`
localstack:
fullnameOverride: localstack
chart: localstack-chart
nameOverride: localstack
version: 1.0.0
image:
repository: localstack/localstack
tag: latest
aws_access_key_id: test
aws_secret_access_key: test
aws_default_region: eu-west-2
service:
type: NodePort
port: 4566
endpoint_url: http://localstack:4566`
I would want to be able top locally access the endpoint of the localstack on the browser.
答案1
得分: 0
我应该进行端口转发,以使其可访问,现在我可以执行 kubectl port-forward
英文:
I should have done port-forward to make it accessible now I was able to do kubectl port-forward <pod name> 4566:4566
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论