Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aws/amazon-vpc-resource-controller-k8s #125

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions code-generator/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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: []
Original file line number Diff line number Diff line change
@@ -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: []
1 change: 1 addition & 0 deletions kube-custom-resources-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
10 changes: 10 additions & 0 deletions kube-custom-resources-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down Expand Up @@ -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")]
Expand Down
2 changes: 2 additions & 0 deletions kube-custom-resources-rs/src/vpcresources_k8s_aws/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod v1alpha1;
pub mod v1beta1;
Original file line number Diff line number Diff line change
@@ -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<Vec<CNINodeFeatures>>,
}

/// 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<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}

/// CNINodeStatus defines the managed VPC resources.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CNINodeStatus {
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod cninodes;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod securitygrouppolicies;
Original file line number Diff line number Diff line change
@@ -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<SecurityGroupPolicyPodSelector>,
/// 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<SecurityGroupPolicySecurityGroups>,
/// 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<SecurityGroupPolicyServiceAccountSelector>,
}

/// 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<Vec<SecurityGroupPolicyPodSelectorMatchExpressions>>,
/// 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<BTreeMap<String, String>>,
}

/// 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<Vec<String>>,
}

/// 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<Vec<String>>,
}

/// 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<Vec<SecurityGroupPolicyServiceAccountSelectorMatchExpressions>>,
/// 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<BTreeMap<String, String>>,
}

/// 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<Vec<String>>,
}