3scale-ops / marin3r

Lightweight, CRD based envoy control plane for kubernetes
Apache License 2.0
58 stars 14 forks source link

New resource specification for EnvoyConfig custom resources #177

Closed roivaz closed 1 year ago

roivaz commented 1 year ago

This PR changes the way that resources are specified in the EnvoyConfig custom resource. A new field spec.resources has been added that is meant to replace spec.envoyResources. Both fields and specification formats work currently, with the controller internally transforming from spec.envoyResources to spec.resources.

The new resource specification looks like this:

apiVersion: marin3r.3scale.net/v1alpha1
kind: EnvoyConfig
metadata:
  name: test
spec:
  nodeID: test
  resources:
    - type: listener
      value:
        name: https
        address:
          socket_address:
            address: 0.0.0.0
            port_value: 8443
        filter_chains:
          - filters:
              - name: envoy.filters.network.http_connection_manager
                typed_config:
                  "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
                  access_log:
                    - name: envoy.access_loggers.file
                      typed_config:
                        "@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
                        path: /dev/stdout
                  stat_prefix: ingress_http
                  rds:
                    route_config_name: test
                    config_source:
                      ads: {}
                      resource_api_version: "V3"
                  http_filters:
                    - name: envoy.filters.http.router
                      typed_config:
                        "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
            transport_socket:
              name: envoy.transport_sockets.tls
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
                common_tls_context:
                  tls_certificate_sds_secret_configs:
                    - name: test
                      sds_config:
                        ads: {}
                        resource_api_version: "V3"
    - type: secret
      generateFromTlsSecret: test
    - type: route
      value:
        name: test
        virtual_hosts:
          - name: all
            domains: ["*"]
            routes:
              - match:
                  prefix: "/"
                route:
                  cluster: test
    - type: cluster
      value:
        name: test
        connect_timeout: 0.010s
        type: EDS
        lb_policy: ROUND_ROBIN
        eds_cluster_config:
          eds_config:
            ads: {}
            resource_api_version: "V3"
    - type: endpoint
      generateFromEndpointSlices:
        selector:
          matchLabels:
            kubernetes.io/service-name: test
        clusterName: test
        targetPort: http

Some other updates also in this PR, like upgrade of go-control-plane, controller-runtime, etc.

/kind feature /priority important-soon /assign

roivaz commented 1 year ago

/ok-to-test

roivaz commented 1 year ago

/retitle New resource specification for EnvoyConfig custom resources

slopezz commented 1 year ago

/lgtm

3scale-robot commented 1 year ago

LGTM label has been added.

Git tree hash: 408bf726077a1138368c007d71778c7fa58c3f80

roivaz commented 1 year ago

/approve

3scale-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roivaz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/3scale-ops/marin3r/blob/main/OWNERS)~~ [roivaz] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment