|
| 1 | +import { KuberoRabbitMQ } from './kuberoRabbitMQ'; |
| 2 | +import { Plugin, } from './plugin'; |
| 3 | +import { IPlugin, IPluginFormFields } from './plugin.interface'; |
| 4 | + |
| 5 | + |
| 6 | +// Classname must be same as the CRD's Name |
| 7 | +export class KuberoAddonMemcached extends Plugin implements IPlugin { |
| 8 | + public id: string = 'kubero-operator'; //same as operator name |
| 9 | + public displayName = 'Memcached'; |
| 10 | + public description = 'Memcached is a high-performance, distributed memory object caching system, intended for use in speeding up dynamic web applications by alleviating database load.'; |
| 11 | + public icon = '/img/addons/memcached.svg'; |
| 12 | + public install: string = ''; |
| 13 | + public url = |
| 14 | + 'https://artifacthub.io/packages/olm/community-operators/kubero-operator'; |
| 15 | + public docs = [ |
| 16 | + { |
| 17 | + title: 'Kubero Docs', |
| 18 | + url: '', |
| 19 | + }, |
| 20 | + ]; |
| 21 | + public artifact_url = |
| 22 | + 'https://artifacthub.io/api/v1/packages/olm/kubero/kubero-operator'; |
| 23 | + public beta: boolean = false; |
| 24 | + public deprecated: boolean = false; |
| 25 | + |
| 26 | + public formfields: { [key: string]: IPluginFormFields } = { |
| 27 | + 'KuberoAddonMemcached.metadata.name': { |
| 28 | + type: 'text', |
| 29 | + label: 'Memcached Instance Name', |
| 30 | + name: 'metadata.name', |
| 31 | + required: true, |
| 32 | + default: 'kuberoaddonmemcached-sample', |
| 33 | + description: 'The name of the Memcached instance', |
| 34 | + }, |
| 35 | + 'KuberoAddonMemcached.spec.memcached.image.tag': { |
| 36 | + type: 'combobox', |
| 37 | + label: 'Version/Tag', |
| 38 | + options: ['1.6.39'], // TODO - load this dynamically |
| 39 | + name: 'spec.memcached.image.tag', |
| 40 | + required: true, |
| 41 | + default: '1.6.39', |
| 42 | + description: 'Version of the Memcached image to use', |
| 43 | + }, |
| 44 | + 'KuberoAddonMemcached.spec.memcached.replicaCount': { |
| 45 | + type: 'number', |
| 46 | + label: 'Replica Count', |
| 47 | + name: 'spec.memcached.replicaCount', |
| 48 | + required: true, |
| 49 | + default: 1, |
| 50 | + description: 'Number of Memcached replicas', |
| 51 | + }, |
| 52 | + 'KuberoAddonMemcached.spec.memcached.config.memoryLimit': { |
| 53 | + type: 'number', |
| 54 | + label: 'Memory Limit (MB)', |
| 55 | + name: 'spec.memcached.config.memoryLimit', |
| 56 | + required: true, |
| 57 | + default: 64, |
| 58 | + description: 'Memory limit for Memcached in MB', |
| 59 | + }, |
| 60 | + 'KuberoAddonMemcached.spec.memcached.config.maxConnections': { |
| 61 | + type: 'number', |
| 62 | + label: 'Max Connections', |
| 63 | + name: 'spec.memcached.config.maxConnections', |
| 64 | + required: true, |
| 65 | + default: 1024, |
| 66 | + description: 'Maximum number of connections', |
| 67 | + }, |
| 68 | + }; |
| 69 | + |
| 70 | + public env: any[] = []; |
| 71 | + |
| 72 | + public resourceDefinitions: object = { |
| 73 | + KuberoAddonMemcached: { |
| 74 | + apiVersion: "application.kubero.dev/v1alpha1", |
| 75 | + kind: "KuberoAddonMemcached", |
| 76 | + metadata: { |
| 77 | + name: "kuberoaddonmemcached-sample" |
| 78 | + }, |
| 79 | + spec: { |
| 80 | + memcached: { |
| 81 | + image: { |
| 82 | + tag: "1.6.39" |
| 83 | + }, |
| 84 | + replicaCount: 1, |
| 85 | + config: { |
| 86 | + memoryLimit: 64, |
| 87 | + maxConnections: 1024, |
| 88 | + extraArgs: [], |
| 89 | + verbosity: 0 |
| 90 | + }, |
| 91 | + resources: {} |
| 92 | + } |
| 93 | + } |
| 94 | + } |
| 95 | + }; |
| 96 | + |
| 97 | + protected additionalResourceDefinitions: object = {}; |
| 98 | + |
| 99 | + constructor(availableOperators: any) { |
| 100 | + super(); |
| 101 | + super.init(availableOperators); |
| 102 | + } |
| 103 | +} |
0 commit comments