Skip to content

Expose annotations for service #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2025
Merged

Conversation

lookcrabs
Copy link
Contributor

@lookcrabs lookcrabs commented Apr 30, 2025

Description

This just adds a section to expose annotations for the cortex-tenant service. This will allow people, like me :P, to use aws-lb-controller to automatically expose it to a VPC via a nlb/alb/etc as well as use externaldns to define an route53 entry etc.

example:

  • annotations.yaml
service:
  annotations:
    external-dns.alpha.kubernetes.io/hostname: cortex-tenant.internaldns.io
    service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: Name=cortex-tenant, Service=mimir, Environment=staging, Role=reverse-proxy
    service.beta.kubernetes.io/aws-load-balancer-name: mimir-ctxproxy  # Name the NLB
  • without annotations.yaml:
$ helm template cortex-proxy . -f values.yaml | yq 'select(.kind == "Service")'
# Source: cortex-tenant/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    helm.sh/chart: cortex-tenant-0.8.0
    app.kubernetes.io/name: cortex-tenant
    app.kubernetes.io/instance: cortex-proxy
    app.kubernetes.io/version: "1.13.0"
    app.kubernetes.io/managed-by: Helm
  name: cortex-proxy-cortex-tenant
  annotations: {}
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 8080
      targetPort: 8080
      protocol: TCP
  selector:
    app.kubernetes.io/name: cortex-tenant
    app.kubernetes.io/instance: cortex-proxy
  • with annotations.yaml:
$ helm template cortex-proxy . -f values.yaml -f annotations.yaml| yq 'select(.kind == "Service")'
# Source: cortex-tenant/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    helm.sh/chart: cortex-tenant-0.8.0
    app.kubernetes.io/name: cortex-tenant
    app.kubernetes.io/instance: cortex-proxy
    app.kubernetes.io/version: "1.13.0"
    app.kubernetes.io/managed-by: Helm
  name: cortex-proxy-cortex-tenant
  annotations:
    external-dns.alpha.kubernetes.io/hostname: cortex-tenant.internaldns.io
    service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: Name=cortex-tenant, Service=mimir, Environment=staging, Role=reverse-proxy
    service.beta.kubernetes.io/aws-load-balancer-name: mimir-ctxproxy  # Name the NLB
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 8080
      targetPort: 8080
      protocol: TCP
  selector:
    app.kubernetes.io/name: cortex-tenant
    app.kubernetes.io/instance: cortex-proxy

@blind-oracle blind-oracle merged commit 0028550 into blind-oracle:main May 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants