diff --git a/charts/athens-proxy/Chart.yaml b/charts/athens-proxy/Chart.yaml index 7df2e024d..936007d43 100644 --- a/charts/athens-proxy/Chart.yaml +++ b/charts/athens-proxy/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: athens-proxy -version: 0.5.0 +version: 0.5.1 appVersion: 0.11.0 description: The proxy server for Go modules icon: https://raw.githubusercontent.com/gomods/athens/main/docs/static/banner.png diff --git a/charts/athens-proxy/README.md b/charts/athens-proxy/README.md index 032df14ac..1c9ddc2a8 100644 --- a/charts/athens-proxy/README.md +++ b/charts/athens-proxy/README.md @@ -48,6 +48,33 @@ Available options: - [.netrc file support](https://docs.gomods.io/install/install-on-kubernetes/#netrc-file-support) - [gitconfig support](https://docs.gomods.io/install/install-on-kubernetes/#gitconfig-support) +### [AWS Load Balancer Controller](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/) ssl redirect using annotation +Using `.Values.ingress.extraPaths` you can define extra paths to the each hosts. So now we can define +extraPaths to `use-annotation` like it mentioned [here](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/tasks/ssl_redirect/) + +The example below shows how to setup ssl-redirect for AWS LoadBalancer Controller. + +```yaml +ingress: + enabled: true + annotations: + alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}' + # legalone.io wildcard + alb.ingress.kubernetes.io/certificate-arn: ACM ARN + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/tags: Service=athens-proxy,Environment=k-production + alb.ingress.kubernetes.io/target-type: instance + kubernetes.io/ingress.class: alb + # Provide an array of values for the ingress host mapping + hosts: + - athens-proxy.host + extraPaths: + # This will be added to each hosts + - service: ssl-redirect + port: use-annotation + path: /* +``` ### Pass extra configuration environment variables You can pass any extra environment variables supported in [config.dev.toml](../../../config.dev.toml). diff --git a/charts/athens-proxy/templates/ingress.yaml b/charts/athens-proxy/templates/ingress.yaml index 07ddc9d2e..9b3f88527 100644 --- a/charts/athens-proxy/templates/ingress.yaml +++ b/charts/athens-proxy/templates/ingress.yaml @@ -1,6 +1,8 @@ {{- if .Values.ingress.enabled -}} {{- $serviceName := include "fullname" . -}} {{- $servicePort := .Values.service.servicePort -}} +{{- $ingressExtraPaths := .Values.ingress.extraPaths -}} +{{- $customPath := .Values.ingress.customPath -}} {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} @@ -24,7 +26,13 @@ spec: - host: {{ $host }} http: paths: - - path: / + {{- range $ingressExtraPaths }} + - path: {{ default "/" .path | quote }} + backend: + serviceName: {{ default $serviceName .service }} + servicePort: {{ default $servicePort .port }} + {{- end }} + - path: {{ default "/" $customPath | quote }} backend: serviceName: {{ $serviceName }} servicePort: {{ $servicePort }} diff --git a/charts/athens-proxy/values.yaml b/charts/athens-proxy/values.yaml index e4c20962e..421e82500 100644 --- a/charts/athens-proxy/values.yaml +++ b/charts/athens-proxy/values.yaml @@ -1,3 +1,4 @@ +--- replicaCount: 1 image: registry: docker.io @@ -38,11 +39,18 @@ service: ingress: enabled: false # Provide key/value annotations - annotations: + annotations: {} # Provide an array of values for the ingress host mapping - hosts: + hosts: [] # Provide a base64 encoded cert for TLS use - tls: + tls: "" + # To customize default path + # This is useful for ALB users. + customPath: "" + extraPaths: [] +# - service: ssl-redirect +# port: use-annotation +# path: /* storage: type: disk