additionalProperties: false
description: The CRD Intercept Specification defines Telepresence intercepts.
id: intercept_crd_spec.json
properties:
  apiVersion:
    description: APIVersion defines the versioned schema of this representation of
      an object.
    enum:
    - getambassador.io/v1alpha2
    type: string
  kind:
    description: Kind is a string value representing the REST resource this object
      represents.
    enum:
    - InterceptSpecification
    type: string
  metadata:
    additionalProperties: false
    description: Standard object metadata.
    properties:
      name:
        description: The name of the CRD.
        pattern: ^[a-z0-9][a-z0-9-]{1,62}$
        type: string
      namespace:
        description: The namespace of the CRD.
        pattern: ^[a-z0-9][a-z0-9-]{1,62}$
        type: string
    required:
    - name
    type: object
  spec:
    additionalProperties: false
    description: The kubernetes specification of InterceptSpecification CRD.
    properties:
      connection:
        additionalProperties: false
        description: Connection properties to use when Telepresence connects to the
          cluster.
        properties:
          allowConflictingSubnets:
            description: List of CIDR that will be allowed to conflict with local
              subnets.
            items:
              type: string
            type: array
          alsoProxy:
            description: List of CIDR to also proxy.
            items:
              type: string
            type: array
          as:
            description: Username to impersonate for the operation.
            type: string
          asGroups:
            description: Groups to impersonate for the operation.
            items:
              type: string
            type: array
          asUID:
            description: UID to impersonate for the operation.
            type: string
          cluster:
            description: The name of the kubeconfig cluster to use
            type: string
          context:
            description: The name of the kubeconfig context to use. Defaults to the
              current context of the kubeconfig.
            type: string
          expose:
            description: Ports that a containerized daemon will expose. See docker
              run -p for more info.
            items:
              type: string
            type: array
          hostname:
            description: Hostname used by a containerized daemon.
            type: string
          managerNamespace:
            description: The namespace where the traffic manager is to be found.
            maxLength: 63
            pattern: ^[a-z0-9][a-z0-9-]*$|\{\{
            type: string
          mappedNamespaces:
            description: The namespaces that Telepresence will be concerned with
            items:
              description: RFC 1123 label name
              maxLength: 63
              pattern: ^[a-z0-9][a-z0-9-]$|\{\{
              type: string
            type: array
          name:
            description: The name to use for this connection. Defaults to <context>-<namespace>.
            maxLength: 63
            pattern: ^[a-z][a-z0-9-]*$
            type: string
          namespace:
            description: The namespace that this connection is bound to. Defaults
              to the default appointed by the context
            maxLength: 63
            pattern: ^[a-z0-9][a-z0-9-]*$|\{\{
            type: string
          neverProxy:
            description: List of CIDR to never proxy.
            items:
              type: string
            type: array
          user:
            description: The name of the kubeconfig user to use
            type: string
        type: object
      connections:
        description: Connections to use when Telepresence connects to the cluster.
        items:
          additionalProperties: false
          description: Connection properties to use when Telepresence connects to
            the cluster.
          properties:
            allowConflictingSubnets:
              description: List of CIDR that will be allowed to conflict with local
                subnets.
              items:
                type: string
              type: array
            alsoProxy:
              description: List of CIDR to also proxy.
              items:
                type: string
              type: array
            as:
              description: Username to impersonate for the operation.
              type: string
            asGroups:
              description: Groups to impersonate for the operation.
              items:
                type: string
              type: array
            asUID:
              description: UID to impersonate for the operation.
              type: string
            cluster:
              description: The name of the kubeconfig cluster to use
              type: string
            context:
              description: The name of the kubeconfig context to use. Defaults to
                the current context of the kubeconfig.
              type: string
            expose:
              description: Ports that a containerized daemon will expose. See docker
                run -p for more info.
              items:
                type: string
              type: array
            hostname:
              description: Hostname used by a containerized daemon.
              type: string
            managerNamespace:
              description: The namespace where the traffic manager is to be found.
              maxLength: 63
              pattern: ^[a-z0-9][a-z0-9-]*$|\{\{
              type: string
            mappedNamespaces:
              description: The namespaces that Telepresence will be concerned with
              items:
                description: RFC 1123 label name
                maxLength: 63
                pattern: ^[a-z0-9][a-z0-9-]*$|\{\{
                type: string
              type: array
            name:
              description: The name to use for this connection. Defaults to <context>-<namespace>.
              maxLength: 63
              pattern: ^[a-z0-9][a-z0-9-]*$
              type: string
            namespace:
              description: The namespace that this connection is bound to. Defaults
                to the default appointed by the context
              maxLength: 63
              pattern: ^[a-z0-9][a-z0-9-]*$|\{\{
              type: string
            neverProxy:
              description: List of CIDR to never proxy.
              items:
                type: string
              type: array
            user:
              description: The name of the kubeconfig user to use
              type: string
          type: object
        maxItems: 32
        minItems: 1
        type: array
      handlers:
        items:
          additionalProperties: false
          oneOf:
          - not:
              required:
              - docker
              - external
            required:
            - script
          - not:
              required:
              - script
              - external
            required:
            - docker
          - not:
              required:
              - docker
              - script
            required:
            - external
          properties:
            docker:
              additionalProperties: false
              description: docker run/build/compose [OPTIONS] IMAGE[:TAG|@DIGEST]
                [COMMAND] [ARG...]
              oneOf:
              - not:
                  required:
                  - build
                  - compose
                required:
                - image
              - not:
                  required:
                  - image
                  - compose
                required:
                - build
              - not:
                  required:
                  - image
                  - build
                required:
                - compose
              properties:
                args:
                  description: Optional command arguments, or flags to "docker compose
                    up"
                  items:
                    type: string
                  type: array
                build:
                  additionalProperties: false
                  description: Build Docker image from source
                  properties:
                    args:
                      description: Optional docker build command arguments
                      items:
                        type: string
                      type: array
                    context:
                      description: A path to a directory containing a Dockerfile,
                        or a url to a git repository
                      type: string
                  required:
                  - context
                  type: object
                command:
                  description: Optional command. Not applicable for "compose".
                  type: string
                compose:
                  additionalProperties: false
                  description: Do "docker compose up" on a Docker Compose specification
                  properties:
                    context:
                      description: A path to a Docker Compose file, or a directory
                        containing a "*-compose.yml" file
                      type: string
                    services:
                      items:
                        additionalProperties: false
                        properties:
                          behavior:
                            description: The intended usage of the service
                            enum:
                            - local
                            - remote
                            - interceptHandler
                            type: string
                          connection:
                            description: |
                              The name of the connection used by this service. Only relevant when the behavior is set to
                              remote or interceptHandler. Required when using multiple connections.
                            maxLength: 63
                            pattern: ^[a-z][a-z0-9-]*$
                            type: string
                          mapping:
                            additionalProperties: false
                            description: Mapping to a remote service. Only valid when
                              behavior is remote
                            properties:
                              name:
                                description: The name of the remote service
                                maxLength: 63
                                pattern: ^[a-z][a-z0-9-]*$|\{\{
                                type: string
                            required:
                            - name
                            type: object
                          name:
                            description: The name of an service in the Docker Compose
                              file.
                            type: string
                        required:
                        - name
                        type: object
                      type: array
                    spec:
                      $ref: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
                  type: object
                image:
                  description: Image to run in the form IMAGE[:TAG|@DIGEST]
                  pattern: (^([a-zA-Z][a-zA-Z0-9._-]*(:\d+)?/)?[a-z0-9._-]+(/[a-z0-9._-]+)*((@[a-z0-9]+:[a-z0-9]+)|(:[a-zA-Z0-9._-]{1,128}))?$)|\{\{
                  type: string
                options:
                  description: Options (flags) to pass to docker build/run/compose
                  items:
                    type: string
                  type: array
                ports:
                  description: Non intercept related ports exposed to the host, such
                    as ports used for debugging
                  items:
                    maximum: 65535
                    minimum: 1
                    type: integer
                  type: array
              type: object
            environment:
              description: Additional environment
              items:
                additionalProperties: false
                properties:
                  name:
                    pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
                    type: string
                  value:
                    type: string
                required:
                - name
                - value
                type: object
              type: array
              x-kubernetes-list-map-keys:
              - name
              x-kubernetes-list-type: map
            external:
              additionalProperties: false
              description: Output info to external runner
              properties:
                isDocker:
                  description: True if the external runner is containerized
                  type: boolean
                outputFormat:
                  description: Format for the emitted info
                  enum:
                  - json
                  - yaml
                  type: string
                outputPath:
                  description: Path to the file that will receive the output. Can
                    be stdout, stderr, or a file path
                  type: string
              type: object
            name:
              maxLength: 63
              pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
              type: string
            script:
              additionalProperties: false
              description: Run a script using a shell
              properties:
                run:
                  description: Script to run with a shell.
                  type: string
                shell:
                  description: The shell used when running the script.
                  enum:
                  - bash
                  - zsh
                  - sh
                  type: string
              required:
              - run
              type: object
            stopGracePeriod:
              description: Number of seconds to wait after a SIGTERM before the SIGKILL
                arrives
              type: integer
          required:
          - name
          type: object
        maxItems: 64
        minItems: 1
        type: array
        x-kubernetes-list-map-keys:
        - name
        x-kubernetes-list-type: map
      name:
        description: An name to give to the specification.
        pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$|\{\{
        type: string
      prerequisites:
        items:
          additionalProperties: false
          description: Things to create prior to starting any intercepts, and delete
            once the intercept is complete.
          properties:
            create:
              description: A handler to create things prior to starting any intercepts.
              maxLength: 63
              pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
              type: string
            delete:
              description: A handler to delete the created things once all intercepts
                have ended.
              maxLength: 63
              pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
              type: string
          required:
          - create
          type: object
        maxItems: 16
        type: array
      workloads:
        description: Remote workloads that are intercepted, keyed by workload name.
        items:
          additionalProperties: false
          description: An intercepted workload (Deployment, ReplicaSet or StatefulSet),
            keyed by name that is optionally prefixed with connection name and a slash.
          maxProperties: 4
          properties:
            intercepts:
              description: The services and/or ports to intercept
              items:
                additionalProperties: false
                properties:
                  enabled:
                    description: If set to false, disables this intercept. Default
                      is true
                    type: boolean
                  global:
                    description: If true, then intercept all tcp/udp traffic. Mutually
                      exclusive with headers, pathXxx properties, and previewURL.
                    type: boolean
                  handler:
                    description: The intercept handler that handles this intercept.
                    maxLength: 63
                    pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                    type: string
                  headers:
                    description: Headers that will filter the intercept. If omitted
                      or empty, and if global isn't explicitly set to true, an auto
                      header will be generated
                    items:
                      properties:
                        name:
                          type: string
                        value:
                          type: string
                      required:
                      - name
                      - value
                      type: object
                    type: array
                    x-kubernetes-list-map-keys:
                    - name
                    x-kubernetes-list-type: map
                  localAddress:
                    description: The local IP address that will receive the intercepted
                      traffic.
                    pattern: ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$|\{\{
                    type: string
                  localPort:
                    description: The local port that will receive the intercepted
                      traffic.
                    maximum: 65535
                    minimum: 1
                    type: integer
                  meta:
                    description: Metadata that will be returned by the Telepresence
                      API server
                    items:
                      additionalProperties: false
                      properties:
                        name:
                          pattern: ^[a-zA-Z][a-zA-Z0-9._-]*$
                          type: string
                        value:
                          type: string
                      required:
                      - name
                      - value
                      type: object
                    type: array
                    x-kubernetes-list-map-keys:
                    - name
                    x-kubernetes-list-type: map
                  mountPoint:
                    description: The local directory or drive where the remote volumes
                      are mounted
                    type: string
                  name:
                    description: Optional name of the intercept.
                    maxLength: 63
                    pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                    type: string
                  pathEqual:
                    description: Path filter for the intercept.
                    type: string
                  pathPrefix:
                    description: Path prefix filter for the intercept. Defaults to
                      "/"
                    type: string
                  pathRegexp:
                    description: Path regular expression filter for the intercept.
                    type: string
                  pathSuffix:
                    description: Path suffix filter for the intercept.
                    type: string
                  plaintext:
                    description: Use plaintext format when communicating with the
                      interceptor process on the local workstation. Only meaningful
                      when intercepting workloads annotated with "getambassador.io/inject-originating-tls-secret"
                      to prevent that TLS is used during intercepts
                    type: boolean
                  port:
                    anyOf:
                    - maximum: 65535
                      minimum: 1
                      type: integer
                    - maxLength: 63
                      pattern: ^[a-z][a-z0-9-]*$|\{\{
                      type: string
                    description: The port that will be intercepted.
                    x-kubernetes-int-or-string: true
                  previewURL:
                    additionalProperties: false
                    properties:
                      banner:
                        description: Display banner on preview page (default true)
                        type: boolean
                      enable:
                        description: Enable preview URL (default true)
                        type: boolean
                      extraHeaders:
                        description: Additional headers in key1=value1,key2=value2
                          pairs injected in every preview page request
                        items:
                          additionalProperties: false
                          properties:
                            name:
                              pattern: ^[a-zA-Z][a-zA-Z0-9._-]*$
                              type: string
                            value:
                              type: string
                          required:
                          - name
                          - value
                          type: object
                        type: array
                        x-kubernetes-list-map-keys:
                        - name
                        x-kubernetes-list-type: map
                      ingress:
                        additionalProperties: false
                        properties:
                          host:
                            description: The ingress hostname.
                            type: string
                          l5Host:
                            description: The ingress L5 Hostname. Defaults to ingressHost
                            type: string
                          port:
                            description: The ingress port.
                            maximum: 65535
                            minimum: 1
                            type: integer
                          tls:
                            description: Determines if TLS is used.
                            type: boolean
                        type: object
                    type: object
                  replace:
                    default: false
                    description: If true, replace the running container.
                    type: boolean
                  service:
                    description: Name of service to intercept
                    maxLength: 63
                    pattern: ^[a-z][a-z0-9-]*$|\{\{
                    type: string
                required:
                - handler
                type: object
              maxItems: 16
              minItems: 1
              type: array
            name:
              description: The name of the Deployment, Replicaset, or Statefulset,
                optionally prefixed with a connection name and a slash.
              maxLength: 127
              pattern: ^([a-z0-9][a-z0-9-]{0,62}/)?[a-z][a-z0-9-]{0,62}$|\{\{
              type: string
            namespace:
              description: Deprecated. The namespace should be specified in the connection.
              maxLength: 64
              pattern: ^[a-z0-9][a-z0-9-]*$
              type: string
          required:
          - name
          type: object
        maxItems: 32
        minItems: 1
        type: array
    required:
    - workloads
    - handlers
    type: object
required:
- apiVersion
- kind
- metadata
- spec
title: Telepresence CRD Intercept Specification
type: object
