Skip to content

Commit

Permalink
Merge pull request #12 from kubero-dev/feature/add-simple-couchdb
Browse files Browse the repository at this point in the history
Feature / add simple couchdb
  • Loading branch information
mms-gianni authored Jan 16, 2023
2 parents 0ad41c0 + 1d1a4ea commit b9f1d18
Show file tree
Hide file tree
Showing 21 changed files with 429 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:

env:
SDK_VERSION: "v1.24.0"
# IMG: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.91
# BUNDLE_IMG: ghcr.io/kubero-dev/kubero-operator/kuberoapp-bundle:v0.0.91
# IMG: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.92
# BUNDLE_IMG: ghcr.io/kubero-dev/kubero-operator/kuberoapp-bundle:v0.0.92

jobs:
# Push image to GitHub Packages.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.91
VERSION ?= 0.0.92

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
7 changes: 7 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,11 @@ resources:
group: application
kind: KuberoElasticsearch
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: kubero.dev
group: application
kind: KuberoCouchDB
version: v1alpha1
version: "3"
50 changes: 50 additions & 0 deletions bundle/manifests/application.kubero.dev_kuberocouchdbs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: kuberocouchdbs.application.kubero.dev
spec:
group: application.kubero.dev
names:
kind: KuberoCouchDB
listKind: KuberoCouchDBList
plural: kuberocouchdbs
singular: kuberocouchdb
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: KuberoCouchDB is the Schema for the kuberocouchdbs 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: Spec defines the desired state of KuberoCouchDB
type: object
x-kubernetes-preserve-unknown-fields: true
status:
description: Status defines the observed state of KuberoCouchDB
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
60 changes: 56 additions & 4 deletions bundle/manifests/kubero-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,28 @@ metadata:
}
}
},
{
"apiVersion": "application.kubero.dev/v1alpha1",
"kind": "KuberoCouchDB",
"metadata": {
"name": "kuberocouchdb-sample"
},
"spec": {
"couchdb": {
"adminHash": "-pbkdf2-this_is_not_necessarily_secure_either",
"adminPassword": "this_is_not_secure",
"adminUsername": "admin",
"clusterSize": 3,
"cookieAuthSecret": "neither_is_this",
"enableSearch": false,
"persistentVolume": {
"enabled": true,
"size": "10Gi",
"storageClass": ""
}
}
}
},
{
"apiVersion": "application.kubero.dev/v1alpha1",
"kind": "KuberoElasticsearch",
Expand Down Expand Up @@ -659,13 +681,13 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
certified: "false"
containerImage: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.91
containerImage: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.92
description: Kubero is a GitOps continuous delivery tool for Kubernetes.
operators.operatorframework.io/builder: operator-sdk-v1.24.0
operators.operatorframework.io/project_layout: helm.sdk.operatorframework.io/v1
repository: https://github.com/kubero-dev/kubero
support: Kubero Community
name: kubero-operator.v0.0.91
name: kubero-operator.v0.0.92
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand All @@ -676,6 +698,9 @@ spec:
kind: KuberoApp
name: kuberoapps.application.kubero.dev
version: v1alpha1
- kind: KuberoCouchDB
name: kuberocouchdbs.application.kubero.dev
version: v1alpha1
- description: Elasticsearch is a distributed search and analytics engine. It
is used for web search, log monitoring, and real-time analytics. Ideal for
Big Data applications.
Expand Down Expand Up @@ -1180,6 +1205,33 @@ spec:
- rolebindings
verbs:
- '*'
- apiGroups:
- application.kubero.dev
resources:
- kuberocouchdbs
- kuberocouchdbs/status
- kuberocouchdbs/finalizers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
- services
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments
verbs:
- '*'
- apiGroups:
- authentication.k8s.io
resources:
Expand Down Expand Up @@ -1234,7 +1286,7 @@ spec:
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
- --leader-election-id=kubero-operator
image: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.91
image: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.92
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -1321,4 +1373,4 @@ spec:
provider:
name: kubero
url: https://github.com/kubero-dev/
version: 0.0.91
version: 0.0.92
44 changes: 44 additions & 0 deletions config/crd/bases/application.kubero.dev_kuberocouchdbs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: kuberocouchdbs.application.kubero.dev
spec:
group: application.kubero.dev
names:
kind: KuberoCouchDB
listKind: KuberoCouchDBList
plural: kuberocouchdbs
singular: kuberocouchdb
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: KuberoCouchDB is the Schema for the kuberocouchdbs 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: Spec defines the desired state of KuberoCouchDB
type: object
x-kubernetes-preserve-unknown-fields: true
status:
description: Status defines the observed state of KuberoCouchDB
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: true
subresources:
status: {}
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ resources:
- bases/application.kubero.dev_kuberoredis.yaml
- bases/application.kubero.dev_kuberomongodbs.yaml
- bases/application.kubero.dev_kuberoelasticsearches.yaml
- bases/application.kubero.dev_kuberocouchdbs.yaml
#+kubebuilder:scaffold:crdkustomizeresource
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/kubero-dev/kubero-operator/kuberoapp
newTag: v0.0.91
newTag: v0.0.92
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
certified: "false"
containerImage: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.91
containerImage: ghcr.io/kubero-dev/kubero-operator/kuberoapp:v0.0.92
description: Kubero is a GitOps continuous delivery tool for Kubernetes.
repository: https://github.com/kubero-dev/kubero
support: Kubero Community
Expand Down
24 changes: 24 additions & 0 deletions config/rbac/kuberocouchdb_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# permissions for end users to edit kuberocouchdbs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kuberocouchdb-editor-role
rules:
- apiGroups:
- application.kubero.dev
resources:
- kuberocouchdbs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- application.kubero.dev
resources:
- kuberocouchdbs/status
verbs:
- get
20 changes: 20 additions & 0 deletions config/rbac/kuberocouchdb_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# permissions for end users to view kuberocouchdbs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kuberocouchdb-viewer-role
rules:
- apiGroups:
- application.kubero.dev
resources:
- kuberocouchdbs
verbs:
- get
- list
- watch
- apiGroups:
- application.kubero.dev
resources:
- kuberocouchdbs/status
verbs:
- get
53 changes: 53 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,4 +468,57 @@ rules:
verbs:
- "*"

##
## Rules for application.kubero.dev/v1alpha1, Kind: KuberoCouchDB
##
- apiGroups:
- application.kubero.dev
resources:
- kuberocouchdbs
- kuberocouchdbs/status
- kuberocouchdbs/finalizers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- "apps"
resources:
- "statefulsets"
verbs:
- "*"
- apiGroups:
- ""
resources:
- "secrets"
- "configmaps"
- "serviceaccounts"
- "services"
- "persistentvolumeclaims"
- "persistentvolumes"
verbs:
- "*"
- apiGroups:
- "policy"
resources:
- "poddisruptionbudgets"
verbs:
- "*"
- apiGroups:
- "networking.k8s.io"
resources:
- "networkpolicies"
verbs:
- "*"
- apiGroups:
- "rbac.authorization.k8s.io"
resources:
- "roles"
- "rolebindings"
verbs:
- "*"
#+kubebuilder:scaffold:rules
31 changes: 31 additions & 0 deletions config/samples/application_v1alpha1_kuberocouchdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: application.kubero.dev/v1alpha1
kind: KuberoCouchDB
metadata:
name: kuberocouchdb-sample
spec:
# Default values copied from <project_dir>/helm-charts/kuberocouchdb/values.yaml
couchdb:
# -- the initial number of nodes in the CouchDB cluster.
clusterSize: 3
adminUsername: admin
adminPassword: this_is_not_secure
adminHash: -pbkdf2-this_is_not_necessarily_secure_either
cookieAuthSecret: neither_is_this

persistentVolume:
enabled: true
size: 10Gi
storageClass: ""

# -- Flip this to flag to include the Search container in each Pod
enableSearch: false

## Optional resource requests and limits for the CouchDB container
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
#resources: {}
# requests:
# cpu: 100m
# memory: 128Mi
# limits:
# cpu: 56
# memory: 256Gi
1 change: 1 addition & 0 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ resources:
- application_v1alpha1_kuberoredis.yaml
- application_v1alpha1_kuberomongodb.yaml
- application_v1alpha1_kuberoelasticsearch.yaml
- application_v1alpha1_kuberocouchdb.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
Loading

0 comments on commit b9f1d18

Please sign in to comment.