diff --git a/deploy/1-create-operator.yaml b/deploy/1-create-operator.yaml index 305ca9513..31554d242 100644 --- a/deploy/1-create-operator.yaml +++ b/deploy/1-create-operator.yaml @@ -65,6 +65,8 @@ rules: - swifts - memcacheds - fernetkeymanagers + - contrailmonitors + - contrailstatusmonitors verbs: - '*' - apiGroups: @@ -179,7 +181,7 @@ spec: listKind: CassandraList plural: cassandras singular: cassandra - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -365,7 +367,7 @@ spec: listKind: CommandList plural: commands singular: command - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -528,7 +530,7 @@ spec: listKind: ConfigList plural: configs singular: config - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -757,6 +759,228 @@ spec: --- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition +metadata: + name: contrailmonitors.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Contrailmonitor + listKind: ContrailmonitorList + plural: contrailmonitors + singular: contrailmonitor + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: Contrailmonitor is the Schema for the contrailmonitors 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: ContrailmonitorSpec defines the desired state of Contrailmonitor + properties: + serviceConfiguration: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "operator-sdk generate k8s" to regenerate code after + modifying this file Add custom validation using kubebuilder tags: + https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + cassandraInstance: + type: string + commandInstance: + type: string + configInstance: + type: string + controlInstance: + type: string + keystoneInstance: + type: string + memcachedInstance: + type: string + postgresInstance: + type: string + provisionmanagerInstance: + type: string + rabbitmqInstance: + type: string + webuiInstance: + type: string + zookeeperInstance: + type: string + type: object + required: + - serviceConfiguration + type: object + status: + description: ContrailmonitorStatus defines the observed state of Contrailmonitor + properties: + active: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "operator-sdk generate k8s" to regenerate + code after modifying this file Add custom validation using kubebuilder + tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + cassandras: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + config: + items: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + keystone: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + memcached: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + postgres: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + provisionManager: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + rabbitmq: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + statusname: + type: string + webui: + items: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + zookeepers: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: contrailstatusmonitors.contrail.juniper.net +spec: + additionalPrinterColumns: + - JSONPath: .status + description: Number of instances in group + name: Status + type: string + group: contrail.juniper.net + names: + kind: Contrailstatusmonitor + listKind: ContrailstatusmonitorList + plural: contrailstatusmonitors + singular: contrailstatusmonitor + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: Contrailstatusmonitor is the Schema for the contrailstatusmonitors + 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 + status: + type: string + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition metadata: name: controls.contrail.juniper.net spec: @@ -766,7 +990,7 @@ spec: listKind: ControlList plural: controls singular: control - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -1044,7 +1268,7 @@ spec: listKind: KeystoneList plural: keystones singular: keystone - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -1199,7 +1423,7 @@ spec: listKind: KubemanagerList plural: kubemanagers singular: kubemanager - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -1394,7 +1618,7 @@ spec: listKind: ManagerList plural: managers singular: manager - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -2066,6 +2290,177 @@ spec: type: object type: object type: object + contrailmonitor: + description: Contrailmonitor is the Schema for the contrailmonitors + 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: ContrailmonitorSpec defines the desired state of + Contrailmonitor + properties: + serviceConfiguration: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state + of cluster Important: Run "operator-sdk generate k8s" + to regenerate code after modifying this file Add custom + validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + cassandraInstance: + type: string + commandInstance: + type: string + configInstance: + type: string + controlInstance: + type: string + keystoneInstance: + type: string + memcachedInstance: + type: string + postgresInstance: + type: string + provisionmanagerInstance: + type: string + rabbitmqInstance: + type: string + webuiInstance: + type: string + zookeeperInstance: + type: string + type: object + required: + - serviceConfiguration + type: object + status: + description: ContrailmonitorStatus defines the observed state + of Contrailmonitor + properties: + active: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "operator-sdk generate + k8s" to regenerate code after modifying this file Add + custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + cassandras: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + config: + items: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + keystone: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + memcached: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + postgres: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + provisionManager: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + rabbitmq: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + statusname: + type: string + webui: + items: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + zookeepers: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: object + type: object controls: items: description: Control is the Schema for the controls API. @@ -3962,6 +4357,17 @@ spec: name: type: string type: object + contrailmonitor: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object controls: items: description: ServiceStatus provides information on the current status @@ -4297,7 +4703,7 @@ spec: listKind: PostgresList plural: postgres singular: postgres - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -4552,7 +4958,7 @@ spec: listKind: RabbitmqList plural: rabbitmqs singular: rabbitmq - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -4741,7 +5147,7 @@ spec: listKind: SwiftProxyList plural: swiftproxies singular: swiftproxy - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -4908,7 +5314,7 @@ spec: listKind: SwiftList plural: swifts singular: swift - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -5140,7 +5546,7 @@ spec: listKind: SwiftStorageList plural: swiftstorages singular: swiftstorage - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -5310,7 +5716,7 @@ spec: listKind: VrouterList plural: vrouters singular: vrouter - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -5510,7 +5916,7 @@ spec: listKind: WebuiList plural: webuis singular: webui - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -5684,7 +6090,7 @@ spec: listKind: ZookeeperList plural: zookeepers singular: zookeeper - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_cassandras_crd.yaml b/deploy/crds/contrail.juniper.net_cassandras_crd.yaml index 7005a8609..1f9bb227c 100644 --- a/deploy/crds/contrail.juniper.net_cassandras_crd.yaml +++ b/deploy/crds/contrail.juniper.net_cassandras_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: CassandraList plural: cassandras singular: cassandra - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_commands_crd.yaml b/deploy/crds/contrail.juniper.net_commands_crd.yaml index d7c98f460..5c5798f1a 100644 --- a/deploy/crds/contrail.juniper.net_commands_crd.yaml +++ b/deploy/crds/contrail.juniper.net_commands_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: CommandList plural: commands singular: command - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_configs_crd.yaml b/deploy/crds/contrail.juniper.net_configs_crd.yaml index 62714b05a..53de73122 100644 --- a/deploy/crds/contrail.juniper.net_configs_crd.yaml +++ b/deploy/crds/contrail.juniper.net_configs_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: ConfigList plural: configs singular: config - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_contrailmonitors_crd.yaml b/deploy/crds/contrail.juniper.net_contrailmonitors_crd.yaml new file mode 100644 index 000000000..15b2af871 --- /dev/null +++ b/deploy/crds/contrail.juniper.net_contrailmonitors_crd.yaml @@ -0,0 +1,177 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: contrailmonitors.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Contrailmonitor + listKind: ContrailmonitorList + plural: contrailmonitors + singular: contrailmonitor + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: Contrailmonitor is the Schema for the contrailmonitors 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: ContrailmonitorSpec defines the desired state of Contrailmonitor + properties: + serviceConfiguration: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "operator-sdk generate k8s" to regenerate code after + modifying this file Add custom validation using kubebuilder tags: + https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + cassandraInstance: + type: string + commandInstance: + type: string + configInstance: + type: string + controlInstance: + type: string + keystoneInstance: + type: string + memcachedInstance: + type: string + postgresInstance: + type: string + provisionmanagerInstance: + type: string + rabbitmqInstance: + type: string + webuiInstance: + type: string + zookeeperInstance: + type: string + type: object + required: + - serviceConfiguration + type: object + status: + description: ContrailmonitorStatus defines the observed state of Contrailmonitor + properties: + active: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "operator-sdk generate k8s" to regenerate + code after modifying this file Add custom validation using kubebuilder + tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + cassandras: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + config: + items: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + keystone: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + memcached: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + postgres: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + provisionManager: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + rabbitmq: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + statusname: + type: string + webui: + items: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + zookeepers: + description: ModuleStatus defines the observed state of ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/deploy/crds/contrail.juniper.net_contrailstatusmonitors_crd.yaml b/deploy/crds/contrail.juniper.net_contrailstatusmonitors_crd.yaml new file mode 100644 index 000000000..823c8b875 --- /dev/null +++ b/deploy/crds/contrail.juniper.net_contrailstatusmonitors_crd.yaml @@ -0,0 +1,43 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: contrailstatusmonitors.contrail.juniper.net +spec: + additionalPrinterColumns: + - JSONPath: .status + description: Number of instances in group + name: Status + type: string + group: contrail.juniper.net + names: + kind: Contrailstatusmonitor + listKind: ContrailstatusmonitorList + plural: contrailstatusmonitors + singular: contrailstatusmonitor + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: Contrailstatusmonitor is the Schema for the contrailstatusmonitors + 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 + status: + type: string + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true diff --git a/deploy/crds/contrail.juniper.net_controls_crd.yaml b/deploy/crds/contrail.juniper.net_controls_crd.yaml index e83ba8616..60764a006 100644 --- a/deploy/crds/contrail.juniper.net_controls_crd.yaml +++ b/deploy/crds/contrail.juniper.net_controls_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: ControlList plural: controls singular: control - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_keystones_crd.yaml b/deploy/crds/contrail.juniper.net_keystones_crd.yaml index ffa93904d..09b641e48 100644 --- a/deploy/crds/contrail.juniper.net_keystones_crd.yaml +++ b/deploy/crds/contrail.juniper.net_keystones_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: KeystoneList plural: keystones singular: keystone - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_kubemanagers_crd.yaml b/deploy/crds/contrail.juniper.net_kubemanagers_crd.yaml index 6caec6770..4331f6ce6 100644 --- a/deploy/crds/contrail.juniper.net_kubemanagers_crd.yaml +++ b/deploy/crds/contrail.juniper.net_kubemanagers_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: KubemanagerList plural: kubemanagers singular: kubemanager - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_managers_crd.yaml b/deploy/crds/contrail.juniper.net_managers_crd.yaml index 6a90f0ee0..2b33c0f9f 100644 --- a/deploy/crds/contrail.juniper.net_managers_crd.yaml +++ b/deploy/crds/contrail.juniper.net_managers_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: ManagerList plural: managers singular: manager - scope: Namespaced + scope: "" subresources: status: {} validation: @@ -681,6 +681,177 @@ spec: type: object type: object type: object + contrailmonitor: + description: Contrailmonitor is the Schema for the contrailmonitors + 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: ContrailmonitorSpec defines the desired state of + Contrailmonitor + properties: + serviceConfiguration: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state + of cluster Important: Run "operator-sdk generate k8s" + to regenerate code after modifying this file Add custom + validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + cassandraInstance: + type: string + commandInstance: + type: string + configInstance: + type: string + controlInstance: + type: string + keystoneInstance: + type: string + memcachedInstance: + type: string + postgresInstance: + type: string + provisionmanagerInstance: + type: string + rabbitmqInstance: + type: string + webuiInstance: + type: string + zookeeperInstance: + type: string + type: object + required: + - serviceConfiguration + type: object + status: + description: ContrailmonitorStatus defines the observed state + of Contrailmonitor + properties: + active: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "operator-sdk generate + k8s" to regenerate code after modifying this file Add + custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + cassandras: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + config: + items: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + keystone: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + memcached: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + postgres: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + provisionManager: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + rabbitmq: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + statusname: + type: string + webui: + items: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: array + zookeepers: + description: ModuleStatus defines the observed state of + ConfigStatus + properties: + moduleName: + type: string + state: + type: string + required: + - state + type: object + type: object + type: object controls: items: description: Control is the Schema for the controls API. @@ -2577,6 +2748,17 @@ spec: name: type: string type: object + contrailmonitor: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object controls: items: description: ServiceStatus provides information on the current status diff --git a/deploy/crds/contrail.juniper.net_postgres_crd.yaml b/deploy/crds/contrail.juniper.net_postgres_crd.yaml index 40be47b11..c31a828fd 100644 --- a/deploy/crds/contrail.juniper.net_postgres_crd.yaml +++ b/deploy/crds/contrail.juniper.net_postgres_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: PostgresList plural: postgres singular: postgres - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_rabbitmqs_crd.yaml b/deploy/crds/contrail.juniper.net_rabbitmqs_crd.yaml index 5ec6fa419..d9be8f45b 100644 --- a/deploy/crds/contrail.juniper.net_rabbitmqs_crd.yaml +++ b/deploy/crds/contrail.juniper.net_rabbitmqs_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: RabbitmqList plural: rabbitmqs singular: rabbitmq - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_swiftproxies_crd.yaml b/deploy/crds/contrail.juniper.net_swiftproxies_crd.yaml index 2d1ac3ad7..e5a66458f 100644 --- a/deploy/crds/contrail.juniper.net_swiftproxies_crd.yaml +++ b/deploy/crds/contrail.juniper.net_swiftproxies_crd.yaml @@ -25,7 +25,7 @@ spec: listKind: SwiftProxyList plural: swiftproxies singular: swiftproxy - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_swifts_crd.yaml b/deploy/crds/contrail.juniper.net_swifts_crd.yaml index 4b395cb54..df007871f 100644 --- a/deploy/crds/contrail.juniper.net_swifts_crd.yaml +++ b/deploy/crds/contrail.juniper.net_swifts_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: SwiftList plural: swifts singular: swift - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_swiftstorages_crd.yaml b/deploy/crds/contrail.juniper.net_swiftstorages_crd.yaml index c1cf85b83..e73d5c2ff 100644 --- a/deploy/crds/contrail.juniper.net_swiftstorages_crd.yaml +++ b/deploy/crds/contrail.juniper.net_swiftstorages_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: SwiftStorageList plural: swiftstorages singular: swiftstorage - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_v1alpha1_contrailmonitor_cr.yaml b/deploy/crds/contrail.juniper.net_v1alpha1_contrailmonitor_cr.yaml new file mode 100644 index 000000000..d7fe060f3 --- /dev/null +++ b/deploy/crds/contrail.juniper.net_v1alpha1_contrailmonitor_cr.yaml @@ -0,0 +1,7 @@ +apiVersion: contrail.juniper.net/v1alpha1 +kind: Contrailmonitor +metadata: + name: example-contrailmonitor +spec: + # Add fields here + size: 3 diff --git a/deploy/crds/contrail.juniper.net_v1alpha1_contrailstatusmonitor_cr.yaml b/deploy/crds/contrail.juniper.net_v1alpha1_contrailstatusmonitor_cr.yaml new file mode 100644 index 000000000..3649ff89c --- /dev/null +++ b/deploy/crds/contrail.juniper.net_v1alpha1_contrailstatusmonitor_cr.yaml @@ -0,0 +1,11 @@ +apiVersion: contrail.juniper.net/v1alpha1 +kind: Contrailstatusmonitor +metadata: + name: cassandra1 +status: functional +--- +apiVersion: contrail.juniper.net/v1alpha1 +kind: Contrailstatusmonitor +metadata: + name: zookeeper1 +status: non-functional diff --git a/deploy/crds/contrail.juniper.net_vrouters_crd.yaml b/deploy/crds/contrail.juniper.net_vrouters_crd.yaml index 628630753..0d94074f9 100644 --- a/deploy/crds/contrail.juniper.net_vrouters_crd.yaml +++ b/deploy/crds/contrail.juniper.net_vrouters_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: VrouterList plural: vrouters singular: vrouter - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_webuis_crd.yaml b/deploy/crds/contrail.juniper.net_webuis_crd.yaml index 975647126..2741954fd 100644 --- a/deploy/crds/contrail.juniper.net_webuis_crd.yaml +++ b/deploy/crds/contrail.juniper.net_webuis_crd.yaml @@ -22,7 +22,7 @@ spec: listKind: WebuiList plural: webuis singular: webui - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/crds/contrail.juniper.net_zookeepers_crd.yaml b/deploy/crds/contrail.juniper.net_zookeepers_crd.yaml index 0775532db..b79517f27 100644 --- a/deploy/crds/contrail.juniper.net_zookeepers_crd.yaml +++ b/deploy/crds/contrail.juniper.net_zookeepers_crd.yaml @@ -9,7 +9,7 @@ spec: listKind: ZookeeperList plural: zookeepers singular: zookeeper - scope: Namespaced + scope: "" subresources: status: {} validation: diff --git a/deploy/role.yaml b/deploy/role.yaml index 0975cb375..bc3e363da 100644 --- a/deploy/role.yaml +++ b/deploy/role.yaml @@ -60,6 +60,8 @@ rules: - swifts - memcacheds - fernetkeymanagers + - contrailmonitors + - contrailstatusmonitors verbs: - '*' - apiGroups: diff --git a/pkg/apis/contrail/v1alpha1/BUILD.bazel b/pkg/apis/contrail/v1alpha1/BUILD.bazel index 27aba58b5..9cea2fc3f 100644 --- a/pkg/apis/contrail/v1alpha1/BUILD.bazel +++ b/pkg/apis/contrail/v1alpha1/BUILD.bazel @@ -8,6 +8,8 @@ go_library( "command_types.go", "config_types.go", "control_types.go", + "contrailmonitor_types.go", + "contrailstatusmonitor_types.go", "defaults.go", "doc.go", "exec_to_pod.go", diff --git a/pkg/apis/contrail/v1alpha1/contrailmonitor_types.go b/pkg/apis/contrail/v1alpha1/contrailmonitor_types.go new file mode 100644 index 000000000..51f861626 --- /dev/null +++ b/pkg/apis/contrail/v1alpha1/contrailmonitor_types.go @@ -0,0 +1,83 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// ContrailmonitorSpec defines the desired state of Contrailmonitor +type ContrailmonitorSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html + ServiceConfiguration ContrailmonitorConfiguration `json:"serviceConfiguration"` +} + +// ContrailmonitorConfiguration is the Spec for the ContrailMonitorStatus API. +// +k8s:openapi-gen=true +type ContrailmonitorConfiguration struct { + MemcachedInstance string `json:"memcachedInstance,omitempty"` + PostgresInstance string `json:"postgresInstance,omitempty"` + CassandraInstance string `json:"cassandraInstance,omitempty"` + KeystoneInstance string `json:"keystoneInstance,omitempty"` + ConfigInstance string `json:"configInstance,omitempty"` + ZookeeperInstance string `json:"zookeeperInstance,omitempty"` + RabbitmqInstance string `json:"rabbitmqInstance,omitempty"` + ProvisionmanagerInstance string `json:"provisionmanagerInstance,omitempty"` + CommandInstance string `json:"commandInstance,omitempty"` + ControlInstance string `json:"controlInstance,omitempty"` + WebuiInstance string `json:"webuiInstance,omitempty"` +} + +// ContrailmonitorStatus defines the observed state of Contrailmonitor +type ContrailmonitorStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html + Active bool `json:"active,omitempty"` + Statusname string `json:"statusname,omitempty"` + Postgres *ModuleStatus `json:"postgres,omitempty"` + Config []*ModuleStatus `json:"config,omitempty"` + Webui []*ModuleStatus `json:"webui,omitempty"` + Cassandras *ModuleStatus `json:"cassandras,omitempty"` + Zookeepers *ModuleStatus `json:"zookeepers,omitempty"` + Rabbitmq *ModuleStatus `json:"rabbitmq,omitempty"` + ProvisionManager *ModuleStatus `json:"provisionManager,omitempty"` + Keystone *ModuleStatus `json:"keystone,omitempty"` + Memcached *ModuleStatus `json:"memcached,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Contrailmonitor is the Schema for the contrailmonitors API +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=contrailmonitors,scope=Namespaced +type Contrailmonitor struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ContrailmonitorSpec `json:"spec,omitempty"` + Status ContrailmonitorStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ContrailmonitorList contains a list of Contrailmonitor +type ContrailmonitorList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Contrailmonitor `json:"items"` +} + +// ModuleStatus defines the observed state of ConfigStatus +// +k8s:openapi-gen=true +type ModuleStatus struct { + ModuleName string `json:"moduleName,omitempty"` + ModuleState string `json:"state"` +} + +func init() { + SchemeBuilder.Register(&Contrailmonitor{}, &ContrailmonitorList{}) +} diff --git a/pkg/apis/contrail/v1alpha1/contrailstatusmonitor_types.go b/pkg/apis/contrail/v1alpha1/contrailstatusmonitor_types.go new file mode 100644 index 000000000..2f0c3f018 --- /dev/null +++ b/pkg/apis/contrail/v1alpha1/contrailstatusmonitor_types.go @@ -0,0 +1,30 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Contrailstatusmonitor is the Schema for the contrailstatusmonitors API +// +kubebuilder:resource:path=contrailstatusmonitors,scope=Namespaced +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status",description="Number of instances in group" +type Contrailstatusmonitor struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Status string `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ContrailstatusmonitorList contains a list of Contrailstatusmonitor +type ContrailstatusmonitorList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Contrailstatusmonitor `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Contrailstatusmonitor{}, &ContrailstatusmonitorList{}) +} diff --git a/pkg/apis/contrail/v1alpha1/manager_types.go b/pkg/apis/contrail/v1alpha1/manager_types.go index 12e47fa82..944b2f7dd 100644 --- a/pkg/apis/contrail/v1alpha1/manager_types.go +++ b/pkg/apis/contrail/v1alpha1/manager_types.go @@ -37,6 +37,7 @@ type Services struct { Keystone *Keystone `json:"keystone,omitempty"` Swift *Swift `json:"swift,omitempty"` Memcached *Memcached `json:"memcached,omitempty"` + Contrailmonitor *Contrailmonitor `json:"contrailmonitor,omitempty"` } // ManagerStatus defines the observed state of Manager. @@ -60,6 +61,7 @@ type ManagerStatus struct { Swift *ServiceStatus `json:"swift,omitempty"` Command *ServiceStatus `json:"command,omitempty"` Memcached *ServiceStatus `json:"memcached,omitempty"` + Contrailmonitor *ServiceStatus `json:"contrailmonitor,omitempty"` // +optional // +patchMergeKey=type // +patchStrategy=merge diff --git a/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go index 74b9d95fa..a48676107 100644 --- a/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go @@ -858,6 +858,232 @@ func (in *Container) DeepCopy() *Container { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Contrailmonitor) DeepCopyInto(out *Contrailmonitor) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Contrailmonitor. +func (in *Contrailmonitor) DeepCopy() *Contrailmonitor { + if in == nil { + return nil + } + out := new(Contrailmonitor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Contrailmonitor) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContrailmonitorConfiguration) DeepCopyInto(out *ContrailmonitorConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContrailmonitorConfiguration. +func (in *ContrailmonitorConfiguration) DeepCopy() *ContrailmonitorConfiguration { + if in == nil { + return nil + } + out := new(ContrailmonitorConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContrailmonitorList) DeepCopyInto(out *ContrailmonitorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Contrailmonitor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContrailmonitorList. +func (in *ContrailmonitorList) DeepCopy() *ContrailmonitorList { + if in == nil { + return nil + } + out := new(ContrailmonitorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ContrailmonitorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContrailmonitorSpec) DeepCopyInto(out *ContrailmonitorSpec) { + *out = *in + out.ServiceConfiguration = in.ServiceConfiguration + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContrailmonitorSpec. +func (in *ContrailmonitorSpec) DeepCopy() *ContrailmonitorSpec { + if in == nil { + return nil + } + out := new(ContrailmonitorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContrailmonitorStatus) DeepCopyInto(out *ContrailmonitorStatus) { + *out = *in + if in.Postgres != nil { + in, out := &in.Postgres, &out.Postgres + *out = new(ModuleStatus) + **out = **in + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]*ModuleStatus, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(ModuleStatus) + **out = **in + } + } + } + if in.Webui != nil { + in, out := &in.Webui, &out.Webui + *out = make([]*ModuleStatus, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(ModuleStatus) + **out = **in + } + } + } + if in.Cassandras != nil { + in, out := &in.Cassandras, &out.Cassandras + *out = new(ModuleStatus) + **out = **in + } + if in.Zookeepers != nil { + in, out := &in.Zookeepers, &out.Zookeepers + *out = new(ModuleStatus) + **out = **in + } + if in.Rabbitmq != nil { + in, out := &in.Rabbitmq, &out.Rabbitmq + *out = new(ModuleStatus) + **out = **in + } + if in.ProvisionManager != nil { + in, out := &in.ProvisionManager, &out.ProvisionManager + *out = new(ModuleStatus) + **out = **in + } + if in.Keystone != nil { + in, out := &in.Keystone, &out.Keystone + *out = new(ModuleStatus) + **out = **in + } + if in.Memcached != nil { + in, out := &in.Memcached, &out.Memcached + *out = new(ModuleStatus) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContrailmonitorStatus. +func (in *ContrailmonitorStatus) DeepCopy() *ContrailmonitorStatus { + if in == nil { + return nil + } + out := new(ContrailmonitorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Contrailstatusmonitor) DeepCopyInto(out *Contrailstatusmonitor) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Contrailstatusmonitor. +func (in *Contrailstatusmonitor) DeepCopy() *Contrailstatusmonitor { + if in == nil { + return nil + } + out := new(Contrailstatusmonitor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Contrailstatusmonitor) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContrailstatusmonitorList) DeepCopyInto(out *ContrailstatusmonitorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Contrailstatusmonitor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContrailstatusmonitorList. +func (in *ContrailstatusmonitorList) DeepCopy() *ContrailstatusmonitorList { + if in == nil { + return nil + } + out := new(ContrailstatusmonitorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ContrailstatusmonitorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Control) DeepCopyInto(out *Control) { *out = *in @@ -1795,6 +2021,11 @@ func (in *ManagerStatus) DeepCopyInto(out *ManagerStatus) { *out = new(ServiceStatus) (*in).DeepCopyInto(*out) } + if in.Contrailmonitor != nil { + in, out := &in.Contrailmonitor, &out.Contrailmonitor + *out = new(ServiceStatus) + (*in).DeepCopyInto(*out) + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]ManagerCondition, len(*in)) @@ -1936,6 +2167,22 @@ func (in *MemcachedStatus) DeepCopy() *MemcachedStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ModuleStatus) DeepCopyInto(out *ModuleStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModuleStatus. +func (in *ModuleStatus) DeepCopy() *ModuleStatus { + if in == nil { + return nil + } + out := new(ModuleStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MonitorConfig) DeepCopyInto(out *MonitorConfig) { *out = *in @@ -2557,6 +2804,11 @@ func (in *Services) DeepCopyInto(out *Services) { *out = new(Memcached) (*in).DeepCopyInto(*out) } + if in.Contrailmonitor != nil { + in, out := &in.Contrailmonitor, &out.Contrailmonitor + *out = new(Contrailmonitor) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/controller/add_contrailmonitor.go b/pkg/controller/add_contrailmonitor.go new file mode 100644 index 000000000..d0e0ac45c --- /dev/null +++ b/pkg/controller/add_contrailmonitor.go @@ -0,0 +1,10 @@ +package controller + +import ( + "github.com/Juniper/contrail-operator/pkg/controller/contrailmonitor" +) + +func init() { + // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. + AddToManagerFuncs = append(AddToManagerFuncs, contrailmonitor.Add) +} diff --git a/pkg/controller/contrailmonitor/BUILD.bazel b/pkg/controller/contrailmonitor/BUILD.bazel new file mode 100644 index 000000000..55f746cc5 --- /dev/null +++ b/pkg/controller/contrailmonitor/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["contrailmonitor_controller.go"], + importpath = "github.com/Juniper/contrail-operator/pkg/controller/contrailmonitor", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/contrail/v1alpha1:go_default_library", + "//pkg/k8s:go_default_library", + "@io_k8s_api//core/v1:go_default_library", + "@io_k8s_apimachinery//pkg/api/errors:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/controller/controllerutil:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/handler:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", + # "@io_k8s_apimachinery//pkg/labels:go_default_library", + "@io_k8s_apimachinery//pkg/runtime:go_default_library", + "@io_k8s_apimachinery//pkg/types:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/client:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/controller:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/log:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/reconcile:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/source:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/manager:go_default_library", + ], +) diff --git a/pkg/controller/contrailmonitor/contrailmonitor_controller.go b/pkg/controller/contrailmonitor/contrailmonitor_controller.go new file mode 100644 index 000000000..e3ac858c4 --- /dev/null +++ b/pkg/controller/contrailmonitor/contrailmonitor_controller.go @@ -0,0 +1,472 @@ +package contrailmonitor + +import ( + "context" + "fmt" + + contrailv1alpha1 "github.com/Juniper/contrail-operator/pkg/apis/contrail/v1alpha1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + logf "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/source" + + "github.com/Juniper/contrail-operator/pkg/k8s" +) + +var log = logf.Log.WithName("controller_contrailmonitor") + +// Add creates a new Contrailmonitor Controller and adds it to the Manager. The Manager will set fields on the Controller +// and Start it when the Manager is Started. +func Add(mgr manager.Manager) error { + return add(mgr, newReconciler(mgr)) +} + +// newReconciler returns a new reconcile.Reconciler +func newReconciler(mgr manager.Manager) reconcile.Reconciler { + return &ReconcileContrailmonitor{client: mgr.GetClient(), + scheme: mgr.GetScheme(), kubernetes: k8s.New(mgr.GetClient(), mgr.GetScheme())} +} + +// add adds a new Controller to mgr with r as the reconcile.Reconciler +func add(mgr manager.Manager, r reconcile.Reconciler) error { + // Create a new controller + c, err := controller.New("contrailmonitor-controller", mgr, controller.Options{Reconciler: r}) + if err != nil { + return err + } + + // Watch for changes to primary resource Contrailmonitor + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Contrailmonitor{}}, &handler.EnqueueRequestForObject{}) + if err != nil { + return err + } + + // TODO(user): Modify this to be the types you create that are owned by the primary resource + // Watch for changes to secondary resource Pods and requeue the owner Contrailmonitor + err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{ + IsController: true, + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Postgres{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Memcached{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Cassandra{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Control{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Config{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Keystone{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Zookeeper{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.ProvisionManager{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + err = c.Watch(&source.Kind{Type: &contrailv1alpha1.Webui{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &contrailv1alpha1.Contrailmonitor{}, + }) + if err != nil { + return err + } + + return nil +} + +// blank assignment to verify that ReconcileContrailmonitor implements reconcile.Reconciler +var _ reconcile.Reconciler = &ReconcileContrailmonitor{} + +// ReconcileContrailmonitor reconciles a Contrailmonitor object +type ReconcileContrailmonitor struct { + // This client, initialized using mgr.Client() above, is a split client + // that reads objects from the cache and writes to the apiserver + client client.Client + scheme *runtime.Scheme + kubernetes *k8s.Kubernetes +} + +// Reconcile reads that state of the cluster for a Contrailmonitor object and makes changes based on the state read +// and what is in the Contrailmonitor.Spec +// TODO(user): Modify this Reconcile function to implement your Controller logic. This example creates +// a Pod as an example +// Note: +// The Controller will requeue the Request to be processed again if the returned error is non-nil or +// Result.Requeue is true, otherwise upon completion it will remove the work from the queue. +func (r *ReconcileContrailmonitor) Reconcile(request reconcile.Request) (reconcile.Result, error) { + reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) + reqLogger.Info("Reconciling Contrailmonitor") + + // Fetch the Contrailmonitor instance + instance := &contrailv1alpha1.Contrailmonitor{} + err := r.client.Get(context.TODO(), request.NamespacedName, instance) + if err != nil { + if errors.IsNotFound(err) { + return reconcile.Result{}, nil + } + // Error reading the object - requeue the request. + return reconcile.Result{}, err + } + err = r.client.Update(context.TODO(), instance) + if err != nil { + return reconcile.Result{}, err + } + if !instance.GetDeletionTimestamp().IsZero() { + return reconcile.Result{}, nil + } + + if err = r.getPostgres(instance); err != nil { + return reconcile.Result{}, err + } + if err = r.getMemcached(instance); err != nil { + return reconcile.Result{}, err + } + if err = r.getZookeeper(instance); err != nil { + return reconcile.Result{}, err + } + if err = r.getRabbitmq(instance); err != nil { + return reconcile.Result{}, err + } + if err = r.getCassandra(instance); err != nil { + return reconcile.Result{}, err + } + if err = r.getKeystone(instance); err != nil { + return reconcile.Result{}, err + } + if err = r.getProvisionmanager(instance); err != nil { + return reconcile.Result{}, err + } + // if err = r.getConfig(instance); err != nil { + // return reconcile.Result{}, err + // } + if err = r.getWebui(instance); err != nil { + return reconcile.Result{}, err + } + // configInstance, err := r.getConfigCheck(instance) + // return reconcile.Result{}, nil + // configActive = configInstance.IsActive(configInstance.Labels["contrail_cluster"], request.Namespace, r.client) + // if !configActive{ + // return reconcile.Result{}, nil + // }else{ + // err = r.getConfig(instance) + // } + + return reconcile.Result{}, nil +} + +func (r *ReconcileContrailmonitor) getPostgres(cr *contrailv1alpha1.Contrailmonitor) error { + psql := &contrailv1alpha1.Postgres{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.PostgresInstance} + err := r.client.Get(context.Background(), name, psql) + if err = r.kubernetes.Owner(cr).EnsureOwns(psql); err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: psql.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + if psql.Status.Active { + serIns.Status = "Active" + } else { + serIns.Status = "NotActive" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getMemcached(cr *contrailv1alpha1.Contrailmonitor) error { + memcached := &contrailv1alpha1.Memcached{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.MemcachedInstance} + err := r.client.Get(context.Background(), name, memcached) + if err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: memcached.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + if memcached.Status.Active { + serIns.Status = "Active" + } else { + serIns.Status = "NotActive" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getZookeeper(cr *contrailv1alpha1.Contrailmonitor) error { + zookeeper := &contrailv1alpha1.Zookeeper{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.ZookeeperInstance} + err := r.client.Get(context.Background(), name, zookeeper) + if err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: zookeeper.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + + if zookeeper.Status.Active == nil{ + // if *zookeeper.Status.Active{ + serIns.Status = "NotActive" + } else { + serIns.Status = "Active" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getRabbitmq(cr *contrailv1alpha1.Contrailmonitor) error { + + rabbitmq := &contrailv1alpha1.Rabbitmq{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.RabbitmqInstance} + err := r.client.Get(context.Background(), name, rabbitmq) + if err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: rabbitmq.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + if rabbitmq.Status.Active == nil { + // if *rabbitmq.Status.Active{ + serIns.Status = "NotActive" + } else { + serIns.Status = "Active" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getCassandra(cr *contrailv1alpha1.Contrailmonitor) error { + + cassandra := &contrailv1alpha1.Cassandra{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.CassandraInstance} + err := r.client.Get(context.Background(), name, cassandra) + if err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: cassandra.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + if cassandra.Status.Active == nil{ + // if *cassandra.Status.Active{ + serIns.Status = "Active" + } else { + serIns.Status = "NotActive" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getProvisionmanager(cr *contrailv1alpha1.Contrailmonitor) error { + + provisionmanager := &contrailv1alpha1.ProvisionManager{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.ProvisionmanagerInstance} + err := r.client.Get(context.Background(), name, provisionmanager) + if err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: provisionmanager.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + if provisionmanager.Status.Active == nil{ + // if *provisionmanager.Status.Active{ + serIns.Status = "NotActive" + } else { + serIns.Status = "Active" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getKeystone(cr *contrailv1alpha1.Contrailmonitor) error { + + keystone := &contrailv1alpha1.Keystone{} + name := types.NamespacedName{Namespace: cr.Namespace, + Name: cr.Spec.ServiceConfiguration.KeystoneInstance} + err := r.client.Get(context.Background(), name, keystone) + if err != nil { + return err + } + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: keystone.Name, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + if keystone.Status.Active { + serIns.Status = "Active" + } else { + serIns.Status = "NotActive" + } + _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + return nil +} + +func (r *ReconcileContrailmonitor) getConfig(cr *contrailv1alpha1.Contrailmonitor) error { + listOps := &client.ListOptions{Namespace: "contrail"} + mlist := &contrailv1alpha1.ConfigList{} + if err := r.client.List(context.TODO(), mlist, listOps); err != nil { + return err + } + for i := 0; i < len(mlist.Items); i++ { + for _, value := range mlist.Items[i].Status.ServiceStatus { + for m, n := range value { + fmt.Println(m, "::", n.ModuleName, "::", n.ModuleState) + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: n.ModuleName, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + serIns.Status = n.ModuleState + _, err := controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + } + } + } + return nil +} + +func (r *ReconcileContrailmonitor) getCommand(cr *contrailv1alpha1.Contrailmonitor) (*contrailv1alpha1.Command, error) { + + key := &contrailv1alpha1.Command{} + name := types.NamespacedName{Namespace: cr.Namespace, Name: cr.Spec.ServiceConfiguration.CommandInstance} + err := r.client.Get(context.Background(), name, key) + return key, err +} + + +func (r *ReconcileContrailmonitor) getWebui(cr *contrailv1alpha1.Contrailmonitor) error { + listOps := &client.ListOptions{Namespace: "contrail"} + mlist := &contrailv1alpha1.WebuiList{} + if err := r.client.List(context.TODO(), mlist, listOps); err != nil { + return err + } + for i := 0; i < len(mlist.Items); i++ { + for _, value := range mlist.Items[i].Status.ServiceStatus { + for m, n := range value { + fmt.Println(m, "::", n.ModuleName, "::", n.ModuleState) + serIns := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: n.ModuleName, Namespace: "contrail"}} + if err := controllerutil.SetControllerReference(cr, serIns, r.scheme); err != nil { + return err + } + serIns.Status = n.ModuleState + _, err := controllerutil.CreateOrUpdate(context.Background(), r.client, serIns, func() error { + return controllerutil.SetControllerReference(cr, serIns, r.scheme) + }) + if err != nil { + return err + } + } + } + } + return nil +} + +// func (r *ReconcileContrailmonitor) listReconcilePods(app string) (*corev1.PodList, error) { +// pods := &corev1.PodList{} +// labelSelector := labels.SelectorFromSet(map[string]string{"app": app}) +// listOpts := client.ListOptions{LabelSelector: labelSelector} +// if err := r.client.List(context.TODO(), pods, &listOpts); err != nil { +// return &corev1.PodList{}, err +// } +// return pods, nil +// } + + +func (r *ReconcileContrailmonitor) getConfigCheck(cr *contrailv1alpha1.Contrailmonitor) (*contrailv1alpha1.Config, error) { + key := &contrailv1alpha1.Config{} + name := types.NamespacedName{Namespace: cr.Namespace, Name: cr.Spec.ServiceConfiguration.ConfigInstance} + err := r.client.Get(context.Background(), name, key) + return key, err +} diff --git a/pkg/controller/manager/manager_controller.go b/pkg/controller/manager/manager_controller.go index a03598661..8a645166b 100644 --- a/pkg/controller/manager/manager_controller.go +++ b/pkg/controller/manager/manager_controller.go @@ -43,6 +43,7 @@ var resourcesList = []runtime.Object{ &v1alpha1.Memcached{}, &v1alpha1.Vrouter{}, &v1alpha1.Kubemanager{}, + &v1alpha1.Contrailmonitor{}, &corev1.ConfigMap{}, } @@ -1506,6 +1507,9 @@ func (r *ReconcileManager) Reconcile(request reconcile.Request) (reconcile.Resul if err = r.processMemcached(instance); err != nil { return reconcile.Result{}, err } + if err = r.processContrailmonitor(instance); err != nil { + return reconcile.Result{}, err + } r.setConditions(instance) @@ -1644,3 +1648,21 @@ func (r *ReconcileManager) processCSRSignerCaConfigMap(manager *v1alpha1.Manager return err } + +func (r *ReconcileManager) processContrailmonitor(manager *v1alpha1.Manager) error { + if manager.Spec.Services.Contrailmonitor == nil { + return nil + } + contrailmonitor := &v1alpha1.Contrailmonitor{} + contrailmonitor.ObjectMeta = manager.Spec.Services.Contrailmonitor.ObjectMeta + contrailmonitor.ObjectMeta.Namespace = manager.Namespace + _, err := controllerutil.CreateOrUpdate(context.Background(), r.client, contrailmonitor, func() error { + contrailmonitor.Spec = manager.Spec.Services.Contrailmonitor.Spec + return controllerutil.SetControllerReference(manager, contrailmonitor, r.scheme) + }) + status := &v1alpha1.ServiceStatus{} + status.Active = &contrailmonitor.Status.Active + manager.Status.Contrailmonitor = status + return err +} + diff --git a/test/env/deploy/cluster.yaml b/test/env/deploy/cluster.yaml index 4d90d36c3..62d98cef0 100644 --- a/test/env/deploy/cluster.yaml +++ b/test/env/deploy/cluster.yaml @@ -35,7 +35,7 @@ spec: name: config1 spec: commonConfiguration: - create: true + create: false nodeSelector: node-role.kubernetes.io/master: "" serviceConfiguration: @@ -77,7 +77,7 @@ spec: name: control1 spec: commonConfiguration: - create: true + create: false nodeSelector: node-role.kubernetes.io/master: "" serviceConfiguration: @@ -181,9 +181,9 @@ spec: name: command spec: commonConfiguration: - activate: true - create: true - hostNetwork: true + activate: false + create: false + hostNetwork: false tolerations: - effect: NoSchedule operator: Exists @@ -248,60 +248,80 @@ spec: containers: - name: memcached image: "registry:5000/common-docker-third-party/contrail/centos-binary-memcached:train-2005" - swift: + # swift: + # metadata: + # name: swift + # spec: + # commonConfiguration: + # nodeSelector: + # node-role.kubernetes.io/master: "" + # serviceConfiguration: + # credentialsSecretName: "swift-credentials-secret" + # containers: + # - name: ringcontroller + # image: registry:5000/contrail-operator/engprod-269421/ringcontroller:master.latest + # swiftProxyConfiguration: + # memcachedInstance: "memcached" + # keystoneInstance: "keystone" + # listenPort: 5080 + # containers: + # - name: init + # image: registry:5000/common-docker-third-party/contrail/centos-binary-kolla-toolbox:train-2005 + # - name: wait-for-ready-conf + # image: registry:5000/common-docker-third-party/contrail/busybox:1.31 + # - name: api + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-proxy-server:train-2005 + # swiftStorageConfiguration: + # accountBindPort: 6001 + # containerBindPort: 6002 + # objectBindPort: 6000 + # device: d1 + # containers: + # - name: swiftStorageInit + # image: registry:5000/common-docker-third-party/contrail/busybox:1.31 + # - name: swiftObjectExpirer + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object-expirer:train-2005 + # - name: swiftObjectUpdater + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 + # - name: swiftObjectReplicator + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 + # - name: swiftObjectAuditor + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 + # - name: swiftObjectServer + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 + # - name: swiftContainerUpdater + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 + # - name: swiftContainerReplicator + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 + # - name: swiftContainerAuditor + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 + # - name: swiftContainerServer + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 + # - name: swiftAccountReaper + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 + # - name: swiftAccountReplicator + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 + # - name: swiftAccountAuditor + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 + # - name: swiftAccountServer + # image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 + contrailmonitor: metadata: - name: swift + labels: + contrail_cluster: cluster1 + name: contrailmonitor spec: - commonConfiguration: - nodeSelector: - node-role.kubernetes.io/master: "" serviceConfiguration: - credentialsSecretName: "swift-credentials-secret" - containers: - - name: ringcontroller - image: registry:5000/contrail-operator/engprod-269421/ringcontroller:master.latest - swiftProxyConfiguration: - memcachedInstance: "memcached" - keystoneInstance: "keystone" - listenPort: 5080 - containers: - - name: init - image: registry:5000/common-docker-third-party/contrail/centos-binary-kolla-toolbox:train-2005 - - name: wait-for-ready-conf - image: registry:5000/common-docker-third-party/contrail/busybox:1.31 - - name: api - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-proxy-server:train-2005 - swiftStorageConfiguration: - accountBindPort: 6001 - containerBindPort: 6002 - objectBindPort: 6000 - device: d1 - containers: - - name: swiftStorageInit - image: registry:5000/common-docker-third-party/contrail/busybox:1.31 - - name: swiftObjectExpirer - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object-expirer:train-2005 - - name: swiftObjectUpdater - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 - - name: swiftObjectReplicator - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 - - name: swiftObjectAuditor - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 - - name: swiftObjectServer - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-object:train-2005 - - name: swiftContainerUpdater - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 - - name: swiftContainerReplicator - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 - - name: swiftContainerAuditor - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 - - name: swiftContainerServer - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-container:train-2005 - - name: swiftAccountReaper - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 - - name: swiftAccountReplicator - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 - - name: swiftAccountAuditor - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 - - name: swiftAccountServer - image: registry:5000/common-docker-third-party/contrail/centos-binary-swift-account:train-2005 + memcachedInstance: "memcached" + postgresInstance: "postgres" + cassandraInstance: "cassandra1" + keystoneInstance: "keystone" + configInstance: "config1" + rabbitmqInstance: "rabbitmq1" + zookeeperInstance: "zookeeper1" + provisionmanagerInstance: "provmanager1" + commandInstance: "command" + controlInstance: "control1" + + +