NetworkServicesEndpointPolicy


Property Value
Google Cloud Service Name Network Services
Google Cloud Service Documentation /traffic-director/docs/
Google Cloud REST Resource Name v1beta1/projects.locations.endpointPolicies
Google Cloud REST Resource Documentation /traffic-director/docs/reference/network-services/rest/v1beta1/projects.locations.endpointPolicies
Config Connector Resource Short Names gcpnetworkservicesendpointpolicy
gcpnetworkservicesendpointpolicies
networkservicesendpointpolicy
Config Connector Service Name networkservices.googleapis.com
Config Connector Resource Fully Qualified Name networkservicesendpointpolicies.networkservices.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Spec

Schema

authorizationPolicyRef:
  external: string
  name: string
  namespace: string
clientTlsPolicyRef:
  external: string
  name: string
  namespace: string
description: string
endpointMatcher:
  metadataLabelMatcher:
    metadataLabelMatchCriteria: string
    metadataLabels:
    - labelName: string
      labelValue: string
location: string
projectRef:
  external: string
  name: string
  namespace: string
resourceID: string
serverTlsPolicyRef:
  external: string
  name: string
  namespace: string
trafficPortSelector:
  ports:
  - string
type: string
Fields

authorizationPolicyRef

Optional

object

authorizationPolicyRef.external

Optional

string

Optional. This field specifies the URL of AuthorizationPolicy resource that applies authorization policies to the inbound traffic at the matched endpoints. Refer to Authorization. If this field is not specified, authorization is disabled(no authz checks) for this endpoint. Allowed value: The Google Cloud resource name of a `NetworkSecurityAuthorizationPolicy` resource (format: `projects/{{project}}/locations/{{location}}/authorizationPolicies/{{name}}`).

authorizationPolicyRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

authorizationPolicyRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

clientTlsPolicyRef

Optional

object

clientTlsPolicyRef.external

Optional

string

Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set to specify the authentication for traffic from the proxy to the actual endpoints. More specifically, it is applied to the outgoing traffic from the proxy to the endpoint. This is typically used for sidecar model where the proxy identifies itself as endpoint to the control plane, with the connection between sidecar and endpoint requiring authentication. If this field is not set, authentication is disabled(open). Applicable only when EndpointPolicyType is SIDECAR_PROXY. Allowed value: The Google Cloud resource name of a `NetworkSecurityClientTLSPolicy` resource (format: `projects/{{project}}/locations/{{location}}/clientTlsPolicies/{{name}}`).

clientTlsPolicyRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

clientTlsPolicyRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

description

Optional

string

Optional. A free-text description of the resource. Max length 1024 characters.

endpointMatcher

Required

object

Required. A matcher that selects endpoints to which the policies should be applied.

endpointMatcher.metadataLabelMatcher

Optional

object

The matcher is based on node metadata presented by xDS clients.

endpointMatcher.metadataLabelMatcher.metadataLabelMatchCriteria

Optional

string

Specifies how matching should be done. Supported values are: MATCH_ANY: At least one of the Labels specified in the matcher should match the metadata presented by xDS client. MATCH_ALL: The metadata presented by the xDS client should contain all of the labels specified here. The selection is determined based on the best match. For example, suppose there are three EndpointPolicy resources P1, P2 and P3 and if P1 has a the matcher as MATCH_ANY , P2 has MATCH_ALL , and P3 has MATCH_ALL . If a client with label connects, the config from P1 will be selected. If a client with label connects, the config from P2 will be selected. If a client with label connects, the config from P3 will be selected. If there is more than one best match, (for example, if a config P4 with selector exists and if a client with label connects), an error will be thrown. Possible values: METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED, MATCH_ANY, MATCH_ALL

endpointMatcher.metadataLabelMatcher.metadataLabels

Optional

list (object)

The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list can have at most 64 entries. The list can be empty if the match criteria is MATCH_ANY, to specify a wildcard match (i.e this matches any client).

endpointMatcher.metadataLabelMatcher.metadataLabels[]

Optional

object

endpointMatcher.metadataLabelMatcher.metadataLabels[].labelName

Required*

string

Required. Label name presented as key in xDS Node Metadata.

endpointMatcher.metadataLabelMatcher.metadataLabels[].labelValue

Required*

string

Required. Label value presented as value corresponding to the above key, in xDS Node Metadata.

location

Required

string

Immutable. The location for the resource

projectRef

Required

object

Immutable. The Project that this resource belongs to.

projectRef.external

Optional

string

The project for the resource Allowed value: The Google Cloud resource name of a `Project` resource (format: `projects/{{name}}`).

projectRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

projectRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

resourceID

Optional

string

Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.

serverTlsPolicyRef

Optional

object

serverTlsPolicyRef.external

Optional

string

Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to determine the authentication policy to be applied to terminate the inbound traffic at the identified backends. If this field is not set, authentication is disabled(open) for this endpoint. Allowed value: The Google Cloud resource name of a `NetworkSecurityServerTLSPolicy` resource (format: `projects/{{project}}/locations/{{location}}/serverTlsPolicies/{{name}}`).

serverTlsPolicyRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

serverTlsPolicyRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

trafficPortSelector

Optional

object

Optional. Port selector for the (matched) endpoints. If no port selector is provided, the matched config is applied to all ports.

trafficPortSelector.ports

Optional

list (string)

Optional. A list of ports. Can be port numbers or port range (example, specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

trafficPortSelector.ports[]

Optional

string

type

Required

string

Required. The type of endpoint config. This is primarily used to validate the configuration. Possible values: ENDPOINT_CONFIG_SELECTOR_TYPE_UNSPECIFIED, SIDECAR_PROXY, GRPC_SERVER

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
createTime: string
observedGeneration: integer
updateTime: string
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

createTime

string

Output only. The timestamp when the resource was created.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

updateTime

string

Output only. The timestamp when the resource was updated.

Sample YAML(s)

Typical Use Case

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: networkservices.cnrm.cloud.google.com/v1beta1
kind: NetworkServicesEndpointPolicy
metadata:
  labels:
    key-one: value-one
  name: networkservicesendpointpolicy-sample
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  location: global
  type: SIDECAR_PROXY
  authorizationPolicyRef:
    name: networksecurityauthorizationpolicy-sample
  endpointMatcher:
    metadataLabelMatcher:
      metadataLabelMatchCriteria: MATCH_ANY
      metadataLabels:
      - labelName: "filter-test"
        labelValue: "true"
  trafficPortSelector:
    ports:
    - "6767"
  description: "A sample endpoint policy"
  serverTlsPolicyRef:
    name: networksecurityservertlspolicy-sample
  clientTlsPolicyRef:
    name: networksecurityclienttlspolicy-sample
---
apiVersion: networksecurity.cnrm.cloud.google.com/v1beta1
kind: NetworkSecurityAuthorizationPolicy
metadata:
  labels:
    key-one: value-one
  name: networksecurityauthorizationpolicy-sample
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  location: global
  action: ALLOW
  description: Test Authorization Policy
  rules:
  - sources:
    - ipBlocks:
      - "1.2.3.4"
      principals:
      - "*"
    destinations:
    - hosts:
      - "demo-service"
      ports:
      - 8080
      methods:
      - "POST"
  - sources:
    - ipBlocks:
      - "1.2.3.5"
      principals:
      - "*"
    destinations:
    - hosts:
      - "test-service"
      ports:
      - 8081
      methods:
      - "GET"
---
apiVersion: networksecurity.cnrm.cloud.google.com/v1beta1
kind: NetworkSecurityClientTLSPolicy
metadata:
  name: networksecurityclienttlspolicy-sample
  labels:
    label-one: "value-one"
spec:
  description: Sample global client TLS policy
  location: global
  sni: example.com
  clientCertificate:
    certificateProviderInstance:
      pluginInstance: google_cloud_private_spiffe
  serverValidationCa:
    - certificateProviderInstance:
        pluginInstance: google_cloud_private_spiffe
---
apiVersion: networksecurity.cnrm.cloud.google.com/v1beta1
kind: NetworkSecurityServerTLSPolicy
metadata:
  name: networksecurityservertlspolicy-sample
  labels:
    label-one: "value-one"
spec:
  description: Sample global server TLS policy
  location: global
  allowOpen: true
  serverCertificate:
    certificateProviderInstance:
      pluginInstance: google_cloud_private_spiffe
  mtlsPolicy:
    clientValidationCa:
      - certificateProviderInstance:
          pluginInstance: google_cloud_private_spiffe