Skip to content

Commit

Permalink
Add rabbitmq crd
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan committed Jan 19, 2024
1 parent bb4786e commit c824553
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 6 deletions.
18 changes: 18 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions catalog/kubedb/active_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
"2.3.2-debian",
"2.3.2-centos"
],
"Rabbitmq": [
"3.12"
],
"Redis": [
"7.2.3",
"7.0.14",
Expand Down
14 changes: 14 additions & 0 deletions catalog/kubedb/raw/rabbitmq/rabbitmq-3.12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: RabbitmqVersion
metadata:
name: "3.12"
spec:
db:
image: rabbitmq:3.12-management
initContainer:
image: raihankhanraka/rabbitmq-init:3.12
podSecurityPolicies:
databasePolicyName: rabbitmq-db
securityContext:
runAsUser: 1001
version: "3.12"
20 changes: 20 additions & 0 deletions catalog/kubedb/raw/rabbitmq/rabbitmq-psp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: rabbitmq-db
spec:
allowPrivilegeEscalation: false
fsGroup:
rule: RunAsAny
hostIPC: false
hostNetwork: false
hostPID: false
privileged: false
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- '*'
4 changes: 4 additions & 0 deletions catalog/kubestash/fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ func main() {
if strings.HasPrefix(args[i], "--redis-args=") {
args[i] = fmt.Sprintf(`--redis-args=${args:={{ .Values.%s.args }}}`, app)
}
case "rabbitmq":
if strings.HasPrefix(args[i], "--rabbitmq-args=") {
args[i] = fmt.Sprintf(`--rabbitmq-args=${args:={{ .Values.%s.args }}}`, app)
}
}
}

Expand Down
24 changes: 24 additions & 0 deletions charts/kubedb-catalog/templates/rabbitmq/rabbitmq-3.12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{ if $featureGates.Rabbitmq }}

apiVersion: catalog.kubedb.com/v1alpha1
kind: RabbitmqVersion
metadata:
name: '3.12'
labels:
{{- include "kubedb-catalog.labels" . | nindent 4 }}
spec:
db:
image: '{{ include "image.dockerLibrary" (merge (dict "_repo" "rabbitmq") $) }}:3.12-management'
initContainer:
image: '{{ include "image.dockerHub" (merge (dict "_repo" "raihankhanraka/rabbitmq-init") $) }}:3.12'
podSecurityPolicies:
databasePolicyName: rabbitmq-db
securityContext:
runAsUser: 1001
version: "3.12"
{{ end }}
29 changes: 29 additions & 0 deletions charts/kubedb-catalog/templates/rabbitmq/rabbitmq-psp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{ if and .Values.psp.enabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") $featureGates.Rabbitmq }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: 'rabbitmq-db'
labels:
{{- include "kubedb-catalog.labels" . | nindent 4 }}
spec:
allowPrivilegeEscalation: {{ .Values.psp.rabbitmq.allowPrivilegeEscalation }}
privileged: {{ .Values.psp.rabbitmq.privileged }}
fsGroup:
rule: RunAsAny
hostIPC: false
hostNetwork: false
hostPID: false
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- '*'
{{ end }}
10 changes: 10 additions & 0 deletions charts/kubedb-catalog/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ properties:
- allowPrivilegeEscalation
- privileged
type: object
rabbitmq:
properties:
allowPrivilegeEscalation:
type: boolean
privileged:
type: boolean
required:
- allowPrivilegeEscalation
- privileged
type: object
redis:
properties:
allowPrivilegeEscalation:
Expand Down
5 changes: 4 additions & 1 deletion charts/kubedb-catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ featureGates:
PgPool: false
Postgres: true
ProxySQL: true
RabbitMQ: false
Rabbitmq: true
Redis: true
SingleStore: false
Solr: false
Expand Down Expand Up @@ -78,6 +78,9 @@ psp:
kafka:
allowPrivilegeEscalation: false
privileged: false
rabbitmq:
allowPrivilegeEscalation: false
privileged: false

# Set true to avoid deploying deprecated versions
skipDeprecated: true
4 changes: 2 additions & 2 deletions charts/kubedb-webhook-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ The following table lists the configurable parameters of the `kubedb-webhook-ser
| featureGates.PgPool | | <code>false</code> |
| featureGates.Postgres | | <code>true</code> |
| featureGates.ProxySQL | | <code>true</code> |
| featureGates.RabbitMQ | | <code>false</code> |
| featureGates.RabbitMQ | | <code>true</code> |
| featureGates.Redis | | <code>true</code> |
| featureGates.SingleStore | | <code>false</code> |
| featureGates.Singlestore | | <code>false</code> |
| featureGates.Solr | | <code>false</code> |
| featureGates.ZooKeeper | | <code>true</code> |
| imagePullSecrets | Specify an array of imagePullSecrets. Secrets must be manually created in the namespace. <br> Example: <br> `helm template charts/kubedb-webhook-server \` <br> `--set imagePullSecrets[0].name=sec0 \` <br> `--set imagePullSecrets[1].name=sec1` | <code>[]</code> |
Expand Down
4 changes: 2 additions & 2 deletions charts/kubedb-webhook-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ featureGates:
PgPool: false
Postgres: true
ProxySQL: true
RabbitMQ: false
RabbitMQ: true
Redis: true
SingleStore: false
Singlestore: false
Solr: false
ZooKeeper: true

Expand Down
10 changes: 10 additions & 0 deletions charts/kubedb/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,16 @@ properties:
- allowPrivilegeEscalation
- privileged
type: object
rabbitmq:
properties:
allowPrivilegeEscalation:
type: boolean
privileged:
type: boolean
required:
- allowPrivilegeEscalation
- privileged
type: object
redis:
properties:
allowPrivilegeEscalation:
Expand Down
2 changes: 1 addition & 1 deletion hack/scripts/import-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ crd_dir=${1:-}/apimachinery/crds
update_kubedb_crds=true

api_repo_url=https://github.com/kubedb/apimachinery.git
api_repo_tag=${KUBEDB_APIMACHINERY_TAG:-master}
api_repo_tag=${KUBEDB_APIMACHINERY_TAG:-rabbitmq}

if [ "$#" -ne 1 ]; then
if [ "${api_repo_tag}" == "master" ]; then
Expand Down

0 comments on commit c824553

Please sign in to comment.