Browse Source

Add prometheus operator apis

pull/4/head
Andrey Inishev 1 year ago
parent
commit
b69750f2f2
2 changed files with 101 additions and 1 deletions
  1. +7
    -0
      cmd/manager/main.go
  2. +94
    -1
      deploy/crds/rabbitmq_v1_rabbitmq_crd.yaml

+ 7
- 0
cmd/manager/main.go View File

@@ -13,6 +13,7 @@ import (
sdkVersion "github.com/operator-framework/operator-sdk/version"
"github.com/spf13/pflag"
"github.com/tekliner/rabbitmq-operator/pkg/apis"
prometheusApis "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/tekliner/rabbitmq-operator/pkg/controller"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"sigs.k8s.io/controller-runtime/pkg/client/config"
@@ -97,6 +98,12 @@ func main() {
os.Exit(1)
}

// Setup Scheme for all resources
if err = prometheusApis.AddToScheme(mgr.GetScheme()); err != nil {
log.Error(err, "")
os.Exit(1)
}

// Setup all Controllers
if err := controller.AddToManager(mgr); err != nil {
log.Error(err, "")


+ 94
- 1
deploy/crds/rabbitmq_v1_rabbitmq_crd.yaml View File

@@ -1,7 +1,6 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: rabbitmqs.rabbitmq.improvado.io
spec:
group: rabbitmq.improvado.io
@@ -17,12 +16,106 @@ spec:
openAPIV3Schema:
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/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/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
auth:
description: 'TODO: auth mechanisms'
properties:
enabled:
type: boolean
mechanisms:
items:
type: string
type: array
uniqueItems: true
required:
- enabled
type: object
cert:
description: 'set SSL settings TODO: add to template, issue certs with
Vault'
properties:
cacertfile:
type: string
certfile:
type: string
enabled:
type: boolean
exitingSecret:
type: string
keyfile:
type: string
required:
- enabled
type: object
env:
description: set your own ENV variables in k8s style
items:
type: object
type: array
image:
description: you can set your own image instead of official
properties:
name:
type: string
tag:
type: string
required:
- name
- tag
type: object
plugins:
description: load additional plugins
items:
type: string
type: array
policies:
description: set rabbitmq policies
items:
properties:
definition:
properties:
expires:
format: int64
type: integer
type: object
name:
type: string
pattern:
type: string
priority:
format: int64
type: integer
vhost:
type: string
required:
- name
- pattern
- definition
- priority
type: object
type: array
replicas:
format: int32
maximum: 10
minimum: 1
type: integer
required:
- replicas
- policies
- plugins
- image
type: object
status:
type: object


Loading…
Cancel
Save