apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.6.2
  name: vmusers.operator.victoriametrics.com
spec:
  group: operator.victoriametrics.com
  names:
    kind: VMUser
    listKind: VMUserList
    plural: vmusers
    singular: vmuser
  scope: Namespaced
  versions:
  - name: v1beta1
    schema:
      openAPIV3Schema:
        description: VMUser is the Schema for the vmusers API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: VMUserSpec defines the desired state of VMUser
            properties:
              bearerToken:
                description: BearerToken Authorization header value for accessing
                  protected endpoint.
                type: string
              generatePassword:
                description: GeneratePassword instructs operator to generate password
                  for user if spec.password if empty.
                type: boolean
              password:
                description: Password basic auth password for accessing protected
                  endpoint.
                type: string
              passwordRef:
                description: PasswordRef allows to fetch password from user-create
                  secret by its name and key.
                properties:
                  key:
                    description: The key of the secret to select from.  Must be a
                      valid secret key.
                    type: string
                  name:
                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
                      TODO: Add other useful fields. apiVersion, kind, uid?'
                    type: string
                  optional:
                    description: Specify whether the Secret or its key must be defined
                    type: boolean
                required:
                - key
                type: object
              targetRefs:
                description: TargetRefs - reference to endpoints, which user may access.
                items:
                  description: 'TargetRef describes target for user traffic forwarding.
                    one of target types can be chosen: crd or static per targetRef.
                    user can define multiple targetRefs with different ref Types.'
                  properties:
                    crd:
                      description: CRD describes exist operator's CRD object, operator
                        generates access url based on CRD params.
                      properties:
                        kind:
                          description: 'Kind one of: VMAgent VMAlert VMCluster VMSingle
                            or VMAlertManager'
                          type: string
                        name:
                          description: Name target CRD object name
                          type: string
                        namespace:
                          description: Namespace target CRD object namespace.
                          type: string
                      required:
                      - kind
                      - name
                      - namespace
                      type: object
                    paths:
                      description: Paths - matched path to route.
                      items:
                        type: string
                      type: array
                    static:
                      description: Static - user defined url for traffic forward,
                        for instance http://vmsingle:8429
                      properties:
                        url:
                          description: URL http url for given staticRef.
                          type: string
                      required:
                      - url
                      type: object
                    target_path_suffix:
                      description: QueryParams []string `json:"queryParams,omitempty"`
                        TargetPathSuffix allows to add some suffix to the target path
                        It allows to hide tenant configuration from user with crd
                        as ref. it also may contain any url encoded params.
                      type: string
                  type: object
                type: array
              username:
                description: UserName basic auth user name for accessing protected
                  endpoint, will be replaced with metadata.name of VMUser if omitted.
                type: string
            required:
            - targetRefs
            type: object
          status:
            description: VMUserStatus defines the observed state of VMUser
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
