Skip to content

Custom ingress annotation #1067

@Baboulinet-33

Description

@Baboulinet-33

Hello,

I want to add this annotation on ingress generated by services in onyxia:

k8s.apisix.apache.org/enable-websocket: true

I've tried the solution in this issue: #1028 and ended with the following values.yaml:

onyxia:
  ingress:
    enabled: true
    ingressClassName: "nginx"
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt
      k8s.apisix.apache.org/enable-websocket: "true"
    hosts:
      - host: onyxia.test.com
    tls:
      - secretName: onyxia-test-com
        hosts:
          - onyxia.test.com
  api:
    regions:
      [
        {
          id: "default",
          name: "default",
          location: { lat: 48.864716, longitude: 2.349014, name: "Paris" },
          description: "Default",
          services:
            {
              namespaceAnnotationsDynamic":
                { enabled: true, userAttributes: ["email"] },
              quotas:
                {
                  userEnabled: true,
                  groupEnabled: false,
                  allowUserModification: false,
                  user:
                    {
                      "count/pods": 100,
                      "requests.memory": "32Gi",
                      "requests.cpu": "16000m",
                      "limits.memory": "32Gi",
                      "limits.cpu": "16000m",
                      "requests.storage": "500Gi",
                    },
                },
              type: "KUBERNETES",
              singleNamespace: false,
              authenticationMode: "serviceAccount",
              expose:
                {
                  domain: "onyxia.test.com",
                  route: false,
                  ingress: true,
                },
            },
        },
      ]
    catalogs:
      [
        {
          "id": "ide",
          "name": "Environnement de développement (conteneurs)",
          "description": "Services de développement interactifs en conteneurs",
          "maintainer": "aaa@aaa.fr",
          "location": "https://inseefrlab.github.io/helm-charts-interactive-services",
          "status": "PROD",
          "type": "helm",
          "skipTlsVerify": false,
        },
      ]
    schemas:
      enabled: true
      files:
        - relativePath: ide/ingress.json
          content: |
            {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "title": "Configuration for ingress",
              "type": "object",
              "properties": {
                "annotations": {
                  "type": "object",
                  "default": {
                    "k8s.apisix.apache.org/enable-websocket": true
                  }
                }
              }
            }

But the schemas override completely the ingress generated by the service.

ingress:
  annotations:
    k8s.apisix.apache.org/enable-websocket: true

instead of:

ingress:
  certManagerClusterIssuer: ""
  enabled: true
  hostname: user-aaaaaaa-0.onyxia.test.com
  ingressClassName: ""
  useCertManager: false
  userHostname: user-aaaaaaa-user.onyxia.test.com

How can I add the apisix annotation ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions