我在集群上运行了一些服务,并且 ALB 工作正常。但是我有一个 CloudFront 发行版,由于一些内部因素,我想使用集群作为入口点。因此,我正在尝试添加一个入口,以根据默认规则或命名主机将请求重定向到 CloudFront 分配,两者都可以工作。
我尝试了两种不同的方法,但没有骰子:
创建外部名称和入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: "internet-facing"
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]'
alb.ingress.kubernetes.io/certificate-arn: <my-cert-arn>
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": {
"Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/group.name: <my-group-name>
spec:
rules:
- host: test.my-host.net
HTTP:
paths:
- backend:
serviceName: test
servicePort: use-annotation
path: /
---
apiVersion: v1
kind: Service
metadata:
name: test
spec:
type: ExternalName
externalName: test.my-host.net
Run Code Online (Sandbox Code Playgroud)
我还尝试使用 ALB Ingress v2 上的注释重定向创建入口,就像文档一样:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: …Run Code Online (Sandbox Code Playgroud) 有人可以帮忙吗?我试图在配置映射上注入舵值,但它破坏了格式。如果我直接使用该值而不是 .Values,它可以正常工作。
我拥有的:
data:
application.instanceLabelKey: argocd.argoproj.io/instance
oidc.config: |
name: Okta
issuer: https://mycompany.okta.com
clientID: {{ .Values.okta.clientID }}
clientSecret: {{ .Values.okta.clientSecret }}
requestedScopes: ["openid", "profile", "email", "groups"]
requestedIDTokenClaims: {"groups": {"essential": true}}
Run Code Online (Sandbox Code Playgroud)
结果
data:
application.instanceLabelKey: argocd.argoproj.io/instance
oidc.config: "name: Okta\nissuer: https://mycompany.okta.com\nclientID: myClientId \nclientSecret:
mySecret\nrequestedScopes: [\"openid\", \"profile\",
\"email\", \"groups\"]\nrequestedIDTokenClaims: {\"groups\": {\"essential\": true}}\n"
Run Code Online (Sandbox Code Playgroud) 我们为不同的领域创建了一些 terraform 堆栈,例如用于 vpc 的网络堆栈、用于 rds 内容的 rds 堆栈等。
\n例如,rds 堆栈依赖于网络堆栈从输出中获取值:
\n网络堆栈的输出:
\noutput "public_subnets" {\n value = aws_subnet.public.*.id\n}\n\noutput "private_subnets" {\n value = aws_subnet.private.*.id\n}\n\noutput "data_subnets" {\n value = aws_subnet.data.*.id\n}\n\n... an so on\nRun Code Online (Sandbox Code Playgroud)\nrds 堆栈将点击输出
\ndata "tfe_outputs" "networking" {\n organization = "my-tf-cloud-org"\n workspace = "network-production-eucentral1"\n}\nRun Code Online (Sandbox Code Playgroud)\n但是当我尝试使用输出时:
\n\xe2\x94\x82\n\xe2\x94\x82 on main.tf line 20, in module "db":\n\xe2\x94\x82 20: base_domain = data.tfe_outputs.dns.values.fqdn\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\n\xe2\x94\x82 \xe2\x94\x82 data.tfe_outputs.dns.values has a sensitive value\n\xe2\x94\x82\n\xe2\x94\x82 This object does not have an attribute named "fqdn".\n\xe2\x95\xb5\n\xe2\x95\xb7\n\xe2\x94\x82 Error: …Run Code Online (Sandbox Code Playgroud)