Skip to content

Commit f0de82e

Browse files
committed
add new mongodb addon
1 parent a02e55a commit f0de82e

17 files changed

+699
-0
lines changed

PROJECT

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,11 @@ resources:
143143
group: application
144144
kind: KuberoAddonRabbitmq
145145
version: v1alpha1
146+
- api:
147+
crdVersion: v1
148+
namespaced: true
149+
domain: kubero.dev
150+
group: application
151+
kind: KuberoAddonMongodb
152+
version: v1alpha1
146153
version: "3"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
name: kuberoaddonmongodbs.application.kubero.dev
6+
spec:
7+
group: application.kubero.dev
8+
names:
9+
kind: KuberoAddonMongodb
10+
listKind: KuberoAddonMongodbList
11+
plural: kuberoaddonmongodbs
12+
singular: kuberoaddonmongodb
13+
scope: Namespaced
14+
versions:
15+
- name: v1alpha1
16+
schema:
17+
openAPIV3Schema:
18+
description: KuberoAddonMongodb is the Schema for the kuberoaddonmongodbs API
19+
properties:
20+
apiVersion:
21+
description: 'APIVersion defines the versioned schema of this representation
22+
of an object. Servers should convert recognized schemas to the latest
23+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
24+
type: string
25+
kind:
26+
description: 'Kind is a string value representing the REST resource this
27+
object represents. Servers may infer this from the endpoint the client
28+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
29+
type: string
30+
metadata:
31+
type: object
32+
spec:
33+
description: Spec defines the desired state of KuberoAddonMongodb
34+
type: object
35+
x-kubernetes-preserve-unknown-fields: true
36+
status:
37+
description: Status defines the observed state of KuberoAddonMongodb
38+
type: object
39+
x-kubernetes-preserve-unknown-fields: true
40+
type: object
41+
served: true
42+
storage: true
43+
subresources:
44+
status: {}

config/crd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ resources:
2121
- bases/application.kubero.dev_kuberoaddonpostgres.yaml
2222
- bases/application.kubero.dev_kuberoaddonredis.yaml
2323
- bases/application.kubero.dev_kuberoaddonrabbitmqs.yaml
24+
- bases/application.kubero.dev_kuberoaddonmongodbs.yaml
2425
#+kubebuilder:scaffold:crdkustomizeresource
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This rule is not used by the project kubero-operator itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants full permissions ('*') over application.kubero.dev.
5+
# This role is intended for users authorized to modify roles and bindings within the cluster,
6+
# enabling them to delegate specific permissions to other users or groups as needed.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: kubero-operator
13+
app.kubernetes.io/managed-by: kustomize
14+
name: kuberoaddonmongodb-admin-role
15+
rules:
16+
- apiGroups:
17+
- application.kubero.dev
18+
resources:
19+
- kuberoaddonmongodbs
20+
verbs:
21+
- '*'
22+
- apiGroups:
23+
- application.kubero.dev
24+
resources:
25+
- kuberoaddonmongodbs/status
26+
verbs:
27+
- get
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This rule is not used by the project kubero-operator itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants permissions to create, update, and delete resources within the application.kubero.dev.
5+
# This role is intended for users who need to manage these resources
6+
# but should not control RBAC or manage permissions for others.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: kubero-operator
13+
app.kubernetes.io/managed-by: kustomize
14+
name: kuberoaddonmongodb-editor-role
15+
rules:
16+
- apiGroups:
17+
- application.kubero.dev
18+
resources:
19+
- kuberoaddonmongodbs
20+
verbs:
21+
- create
22+
- delete
23+
- get
24+
- list
25+
- patch
26+
- update
27+
- watch
28+
- apiGroups:
29+
- application.kubero.dev
30+
resources:
31+
- kuberoaddonmongodbs/status
32+
verbs:
33+
- get
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This rule is not used by the project kubero-operator itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants read-only access to application.kubero.dev resources.
5+
# This role is intended for users who need visibility into these resources
6+
# without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: kubero-operator
13+
app.kubernetes.io/managed-by: kustomize
14+
name: kuberoaddonmongodb-viewer-role
15+
rules:
16+
- apiGroups:
17+
- application.kubero.dev
18+
resources:
19+
- kuberoaddonmongodbs
20+
verbs:
21+
- get
22+
- list
23+
- watch
24+
- apiGroups:
25+
- application.kubero.dev
26+
resources:
27+
- kuberoaddonmongodbs/status
28+
verbs:
29+
- get

config/rbac/kustomization.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ resources:
2020
# default, aiding admins in cluster management. Those roles are
2121
# not used by the kubero-operator itself. You can comment the following lines
2222
# if you do not want those helpers be installed with your Project.
23+
- kuberoaddonmongodb_admin_role.yaml
24+
- kuberoaddonmongodb_editor_role.yaml
25+
- kuberoaddonmongodb_viewer_role.yaml
2326
- kuberoaddonrabbitmq_admin_role.yaml
2427
- kuberoaddonrabbitmq_editor_role.yaml
2528
- kuberoaddonrabbitmq_viewer_role.yaml

config/rbac/role.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,4 +909,35 @@ rules:
909909
resources:
910910
- "deployments"
911911

912+
##
913+
## Rules for application.kubero.dev/v1alpha1, Kind: KuberoAddonMongodb
914+
##
915+
- apiGroups:
916+
- application.kubero.dev
917+
resources:
918+
- kuberoaddonmongodbs
919+
- kuberoaddonmongodbs/status
920+
- kuberoaddonmongodbs/finalizers
921+
verbs:
922+
- create
923+
- delete
924+
- get
925+
- list
926+
- patch
927+
- update
928+
- watch
929+
- verbs:
930+
- "*"
931+
apiGroups:
932+
- ""
933+
resources:
934+
- "serviceaccounts"
935+
- "services"
936+
- verbs:
937+
- "*"
938+
apiGroups:
939+
- "apps"
940+
resources:
941+
- "deployments"
942+
912943
#+kubebuilder:scaffold:rules
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apiVersion: application.kubero.dev/v1alpha1
2+
kind: KuberoAddonMongodb
3+
metadata:
4+
name: kuberoaddonmongodb-sample
5+
spec:
6+
# Default values copied from <project_dir>/helm-charts/kuberoaddonmongodb/values.yaml
7+
affinity: {}
8+
autoscaling:
9+
enabled: false
10+
maxReplicas: 100
11+
minReplicas: 1
12+
targetCPUUtilizationPercentage: 80
13+
fullnameOverride: ""
14+
image:
15+
pullPolicy: IfNotPresent
16+
repository: nginx
17+
tag: ""
18+
imagePullSecrets: []
19+
ingress:
20+
annotations: {}
21+
className: ""
22+
enabled: false
23+
hosts:
24+
- host: chart-example.local
25+
paths:
26+
- path: /
27+
pathType: ImplementationSpecific
28+
tls: []
29+
livenessProbe:
30+
httpGet:
31+
path: /
32+
port: http
33+
nameOverride: ""
34+
nodeSelector: {}
35+
podAnnotations: {}
36+
podLabels: {}
37+
podSecurityContext: {}
38+
readinessProbe:
39+
httpGet:
40+
path: /
41+
port: http
42+
replicaCount: 1
43+
resources: {}
44+
securityContext: {}
45+
service:
46+
port: 80
47+
type: ClusterIP
48+
serviceAccount:
49+
annotations: {}
50+
automount: true
51+
create: true
52+
name: ""
53+
tolerations: []
54+
volumeMounts: []
55+
volumes: []
56+
57+

config/samples/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ resources:
1919
- application_v1alpha1_kuberoaddonpostgres.yaml
2020
- application_v1alpha1_kuberoaddonredis.yaml
2121
- application_v1alpha1_kuberoaddonrabbitmq.yaml
22+
- application_v1alpha1_kuberoaddonmongodb.yaml
2223
#+kubebuilder:scaffold:manifestskustomizesamples

0 commit comments

Comments
 (0)