kubernetes - Nexus Helm Chart 的配置:HTTPS Serving HTTP Resources
问题描述
我运行了以下命令:
kubectl create secret tls nexus-tls --cert cert.crt --key privateKey.pem
其中cert.crt
包含我的证书并privateKey.pem
包含我的私钥(使用 CloudFlare 提供)。
stable/sonatype-nexus
然后我使用以下配置安装了Helm 图表:
nexusProxy:
env:
nexusDockerHost: containers.<<NEXUS_HOST>>
nexusHttpHost: nexus.<<NEXUS_HOST>>
nexusBackup:
enabled: true
nexusAdminPassword: <<PASSWORD>>
env:
targetBucket: gs://<<BACKUP_BUCKET_NAME>>
persistence:
storageClass: standard
ingress:
enabled: true
path: /*
annotations:
kubernetes.io/ingress.allow-http: true
kubernetes.io/tls-acme: true
kubernetes.io/ingress.class: gce
kubernetes.io/ingress.global-static-ip-name: <<STATIC_IP_ADDRESS_NAME>>
tls:
enabled: true
secretName: nexus-tls
persistence:
storageClass: standard
storageSize: 1024Gi
resources:
requests:
cpu: 250m
memory: 4800Mi
通过运行命令:
helm install -f values.yaml stable/sonatype-nexus
此处记录了此图表的可能配置值。
当我访问 时http://nexus.<<NEXUS_HOST>>
,我可以访问 Nexus 存储库。但是,当我访问 时https://nexus.<<NEXUS_HOST>>
,我会收到混合内容警告,因为正在提供 HTTP 资源。
如果我将nexusProxy.env.enforceHttps
环境变量设置为 true,当我访问时https://nexus.<<NEXUS_HOST>>
,我会得到如下响应:
HTTP access is disabled. Click here to browse Nexus securely: https://nexus.<<NEXUS_HOST>>.
如何确保安全地提供 Nexus?我是否犯了配置错误,还是问题出在其他地方?
解决方案
如果您的 ELB 服务于纯 http 流量,请将其添加到您的 LoadBalancer 服务注释中。
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
推荐阅读
- python - 从文本文件中获取一行的前 n 个字符?
- django - Django CBV:get_queryset() 和 get_context_data()?
- sql - Presto查询:在地图中查找具有最大值的键
- capacitor - Capacitor: Uncaught (in promise) PushNotifications 没有网络实现
- python - Groupby 用于集群生成
- gcc - CMAKE:如何防止 CMAKE 构建项目不依赖的库?
- algorithm - Foobar 将枪带入警卫战斗优化
- java - 如何使用 NotificationListenerService android 获取 Whatsapp 联系号码?
- nginx - 301 将 www 重定向到非 www 站点的最佳实践
- python - NLTK norpus 无法读取文本文件