Skip to content
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
8 changes: 7 additions & 1 deletion nodenetworkconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ generate: $(GOFILES) controller-gen
.PHONY: controller-gen

controller-gen:
@(cd && GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0)
@(cd && GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0)

.PHONY: manifests

manifests: controller-gen
mkdir -p manifests
controller-gen crd:trivialVersions=true paths="./..." output:crd:artifacts:config=manifests/
16 changes: 11 additions & 5 deletions nodenetworkconfig/api/v1alpha/nodenetworkconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import (
// +kubebuilder:object:root=true

// NodeNetworkConfig is the Schema for the nodenetworkconfigs API
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:resource:shortName=nnc
// +kubebuilder:subresource:status
type NodeNetworkConfig struct {
metav1.TypeMeta `json:",inline"`
Expand All @@ -52,10 +53,15 @@ type NodeNetworkConfigSpec struct {

// NodeNetworkConfigStatus defines the observed state of NetworkConfig
type NodeNetworkConfigStatus struct {
BatchSize int64 `json:"batchSize,omitempty"`
ReleaseThresholdPercent int64 `json:"releaseThresholdPercent,omitempty"`
RequestThresholdPercent int64 `json:"requestThresholdPercent,omitempty"`
NetworkContainers []NetworkContainer `json:"networkContainers,omitempty"`
Scaler Scaler `json:"scaler,omitempty"`
NetworkContainers []NetworkContainer `json:"networkContainers,omitempty"`
}

// Scaler groups IP request params together
type Scaler struct {
BatchSize int64 `json:"batchSize,omitempty"`
ReleaseThresholdPercent int64 `json:"releaseThresholdPercent,omitempty"`
RequestThresholdPercent int64 `json:"requestThresholdPercent,omitempty"`
}

// NetworkContainer defines the structure of a Network Container as found in NetworkConfigStatus
Expand Down
16 changes: 16 additions & 0 deletions nodenetworkconfig/api/v1alpha/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 106 additions & 0 deletions nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: nodenetworkconfigs.acn.azure.com
spec:
group: acn.azure.com
names:
kind: NodeNetworkConfig
listKind: NodeNetworkConfigList
plural: nodenetworkconfigs
shortNames:
- nnc
singular: nodenetworkconfig
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: NodeNetworkConfig is the Schema for the nodenetworkconfigs 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: NodeNetworkConfigSpec defines the desired state of NetworkConfig
properties:
iPsNotInUse:
items:
type: string
type: array
requestedIPCount:
format: int64
type: integer
type: object
status:
description: NodeNetworkConfigStatus defines the observed state of NetworkConfig
properties:
networkContainers:
items:
description: NetworkContainer defines the structure of a Network Container
as found in NetworkConfigStatus
properties:
defaultGateway:
type: string
iPAssignments:
items:
description: IPAssignment groups an IP address and Name. Name
is a UUID set by the the IP address assigner.
properties:
iP:
type: string
name:
type: string
type: object
type: array
id:
type: string
netmask:
description: Netmask for the subnet represented by this NC's SubnetID
type: string
primaryIP:
type: string
subnetID:
type: string
type: object
type: array
scaler:
description: Scaler groups IP request params together
properties:
batchSize:
format: int64
type: integer
releaseThresholdPercent:
format: int64
type: integer
requestThresholdPercent:
format: int64
type: integer
type: object
type: object
type: object
version: v1alpha
versions:
- name: v1alpha
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []