-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from octarinesec/runtime-crd
Runtime crd
- Loading branch information
Showing
54 changed files
with
2,962 additions
and
471 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,25 +1,30 @@ | ||
domain: operator.containers.carbonblack.io | ||
layout: go.kubebuilder.io/v3 | ||
plugins: | ||
manifests.sdk.operatorframework.io/v2: {} | ||
scorecard.sdk.operatorframework.io/v2: {} | ||
projectName: cbcontainers | ||
repo: github.com/vmware/cbcontainers-operator | ||
resources: | ||
- api: | ||
crdVersion: v1beta1 | ||
controller: true | ||
domain: operator.containers.carbonblack.io | ||
group: | ||
kind: CBContainersCluster | ||
path: github.com/vmware/cbcontainers-operator/api/v1 | ||
version: v1 | ||
- api: | ||
crdVersion: v1beta1 | ||
controller: true | ||
domain: operator.containers.carbonblack.io | ||
group: | ||
kind: CBContainersHardening | ||
path: github.com/vmware/cbcontainers-operator/api/v1 | ||
version: v1 | ||
- api: | ||
crdVersion: v1beta1 | ||
controller: true | ||
domain: operator.containers.carbonblack.io | ||
kind: CBContainersRuntime | ||
path: github.com/vmware/cbcontainers-operator/api/v1 | ||
version: v1 | ||
version: "3" | ||
plugins: | ||
manifests.sdk.operatorframework.io/v2: {} | ||
scorecard.sdk.operatorframework.io/v2: {} |
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
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
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
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,110 @@ | ||
/* | ||
Copyright 2021. | ||
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. | ||
*/ | ||
|
||
package v1 | ||
|
||
import ( | ||
coreV1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type CBContainersRuntimeResolverSpec struct { | ||
EventsGatewaySpec CBContainersEventsGatewaySpec `json:"eventsGatewaySpec,required"` | ||
// +kubebuilder:default:=<> | ||
Labels map[string]string `json:"labels,omitempty"` | ||
// +kubebuilder:default:=<> | ||
DeploymentAnnotations map[string]string `json:"deploymentAnnotations,omitempty"` | ||
// +kubebuilder:default:={prometheus.io/scrape: "false", prometheus.io/port: "7071"} | ||
PodTemplateAnnotations map[string]string `json:"podTemplateAnnotations,omitempty"` | ||
// +kubebuilder:default:=1 | ||
ReplicasCount *int32 `json:"replicasCount,omitempty"` | ||
// +kubebuilder:default:=<> | ||
Env map[string]string `json:"env,omitempty"` | ||
// +kubebuilder:default:={repository:"cbartifactory/runtime-kubernetes-resolver"} | ||
Image CBContainersImageSpec `json:"image,omitempty"` | ||
// +kubebuilder:default:={requests: {memory: "64Mi", cpu: "200m"}, limits: {memory: "128Mi", cpu: "600m"}} | ||
Resources coreV1.ResourceRequirements `json:"resources,omitempty"` | ||
// +kubebuilder:default:=<> | ||
Probes CBContainersHTTPProbesSpec `json:"probes,omitempty"` | ||
// +kubebuilder:default:=<> | ||
Prometheus CBContainersPrometheusSpec `json:"prometheus,omitempty"` | ||
} | ||
|
||
type CBContainersRuntimeSensorSpec struct { | ||
// +kubebuilder:default:=<> | ||
Labels map[string]string `json:"labels,omitempty"` | ||
// +kubebuilder:default:=<> | ||
DaemonSetAnnotations map[string]string `json:"daemonSetAnnotations,omitempty"` | ||
// +kubebuilder:default:={prometheus.io/scrape: "false", prometheus.io/port: "7071"} | ||
PodTemplateAnnotations map[string]string `json:"podTemplateAnnotations,omitempty"` | ||
// +kubebuilder:default:=<> | ||
Env map[string]string `json:"env,omitempty"` | ||
// +kubebuilder:default:={repository:"cbartifactory/runtime-kubernetes-sensor"} | ||
Image CBContainersImageSpec `json:"image,omitempty"` | ||
// +kubebuilder:default:={requests: {memory: "1Gi", cpu: "400m"}, limits: {memory: "2Gi", cpu: "1"}} | ||
Resources coreV1.ResourceRequirements `json:"resources,omitempty"` | ||
// +kubebuilder:default:=<> | ||
Probes CBContainersFileProbesSpec `json:"probes,omitempty"` | ||
// +kubebuilder:default:=<> | ||
Prometheus CBContainersPrometheusSpec `json:"prometheus,omitempty"` | ||
// +kubebuilder:default:=2 | ||
VerbosityLevel *int `json:"verbosity_level,omitempty"` | ||
} | ||
|
||
// CBContainersRuntimeSpec defines the desired state of CBContainersRuntime | ||
type CBContainersRuntimeSpec struct { | ||
Version string `json:"version,required"` | ||
// +kubebuilder:default:="cbcontainers-access-token" | ||
AccessTokenSecretName string `json:"accessTokenSecretName,omitempty"` | ||
// +kubebuilder:default:=<> | ||
ResolverSpec CBContainersRuntimeResolverSpec `json:"resolverSpec,omitempty"` | ||
// +kubebuilder:default:=<> | ||
SensorSpec CBContainersRuntimeSensorSpec `json:"sensorSpec,omitempty"` | ||
// +kubebuilder:default:=443 | ||
InternalGrpcPort int32 `json:"internalGrpcPort,omitempty"` | ||
} | ||
|
||
// CBContainersRuntimeStatus defines the observed state of CBContainersRuntime | ||
type CBContainersRuntimeStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:scope=Cluster | ||
|
||
// CBContainersRuntime is the Schema for the cbcontainersruntimes API | ||
type CBContainersRuntime struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CBContainersRuntimeSpec `json:"spec,omitempty"` | ||
Status CBContainersRuntimeStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// CBContainersRuntimeList contains a list of CBContainersRuntime | ||
type CBContainersRuntimeList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CBContainersRuntime `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&CBContainersRuntime{}, &CBContainersRuntimeList{}) | ||
} |
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,19 @@ | ||
package v1 | ||
|
||
type CBContainersEventsGatewaySpec struct { | ||
Host string `json:"host,required"` | ||
// +kubebuilder:default:=443 | ||
Port int `json:"port,omitempty"` | ||
} | ||
|
||
type CBContainersApiGatewaySpec struct { | ||
Host string `json:"host,required"` | ||
// +kubebuilder:default:="https" | ||
Scheme string `json:"scheme,omitempty"` | ||
// +kubebuilder:default:=443 | ||
Port int `json:"port,omitempty"` | ||
// +kubebuilder:default:="containers" | ||
Adapter string `json:"adapter,omitempty"` | ||
// +kubebuilder:default:="cbcontainers-access-token" | ||
AccessTokenSecretName string `json:"accessTokenSecretName,omitempty"` | ||
} |
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,12 @@ | ||
package v1 | ||
|
||
import ( | ||
coreV1 "k8s.io/api/core/v1" | ||
) | ||
|
||
type CBContainersImageSpec struct { | ||
Repository string `json:"repository,omitempty"` | ||
Tag string `json:"tag,omitempty"` | ||
// +kubebuilder:default:="Always" | ||
PullPolicy coreV1.PullPolicy `json:"pullPolicy,omitempty"` | ||
} |
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 @@ | ||
package v1 | ||
|
||
type CBContainersPrometheusSpec struct { | ||
// +kubebuilder:default:=false | ||
Enabled *bool `json:"enabled,omitempty"` | ||
// +kubebuilder:default:=7071 | ||
Port int `json:"port,omitempty"` | ||
} |
Oops, something went wrong.