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

operator command crd #506

Merged
merged 9 commits into from
Sep 25, 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
9 changes: 9 additions & 0 deletions charts/dependency_chart/operatorcommand-crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: kubescape-operator-command-crd
description: A Helm chart CRDs for Kubescape Operator commands

type: application

version: 0.0.1

appVersion: "0.0.1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: operatorcommands.kubescape.io
spec:
group: kubescape.io
names:
plural: operatorcommands
singular: operatorcommand
kind: OperatorCommand
shortNames:
- opcmd
scope: Namespaced
versions:
- name: v1alpha1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
guid:
type: string
commandType:
type: string
commandVersion:
type: string
nullable: true
designators:
type: array
items:
type: object
additionalProperties: true
body:
type: string
format: byte
nullable: true
ttl:
type: string
format: duration
nullable: true
args:
type: object
additionalProperties: true
nullable: true
commandIndex:
type: integer
nullable: true
commandCount:
type: integer
nullable: true
status:
type: object
properties:
started:
type: boolean
startedAt:
type: string
format: date-time
nullable: true
completed:
type: boolean
completedAt:
type: string
format: date-time
nullable: true
executer:
type: string
nullable: true
error:
type: object
nullable: true
properties:
reason:
type: string
nullable: true
message:
type: string
nullable: true
errorCode:
type: integer
nullable: true
subresources:
status: {}
Empty file.
4 changes: 4 additions & 0 deletions charts/kubescape-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ dependencies:
version: 0.0.1
repository: "file://../dependency_chart/servicescanresult-crds"
condition: serviceScanConfig.enabled
- name: kubescape-operator-command-crd
version: 0.0.1
repository: "file://../dependency_chart/operatorcommand-crds"

11 changes: 10 additions & 1 deletion charts/kubescape-operator/templates/node-agent/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ metadata:
{{- include "kubescape-operator.labels" (dict "Chart" .Chart "Release" .Release "Values" .Values "app" .Values.nodeAgent.name "tier" .Values.global.namespaceTier) | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods", "nodes", "services", "endpoints", "namespaces"]
resources: ["nodes", "services", "endpoints", "namespaces"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
amirmalka marked this conversation as resolved.
Show resolved Hide resolved
resources: ["pods"]
verbs: ["get", "watch", "list", "delete"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "watch", "list"]
Expand All @@ -28,4 +31,10 @@ rules:
- apiGroups: ["kubescape.io"]
resources: ["runtimerulealertbindings"]
verbs: ["list", "watch"]
- apiGroups: ["kubescape.io"]
resources: ["operatorcommands"]
verbs: ["get", "watch", "list"]
- apiGroups: ["kubescape.io"]
resources: ["operatorcommands/status"]
verbs: ["get", "watch", "list", "update", "patch"]
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ rules:
- apiGroups: ["kubescape.io"]
resources: ["servicesscanresults"]
verbs: ["get", "watch", "list"]
- apiGroups: ["kubescape.io"]
resources: ["operatorcommands"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ data:
"version": "v1",
"resource": "servicesscanresults",
"strategy": "patch"
},
{
"group": "kubescape.io",
"version": "v1alpha1",
"resource": "operatorcommands",
matthyx marked this conversation as resolved.
Show resolved Hide resolved
"strategy": "copy"
}
]
},
Expand Down
Loading
Loading