-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize sriovnetworkpoolconfig API
- Loading branch information
1 parent
65fb6e5
commit f08d16f
Showing
12 changed files
with
367 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,44 @@ | ||
domain: openshift.io | ||
layout: go.kubebuilder.io/v2 | ||
plugins: | ||
go.sdk.operatorframework.io/v2-alpha: {} | ||
projectName: sriov-network-operator | ||
repo: github.com/k8snetworkplumbingwg/sriov-network-operator | ||
resources: | ||
- | ||
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it. | ||
controller: true | ||
- controller: true | ||
domain: openshift.io | ||
group: sriovnetwork | ||
kind: SriovNetwork | ||
# TODO(user): Update the package path for your API if the below value is incorrect. | ||
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1 | ||
version: v1 | ||
- | ||
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it. | ||
controller: true | ||
- controller: true | ||
domain: openshift.io | ||
group: sriovnetwork | ||
kind: SriovIBNetwork | ||
# TODO(user): Update the package path for your API if the below value is incorrect. | ||
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1 | ||
version: v1 | ||
- | ||
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it. | ||
controller: true | ||
- controller: true | ||
domain: openshift.io | ||
group: sriovnetwork | ||
kind: SriovNetworkNodePolicy | ||
# TODO(user): Update the package path for your API if the below value is incorrect. | ||
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1 | ||
version: v1 | ||
- | ||
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it. | ||
controller: true | ||
- controller: true | ||
domain: openshift.io | ||
group: sriovnetwork | ||
kind: SriovNetworkNodeState | ||
# TODO(user): Update the package path for your API if the below value is incorrect. | ||
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1 | ||
version: v1 | ||
- | ||
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it. | ||
controller: true | ||
- controller: true | ||
domain: openshift.io | ||
group: sriovnetwork | ||
kind: SriovOperatorConfig | ||
# TODO(user): Update the package path for your API if the below value is incorrect. | ||
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1 | ||
version: v1 | ||
- controller: true | ||
domain: openshift.io | ||
group: sriovnetwork | ||
kind: SriovNetworkPoolConfig | ||
path: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1 | ||
version: v1 | ||
version: "3" | ||
plugins: | ||
go.sdk.operatorframework.io/v2-alpha: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// SriovNetworkPoolConfigSpec defines the desired state of SriovNetworkPoolConfig | ||
type SriovNetworkPoolConfigSpec struct { | ||
// OvsHardwareOffloadConfig describes the OVS HWOL configuration for selected Nodes | ||
OvsHardwareOffloadConfig OvsHardwareOffloadConfig `json:"ovsHardwareOffloadConfig,omitempty"` | ||
} | ||
|
||
type OvsHardwareOffloadConfig struct { | ||
// Name is mandatory and must be unique. | ||
// On Kubernetes: | ||
// Name is the name of OvsHardwareOffloadConfig | ||
// On OpenShift: | ||
// Name is the name of MachineConfigPool to be enabled with OVS hardware offload | ||
Name string `json:"name,omitempty"` | ||
} | ||
|
||
// SriovNetworkPoolConfigStatus defines the observed state of SriovNetworkPoolConfig | ||
type SriovNetworkPoolConfigStatus struct { | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// SriovNetworkPoolConfig is the Schema for the sriovnetworkpoolconfigs API | ||
type SriovNetworkPoolConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec SriovNetworkPoolConfigSpec `json:"spec,omitempty"` | ||
Status SriovNetworkPoolConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// SriovNetworkPoolConfigList contains a list of SriovNetworkPoolConfig | ||
type SriovNetworkPoolConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []SriovNetworkPoolConfig `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&SriovNetworkPoolConfig{}, &SriovNetworkPoolConfigList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
config/crd/bases/sriovnetwork.openshift.io_sriovnetworkpoolconfigs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.3.0 | ||
creationTimestamp: null | ||
name: sriovnetworkpoolconfigs.sriovnetwork.openshift.io | ||
spec: | ||
group: sriovnetwork.openshift.io | ||
names: | ||
kind: SriovNetworkPoolConfig | ||
listKind: SriovNetworkPoolConfigList | ||
plural: sriovnetworkpoolconfigs | ||
singular: sriovnetworkpoolconfig | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: SriovNetworkPoolConfig is the Schema for the sriovnetworkpoolconfigs | ||
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: SriovNetworkPoolConfigSpec defines the desired state of SriovNetworkPoolConfig | ||
properties: | ||
ovsHardwareOffloadConfig: | ||
description: OvsHardwareOffloadConfig describes the OVS HWOL configuration | ||
for selected Nodes | ||
properties: | ||
name: | ||
description: 'Name is mandatory and must be unique. On Kubernetes: | ||
Name is the name of OvsHardwareOffloadConfig On OpenShift: Name | ||
is the name of MachineConfigPool to be enabled with OVS hardware | ||
offload' | ||
type: string | ||
type: object | ||
type: object | ||
status: | ||
description: SriovNetworkPoolConfigStatus defines the observed state of | ||
SriovNetworkPoolConfig | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
config/crd/patches/cainjection_in_sriovnetworkpoolconfigs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# The following patch adds a directive for certmanager to inject CA into the CRD | ||
# CRD conversion requires k8s 1.13 or later. | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) | ||
name: sriovnetworkpoolconfigs.sriovnetwork.openshift.io |
17 changes: 17 additions & 0 deletions
17
config/crd/patches/webhook_in_sriovnetworkpoolconfigs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# The following patch enables conversion webhook for CRD | ||
# CRD conversion requires k8s 1.13 or later. | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: sriovnetworkpoolconfigs.sriovnetwork.openshift.io | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhookClientConfig: | ||
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, | ||
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) | ||
caBundle: Cg== | ||
service: | ||
namespace: system | ||
name: webhook-service | ||
path: /convert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# permissions for end users to edit sriovnetworkpoolconfigs. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: sriovnetworkpoolconfig-editor-role | ||
rules: | ||
- apiGroups: | ||
- sriovnetwork.openshift.io | ||
resources: | ||
- sriovnetworkpoolconfigs | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- sriovnetwork.openshift.io | ||
resources: | ||
- sriovnetworkpoolconfigs/status | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# permissions for end users to view sriovnetworkpoolconfigs. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: sriovnetworkpoolconfig-viewer-role | ||
rules: | ||
- apiGroups: | ||
- sriovnetwork.openshift.io | ||
resources: | ||
- sriovnetworkpoolconfigs | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- sriovnetwork.openshift.io | ||
resources: | ||
- sriovnetworkpoolconfigs/status | ||
verbs: | ||
- get |
Oops, something went wrong.