diff --git a/.reuse/dep5 b/.reuse/dep5 index 12c5e03ec..8af6c8657 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -79,6 +79,10 @@ Files: crd-catalog/authzed/spicedb-operator/* Copyright: The authzed/spicedb-operator Authors License: Apache-2.0 +Files: crd-catalog/aws/amazon-vpc-resource-controller-k8s/* +Copyright: The aws/amazon-vpc-resource-controller-k8s Authors +License: Apache-2.0 + Files: crd-catalog/aws-controllers-k8s/apigatewayv2-controller/* Copyright: The aws-controllers-k8s/apigatewayv2-controller Authors License: Apache-2.0 diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index c39810553..dcda00c0c 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -201,6 +201,14 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ "https://github.com/authzed/spicedb-operator/blob/main/config/crds/authzed.com_spicedbclusters.yaml", ], }, + UpstreamSource { + project_name: "aws/amazon-vpc-resource-controller-k8s", + license: APACHE_V2, + urls: &[ + "https://github.com/aws/amazon-vpc-resource-controller-k8s/blob/master/config/crd/bases/vpcresources.k8s.aws_cninodes.yaml", + "https://github.com/aws/amazon-vpc-resource-controller-k8s/blob/master/config/crd/bases/vpcresources.k8s.aws_securitygrouppolicies.yaml", + ], + }, UpstreamSource { project_name: "aws-controllers-k8s/apigatewayv2-controller", license: APACHE_V2, diff --git a/crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1alpha1/cninodes.yaml b/crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1alpha1/cninodes.yaml new file mode 100644 index 000000000..e94aa081f --- /dev/null +++ b/crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1alpha1/cninodes.yaml @@ -0,0 +1,62 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.2 + name: cninodes.vpcresources.k8s.aws +spec: + group: vpcresources.k8s.aws + names: + kind: CNINode + listKind: CNINodeList + plural: cninodes + shortNames: + - cnd + singular: cninode + scope: Cluster + versions: + - additionalPrinterColumns: + - description: The features delegated to VPC resource controller + jsonPath: .spec.features + name: Features + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + 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: 'Important: Run "make" to regenerate code after modifying this file CNINodeSpec defines the desired state of CNINode' + properties: + features: + items: + description: Feature is a type of feature being supported by VPC resource controller and other AWS Services + properties: + name: + description: FeatureName is a type of feature name supported by AWS VPC CNI. It can be Security Group for Pods, custom networking, or others + type: string + value: + type: string + type: object + type: array + type: object + status: + description: CNINodeStatus defines the managed VPC resources. + type: object + type: object + served: true + storage: true + subresources: {} +status: + acceptedNames: + kind: '' + plural: '' + conditions: [] + storedVersions: [] diff --git a/crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1beta1/securitygrouppolicies.yaml b/crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1beta1/securitygrouppolicies.yaml new file mode 100644 index 000000000..76cbd506e --- /dev/null +++ b/crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1beta1/securitygrouppolicies.yaml @@ -0,0 +1,120 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.2 + name: securitygrouppolicies.vpcresources.k8s.aws +spec: + group: vpcresources.k8s.aws + names: + kind: SecurityGroupPolicy + listKind: SecurityGroupPolicyList + plural: securitygrouppolicies + shortNames: + - sgp + singular: securitygrouppolicy + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The security group IDs to apply to the elastic network interface of pods that match this policy + jsonPath: .spec.securityGroups.groupIds + name: Security-Group-Ids + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: Custom Resource Definition for applying security groups to pods + 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: SecurityGroupPolicySpec defines the desired state of SecurityGroupPolicy + properties: + podSelector: + description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + securityGroups: + description: GroupIds contains the list of security groups that will be applied to the network interface of the pod matching the criteria. + properties: + groupIds: + description: Groups is the list of EC2 Security Groups Ids that need to be applied to the ENI of a Pod. + items: + type: string + maxItems: 5 + minItems: 1 + type: array + type: object + serviceAccountSelector: + description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + type: object + type: object + served: true + storage: true + subresources: {} +status: + acceptedNames: + kind: '' + plural: '' + conditions: [] + storedVersions: [] diff --git a/kube-custom-resources-rs/Cargo.toml b/kube-custom-resources-rs/Cargo.toml index 4cd80508c..616cf392b 100644 --- a/kube-custom-resources-rs/Cargo.toml +++ b/kube-custom-resources-rs/Cargo.toml @@ -288,6 +288,7 @@ training_kubedl_io = [] upgrade_cattle_io = [] upgrade_managed_openshift_io = [] virt_virtink_smartx_com = [] +vpcresources_k8s_aws = [] wgpolicyk8s_io = [] wildfly_org = [] work_karmada_io = [] diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index c5776b681..66b586825 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -2308,6 +2308,14 @@ apiVersion `virt.virtink.smartx.com/v1alpha1`: - `VirtualMachineMigration` - `VirtualMachine` +## vpcresources_k8s_aws + +apiVersion `vpcresources.k8s.aws/v1alpha1`: +- `CNINode` + +apiVersion `vpcresources.k8s.aws/v1beta1`: +- `SecurityGroupPolicy` + ## wgpolicyk8s_io apiVersion `wgpolicyk8s.io/v1alpha1`: @@ -2875,6 +2883,8 @@ pub mod upgrade_cattle_io; pub mod upgrade_managed_openshift_io; #[cfg(feature = "virt_virtink_smartx_com")] pub mod virt_virtink_smartx_com; +#[cfg(feature = "vpcresources_k8s_aws")] +pub mod vpcresources_k8s_aws; #[cfg(feature = "wgpolicyk8s_io")] pub mod wgpolicyk8s_io; #[cfg(feature = "wildfly_org")] diff --git a/kube-custom-resources-rs/src/vpcresources_k8s_aws/mod.rs b/kube-custom-resources-rs/src/vpcresources_k8s_aws/mod.rs new file mode 100644 index 000000000..87218411e --- /dev/null +++ b/kube-custom-resources-rs/src/vpcresources_k8s_aws/mod.rs @@ -0,0 +1,2 @@ +pub mod v1alpha1; +pub mod v1beta1; diff --git a/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1alpha1/cninodes.rs b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1alpha1/cninodes.rs new file mode 100644 index 000000000..f62aec81d --- /dev/null +++ b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1alpha1/cninodes.rs @@ -0,0 +1,31 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1alpha1/cninodes.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; + +/// Important: Run "make" to regenerate code after modifying this file CNINodeSpec defines the desired state of CNINode +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "vpcresources.k8s.aws", version = "v1alpha1", kind = "CNINode", plural = "cninodes")] +#[kube(schema = "disabled")] +pub struct CNINodeSpec { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub features: Option>, +} + +/// Feature is a type of feature being supported by VPC resource controller and other AWS Services +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct CNINodeFeatures { + /// FeatureName is a type of feature name supported by AWS VPC CNI. It can be Security Group for Pods, custom networking, or others + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +/// CNINodeStatus defines the managed VPC resources. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct CNINodeStatus { +} + diff --git a/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1alpha1/mod.rs b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1alpha1/mod.rs new file mode 100644 index 000000000..57b16da69 --- /dev/null +++ b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1alpha1/mod.rs @@ -0,0 +1 @@ +pub mod cninodes; diff --git a/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1beta1/mod.rs b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1beta1/mod.rs new file mode 100644 index 000000000..5ab858942 --- /dev/null +++ b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1beta1/mod.rs @@ -0,0 +1 @@ +pub mod securitygrouppolicies; diff --git a/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1beta1/securitygrouppolicies.rs b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1beta1/securitygrouppolicies.rs new file mode 100644 index 000000000..22f9e127b --- /dev/null +++ b/kube-custom-resources-rs/src/vpcresources_k8s_aws/v1beta1/securitygrouppolicies.rs @@ -0,0 +1,79 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/aws/amazon-vpc-resource-controller-k8s/vpcresources.k8s.aws/v1beta1/securitygrouppolicies.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// SecurityGroupPolicySpec defines the desired state of SecurityGroupPolicy +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "vpcresources.k8s.aws", version = "v1beta1", kind = "SecurityGroupPolicy", plural = "securitygrouppolicies")] +#[kube(namespaced)] +#[kube(schema = "disabled")] +pub struct SecurityGroupPolicySpec { + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "podSelector")] + pub pod_selector: Option, + /// GroupIds contains the list of security groups that will be applied to the network interface of the pod matching the criteria. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityGroups")] + pub security_groups: Option, + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountSelector")] + pub service_account_selector: Option, +} + +/// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SecurityGroupPolicyPodSelector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SecurityGroupPolicyPodSelectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// GroupIds contains the list of security groups that will be applied to the network interface of the pod matching the criteria. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SecurityGroupPolicySecurityGroups { + /// Groups is the list of EC2 Security Groups Ids that need to be applied to the ENI of a Pod. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "groupIds")] + pub group_ids: Option>, +} + +/// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SecurityGroupPolicyServiceAccountSelector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SecurityGroupPolicyServiceAccountSelectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} +