我正在尝试在EKS上设置AWS ALB入口。但Argo UI无法工作。但是端口转发运行良好。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
alb.ingress.kubernetes.io/healthcheck-path: /
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/scheme: internal
kubernetes.io/ingress.class: alb
name: admin-ns-endpoints
namespace: admin
spec:
rules:
- host: argo-nonprod.sample.com
http:
paths:
- backend:
serviceName: argo-server
servicePort: 2746
path: /*
status:
loadBalancer:
ingress:
- hostname: xxxxxxx.ap-south-1.elb.amazonaws.com
访问端点时获取404。
apiVersion: apps/v1
kind: Deployment
metadata:
name: argo-server
namespace: admin
spec:
replicas: 1
template:
spec:
containers:
- args:
- server
- --configmap=argo-workflow-controller-configmap
env:
- name: BASE_HREF
value: /
- name: IN_CLUSTER
value: "true"
- name: ARGO_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: argoproj/argocli:v2.9.3
imagePullPolicy: Always
name: argo-server
ports:
- containerPort: 2746
name: web
protocol: TCP
我使用舵图来部署图表。
我尝试更改ingress文件中的不同值,但没有成功。
你能试着删除spec.rules.http.host吗?除此之外,这对我们有效:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-alb-ingress
namespace: argo
annotations:
kubernetes.io/ingress.class: aws-alb
alb.ingress.kubernetes.io/load-balancer-attributes: access_logs.s3.enabled=false
alb.ingress.kubernetes.io/backend-protocol: HTTPS
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]'
alb.ingress.kubernetes.io/subnets: REDACTED
alb.ingress.kubernetes.io/security-groups: REDACTED
alb.ingress.kubernetes.io/healthcheck-protocol: HTTPS
alb.ingress.kubernetes.io/healthcheck-path: /
external-dns.alpha.kubernetes.io/hostname: REDACTED
labels:
app: nginx-service
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: argo-server
servicePort: 2746
您可以尝试
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
我的完整配置是:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ${name_http_ingress}
namespace: ${namespace}
labels:
app.kubernetes.io/component: server
app.kubernetes.io/instance: argo-cd
app.kubernetes.io/part-of: argocd
app.kubernetes.io/name: argocd-server
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
alb.ingress.kubernetes.io/healthcheck-path: /
# alb.ingress.kubernetes.io/success-codes: 200,301,302,307
alb.ingress.kubernetes.io/conditions.argogrpc: >-
[{"field":"http-header","httpHeaderConfig":{"httpHeaderName": "Content-Type", "values":["^application/grpc.*$"]}}]
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
alb.ingress.kubernetes.io/actions.ssl-redirect: >-
{"type":"redirect","redirectConfig":{"port":"443","protocol":"HTTPS","statusCode":"HTTP_301"}}
# external-dns.alpha.kubernetes.io/hostname: ${domain_name_public}
alb.ingress.kubernetes.io/certificate-arn: ${domain_certificate}
# alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-2-Ext-2018-06
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/load-balancer-name: ${name_http_ingress}
alb.ingress.kubernetes.io/target-type: instance
# alb.ingress.kubernetes.io/target-type: ip # require to enable sticky sessions ,stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60
alb.ingress.kubernetes.io/target-group-attributes: load_balancing.algorithm.type=least_outstanding_requests
alb.ingress.kubernetes.io/target-node-labels: ${tolerations_key}=${tolerations_value}
alb.ingress.kubernetes.io/tags: Environment=${tags_env},Restricted=false,Customer=customer,Project=ops,Name=${name_http_ingress}
alb.ingress.kubernetes.io/load-balancer-attributes: routing.http2.enabled=true,idle_timeout.timeout_seconds=180
spec:
ingressClassName: alb
tls:
- hosts:
- ${domain_name_public}
rules:
- host: ${domain_name_public}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ssl-redirect
port:
name: use-annotation
- host: ${domain_name_public}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
# name: argo-cd-argocd-server
name: argogrpc
port:
number: 4433
- path: /
pathType: Prefix
backend:
service:
name: rnd-server-argo
port:
number: 2746
- path: /argo
pathType: Prefix
backend:
service:
name: argo-workwlow-server-argo
port:
number: 2746
要实现这一点,您需要执行以下步骤
步骤1:在下面配置argogrpc服务
https://raw.githubusercontent.com/naguait85/argocd_helm-1/master/argocd-install/argogrpc.yaml
步骤2:使用argocd中的以下ingress配置ingress。从aws公共证书更改主机名和证书arn
https://raw.githubusercontent.com/naguait85/argocd_helm-1/master/argocd-install/ingress.yaml