From 00e95f4884cfa109efae1f670518049fb0a4e768 Mon Sep 17 00:00:00 2001 From: shoaebjindani <40020259+shoaebjindani@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:25:55 +0530 Subject: [PATCH] Removed FluentD References (#158) https://github.com/hyperledger-labs/fabric-operator/issues/100 --- api/v1beta1/common.go | 1 - api/v1beta1/ibppeer.go | 6 -- api/v1beta1/ibppeer_types.go | 12 ---- api/v1beta1/zz_generated.deepcopy.go | 5 -- ...source-operator.clusterserviceversion.yaml | 17 ----- bundle/manifests/ibp.com_ibpconsoles.yaml | 8 --- bundle/manifests/ibp.com_ibppeers.yaml | 33 --------- config/crd/bases/ibp.com_ibpconsoles.yaml | 8 --- config/crd/bases/ibp.com_ibppeers.yaml | 33 --------- ...source-operator.clusterserviceversion.yaml | 12 ---- definitions/console/deployer-configmap.yaml | 7 -- definitions/peer/deployment.yaml | 40 ----------- definitions/peer/fluentd-configmap.yaml | 32 --------- integration/helper/crspecs.go | 1 - integration/migration/fabric/peer_test.go | 2 - integration/migration/migration_test.go | 10 --- integration/operator.go | 1 - integration/peer/peer_test.go | 16 ----- main.go | 1 - pkg/apis/deployer/deployer.go | 12 ---- pkg/initializer/peer/initializer.go | 1 - .../base/console/override/deployercm_test.go | 26 ------- pkg/offering/base/peer/override/deployment.go | 23 ------ .../base/peer/override/deployment_test.go | 72 ++++--------------- pkg/offering/base/peer/peer.go | 36 ++++------ pkg/offering/base/peer/peer_test.go | 38 +++------- .../images/fabricversion_test.go | 6 -- .../reconcilechecks/images/images_test.go | 18 ----- .../k8s/console/override/deployercm_test.go | 4 -- pkg/offering/k8s/peer/peer_test.go | 30 +++----- .../console/override/deployercm_test.go | 4 -- pkg/offering/openshift/peer/peer.go | 10 --- pkg/offering/openshift/peer/peer_test.go | 28 ++++---- 33 files changed, 60 insertions(+), 493 deletions(-) delete mode 100644 definitions/peer/fluentd-configmap.yaml diff --git a/api/v1beta1/common.go b/api/v1beta1/common.go index 9478617d..418ab445 100644 --- a/api/v1beta1/common.go +++ b/api/v1beta1/common.go @@ -34,7 +34,6 @@ const ( ORDERER Component = "ORDERER" PEER Component = "PEER" GRPCPROXY Component = "GRPCPROXY" - FLUENTD Component = "FLUENTD" DIND Component = "DIND" COUCHDB Component = "COUCHDB" CCLAUNCHER Component = "CCLAUNCHER" diff --git a/api/v1beta1/ibppeer.go b/api/v1beta1/ibppeer.go index 350ae301..c3fbb700 100644 --- a/api/v1beta1/ibppeer.go +++ b/api/v1beta1/ibppeer.go @@ -211,10 +211,6 @@ func (s *IBPPeer) GetResource(comp Component) corev1.ResourceRequirements { if s.Spec.Resources.GRPCProxy != nil { return *s.Spec.Resources.GRPCProxy } - case FLUENTD: - if s.Spec.Resources.FluentD != nil { - return *s.Spec.Resources.FluentD - } case DIND: if s.Spec.Resources.DinD != nil { return *s.Spec.Resources.DinD @@ -313,7 +309,6 @@ func (i *PeerImages) Override(requested *PeerImages, registryURL string, arch st i.CouchDBImage = image.GetImage(registryURL, i.CouchDBImage, requested.CouchDBImage) i.DindImage = image.GetImage(registryURL, i.DindImage, requested.DindImage) i.GRPCWebImage = image.GetImage(registryURL, i.GRPCWebImage, requested.GRPCWebImage) - i.FluentdImage = image.GetImage(registryURL, i.FluentdImage, requested.FluentdImage) i.CCLauncherImage = image.GetImage(registryURL, i.CCLauncherImage, requested.CCLauncherImage) i.FileTransferImage = image.GetImage(registryURL, i.FileTransferImage, requested.FileTransferImage) i.BuilderImage = image.GetImage(registryURL, i.BuilderImage, requested.BuilderImage) @@ -329,7 +324,6 @@ func (i *PeerImages) Override(requested *PeerImages, registryURL string, arch st i.CouchDBTag = image.GetTag(arch, i.CouchDBTag, requested.CouchDBTag) i.DindTag = image.GetTag(arch, i.DindTag, requested.DindTag) i.GRPCWebTag = image.GetTag(arch, i.GRPCWebTag, requested.GRPCWebTag) - i.FluentdTag = image.GetTag(arch, i.FluentdTag, requested.FluentdTag) i.CCLauncherTag = image.GetTag(arch, i.CCLauncherTag, requested.CCLauncherTag) i.FileTransferTag = image.GetTag(arch, i.FileTransferTag, requested.FileTransferTag) i.BuilderTag = image.GetTag(arch, i.BuilderTag, requested.BuilderTag) diff --git a/api/v1beta1/ibppeer_types.go b/api/v1beta1/ibppeer_types.go index 5d78508f..3c09dc5e 100644 --- a/api/v1beta1/ibppeer_types.go +++ b/api/v1beta1/ibppeer_types.go @@ -221,10 +221,6 @@ type PeerResources struct { // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true GRPCProxy *corev1.ResourceRequirements `json:"proxy,omitempty"` - // FluentD (Optional) is the resources provided to the fluentd container - // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true - FluentD *corev1.ResourceRequirements `json:"fluentd,omitempty"` - // DinD (Optional) is the resources provided to the dind container // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true DinD *corev1.ResourceRequirements `json:"dind,omitempty"` @@ -294,14 +290,6 @@ type PeerImages struct { // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true GRPCWebTag string `json:"grpcwebTag,omitempty"` - // FluentdImage is the name of the fluentd logger image - // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true - FluentdImage string `json:"fluentdImage,omitempty"` - - // FluentdTag is the tag of the fluentd logger image - // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true - FluentdTag string `json:"fluentdTag,omitempty"` - // CouchDBImage is the name of the couchdb image // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true CouchDBImage string `json:"couchdbImage,omitempty"` diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 7a28711a..70f9611c 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -1743,11 +1743,6 @@ func (in *PeerResources) DeepCopyInto(out *PeerResources) { *out = new(v1.ResourceRequirements) (*in).DeepCopyInto(*out) } - if in.FluentD != nil { - in, out := &in.FluentD, &out.FluentD - *out = new(v1.ResourceRequirements) - (*in).DeepCopyInto(*out) - } if in.DinD != nil { in, out := &in.DinD, &out.DinD *out = new(v1.ResourceRequirements) diff --git a/bundle/manifests/fabric-opensource-operator.clusterserviceversion.yaml b/bundle/manifests/fabric-opensource-operator.clusterserviceversion.yaml index f74d47d0..3192d7c5 100644 --- a/bundle/manifests/fabric-opensource-operator.clusterserviceversion.yaml +++ b/bundle/manifests/fabric-opensource-operator.clusterserviceversion.yaml @@ -631,12 +631,6 @@ spec: - description: FileTransferTag is the tag of the file transfer image displayName: File Transfer Tag path: versions.peer.image.fileTransferTag - - description: FluentdImage is the name of the fluentd logger image - displayName: Fluentd Image - path: versions.peer.image.fluentdImage - - description: FluentdTag is the tag of the fluentd logger image - displayName: Fluentd Tag - path: versions.peer.image.fluentdTag - description: GoEnvImage is the name of the goenv image displayName: Go Env Image path: versions.peer.image.goEnvImage @@ -1371,12 +1365,6 @@ spec: - description: FileTransferTag is the tag of the file transfer image displayName: File Transfer Tag path: images.fileTransferTag - - description: FluentdImage is the name of the fluentd logger image - displayName: Fluentd Image - path: images.fluentdImage - - description: FluentdTag is the tag of the fluentd logger image - displayName: Fluentd Tag - path: images.fluentdTag - description: GoEnvImage is the name of the goenv image displayName: Go Env Image path: images.goEnvImage @@ -1493,11 +1481,6 @@ spec: path: resources.enroller x-descriptors: - urn:alm:descriptor:com.tectonic.ui:resourceRequirements - - description: FluentD (Optional) is the resources provided to the fluentd container - displayName: Fluent D - path: resources.fluentd - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:resourceRequirements - description: HSMDaemon (Optional) is the resources provided to the HSM Daemon container displayName: HSMDaemon diff --git a/bundle/manifests/ibp.com_ibpconsoles.yaml b/bundle/manifests/ibp.com_ibpconsoles.yaml index 76fc9d40..692f3616 100644 --- a/bundle/manifests/ibp.com_ibpconsoles.yaml +++ b/bundle/manifests/ibp.com_ibpconsoles.yaml @@ -657,14 +657,6 @@ spec: description: FileTransferTag is the tag of the file transfer image type: string - fluentdImage: - description: FluentdImage is the name of the fluentd - logger image - type: string - fluentdTag: - description: FluentdTag is the tag of the fluentd logger - image - type: string goEnvImage: description: GoEnvImage is the name of the goenv image type: string diff --git a/bundle/manifests/ibp.com_ibppeers.yaml b/bundle/manifests/ibp.com_ibppeers.yaml index c9be0c2f..652851a0 100644 --- a/bundle/manifests/ibp.com_ibppeers.yaml +++ b/bundle/manifests/ibp.com_ibppeers.yaml @@ -183,12 +183,6 @@ spec: fileTransferTag: description: FileTransferTag is the tag of the file transfer image type: string - fluentdImage: - description: FluentdImage is the name of the fluentd logger image - type: string - fluentdTag: - description: FluentdTag is the tag of the fluentd logger image - type: string goEnvImage: description: GoEnvImage is the name of the goenv image type: string @@ -393,33 +387,6 @@ spec: to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object - fluentd: - description: FluentD (Optional) is the resources provided to the - fluentd container - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object hsmdaemon: description: HSMDaemon (Optional) is the resources provided to the HSM Daemon container diff --git a/config/crd/bases/ibp.com_ibpconsoles.yaml b/config/crd/bases/ibp.com_ibpconsoles.yaml index f8522339..ef67bb30 100644 --- a/config/crd/bases/ibp.com_ibpconsoles.yaml +++ b/config/crd/bases/ibp.com_ibpconsoles.yaml @@ -658,14 +658,6 @@ spec: description: FileTransferTag is the tag of the file transfer image type: string - fluentdImage: - description: FluentdImage is the name of the fluentd - logger image - type: string - fluentdTag: - description: FluentdTag is the tag of the fluentd logger - image - type: string goEnvImage: description: GoEnvImage is the name of the goenv image type: string diff --git a/config/crd/bases/ibp.com_ibppeers.yaml b/config/crd/bases/ibp.com_ibppeers.yaml index 7380666b..fe9639a2 100644 --- a/config/crd/bases/ibp.com_ibppeers.yaml +++ b/config/crd/bases/ibp.com_ibppeers.yaml @@ -184,12 +184,6 @@ spec: fileTransferTag: description: FileTransferTag is the tag of the file transfer image type: string - fluentdImage: - description: FluentdImage is the name of the fluentd logger image - type: string - fluentdTag: - description: FluentdTag is the tag of the fluentd logger image - type: string goEnvImage: description: GoEnvImage is the name of the goenv image type: string @@ -394,33 +388,6 @@ spec: to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object - fluentd: - description: FluentD (Optional) is the resources provided to the - fluentd container - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object hsmdaemon: description: HSMDaemon (Optional) is the resources provided to the HSM Daemon container diff --git a/config/manifests/bases/fabric-opensource-operator.clusterserviceversion.yaml b/config/manifests/bases/fabric-opensource-operator.clusterserviceversion.yaml index 891a40a9..d1e8fe57 100644 --- a/config/manifests/bases/fabric-opensource-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/fabric-opensource-operator.clusterserviceversion.yaml @@ -631,12 +631,6 @@ spec: - description: FileTransferTag is the tag of the file transfer image displayName: File Transfer Tag path: versions.peer.image.fileTransferTag - - description: FluentdImage is the name of the fluentd logger image - displayName: Fluentd Image - path: versions.peer.image.fluentdImage - - description: FluentdTag is the tag of the fluentd logger image - displayName: Fluentd Tag - path: versions.peer.image.fluentdTag - description: GoEnvImage is the name of the goenv image displayName: Go Env Image path: versions.peer.image.goEnvImage @@ -1371,12 +1365,6 @@ spec: - description: FileTransferTag is the tag of the file transfer image displayName: File Transfer Tag path: images.fileTransferTag - - description: FluentdImage is the name of the fluentd logger image - displayName: Fluentd Image - path: images.fluentdImage - - description: FluentdTag is the tag of the fluentd logger image - displayName: Fluentd Tag - path: images.fluentdTag - description: GoEnvImage is the name of the goenv image displayName: Go Env Image path: images.goEnvImage diff --git a/definitions/console/deployer-configmap.yaml b/definitions/console/deployer-configmap.yaml index de920ab1..149ca313 100644 --- a/definitions/console/deployer-configmap.yaml +++ b/definitions/console/deployer-configmap.yaml @@ -124,13 +124,6 @@ data: requests: cpu: 200m memory: 400M - fluentd: - limits: - cpu: 100m - memory: 200M - requests: - cpu: 100m - memory: 200M couchdb: limits: cpu: 200m diff --git a/definitions/peer/deployment.yaml b/definitions/peer/deployment.yaml index c7602d22..f8529b45 100644 --- a/definitions/peer/deployment.yaml +++ b/definitions/peer/deployment.yaml @@ -234,46 +234,6 @@ spec: name: tls-signcert - mountPath: /certs/tls/keystore name: tls-keystore - - env: - - name: LICENSE - value: accept - image: fluent/fluentd:v1.4-2 - imagePullPolicy: Always - livenessProbe: - failureThreshold: 6 - initialDelaySeconds: 30 - tcpSocket: - port: 9880 - timeoutSeconds: 5 - name: chaincode-logs - ports: - - containerPort: 9880 - readinessProbe: - initialDelaySeconds: 26 - periodSeconds: 5 - tcpSocket: - port: 9880 - timeoutSeconds: 5 - resources: - limits: - cpu: 100m - memory: 200M - requests: - cpu: 100m - memory: 200M - securityContext: - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: false - runAsNonRoot: true - runAsUser: 1000 - volumeMounts: - - mountPath: /fluentd/etc - name: fluentd-config hostIPC: false hostNetwork: false hostPID: false diff --git a/definitions/peer/fluentd-configmap.yaml b/definitions/peer/fluentd-configmap.yaml deleted file mode 100644 index d58b70c6..00000000 --- a/definitions/peer/fluentd-configmap.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright contributors to the Hyperledger Fabric Operator project -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "fluentd-cm" -data: - fluent.conf: | - - @type forward - port 9880 - bind 0.0.0.0 - - - @type stdout - diff --git a/integration/helper/crspecs.go b/integration/helper/crspecs.go index cf8a3b72..59b60683 100644 --- a/integration/helper/crspecs.go +++ b/integration/helper/crspecs.go @@ -150,7 +150,6 @@ func Org1PeerCR(namespace, domain, peerUsername, tlsCert, caHost, adminCert stri corev1.ResourceEphemeralStorage: resource.MustParse("1G"), }, }, - FluentD: resourceReq, GRPCProxy: resourceReq, Peer: resourceReq, }, diff --git a/integration/migration/fabric/peer_test.go b/integration/migration/fabric/peer_test.go index 11f8e62e..3367e550 100644 --- a/integration/migration/fabric/peer_test.go +++ b/integration/migration/fabric/peer_test.go @@ -158,8 +158,6 @@ func GetPeer() *helper.Peer { // do not change dind tag, it is used for loading dind faster DindImage: "ghcr.io/ibm-blockchain/dind", DindTag: "noimages-amd64", - FluentdImage: "ghcr.io/ibm-blockchain/fluentd", - FluentdTag: "1.0.0-20210826-amd64", GRPCWebImage: "ghcr.io/ibm-blockchain/grpcweb", GRPCWebTag: "1.0.0-20210826-amd64", PeerImage: "ghcr.io/ibm-blockchain/peer", diff --git a/integration/migration/migration_test.go b/integration/migration/migration_test.go index e57d8974..a5536ab9 100644 --- a/integration/migration/migration_test.go +++ b/integration/migration/migration_test.go @@ -646,15 +646,6 @@ var _ = PDescribe("migrating", func() { err = client.Create(context.TODO(), ingress) Expect(err).NotTo(HaveOccurred()) - cm := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-fluentd-configmap", instance.Name), - Namespace: instance.Namespace, - }, - } - err = client.Create(context.TODO(), cm) - Expect(err).NotTo(HaveOccurred()) - secretBytes, err := ioutil.ReadFile("../../testdata/migration/secret.json") Expect(err).NotTo(HaveOccurred()) @@ -703,7 +694,6 @@ var _ = PDescribe("migrating", func() { }).Should(Equal(true)) Expect(secret.Data["peermigration-service"]).NotTo(Equal("")) - Expect(secret.Data["peermigration-cm-fluentd"]).NotTo(Equal("")) }) By("creating ecert ca certs secret", func() { diff --git a/integration/operator.go b/integration/operator.go index 1e2126c4..5922a7d7 100644 --- a/integration/operator.go +++ b/integration/operator.go @@ -76,7 +76,6 @@ func GetOperatorConfig(configs, caFiles, peerFiles, ordererFiles, consoleFiles s RoleFile: filepath.Join(peerFiles, "role.yaml"), ServiceAccountFile: filepath.Join(peerFiles, "serviceaccount.yaml"), RoleBindingFile: filepath.Join(peerFiles, "rolebinding.yaml"), - FluentdConfigMapFile: filepath.Join(peerFiles, "fluentd-configmap.yaml"), CouchContainerFile: filepath.Join(peerFiles, "couchdb.yaml"), CouchInitContainerFile: filepath.Join(peerFiles, "couchdb-init.yaml"), IngressFile: filepath.Join(peerFiles, "ingress.yaml"), diff --git a/integration/peer/peer_test.go b/integration/peer/peer_test.go index 5c341e5f..f30c9559 100644 --- a/integration/peer/peer_test.go +++ b/integration/peer/peer_test.go @@ -71,18 +71,6 @@ var ( corev1.ResourceEphemeralStorage: resource.MustParse("1G"), } - defaultRequestsFluentd = corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("10m"), - corev1.ResourceMemory: resource.MustParse("20M"), - corev1.ResourceEphemeralStorage: resource.MustParse("100M"), - } - - defaultLimitsFluentd = corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("100m"), - corev1.ResourceMemory: resource.MustParse("200M"), - corev1.ResourceEphemeralStorage: resource.MustParse("1G"), - } - defaultRequestsCouchdb = corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("20m"), corev1.ResourceMemory: resource.MustParse("40M"), @@ -791,10 +779,6 @@ func GetPeer1() *Peer { Requests: defaultRequestsProxy, Limits: defaultLimitsProxy, }, - FluentD: &corev1.ResourceRequirements{ - Requests: defaultRequestsFluentd, - Limits: defaultLimitsFluentd, - }, CouchDB: &corev1.ResourceRequirements{ Requests: defaultRequestsCouchdb, Limits: defaultLimitsCouchdb, diff --git a/main.go b/main.go index 8b702e4a..ba376331 100644 --- a/main.go +++ b/main.go @@ -145,7 +145,6 @@ func setDefaultPeerDefinitions(cfg *config.Config) { RoleFile: filepath.Join(defaultPeerDef, "role.yaml"), ServiceAccountFile: filepath.Join(defaultPeerDef, "serviceaccount.yaml"), RoleBindingFile: filepath.Join(defaultPeerDef, "rolebinding.yaml"), - FluentdConfigMapFile: filepath.Join(defaultPeerDef, "fluentd-configmap.yaml"), CouchContainerFile: filepath.Join(defaultPeerDef, "couchdb.yaml"), CouchInitContainerFile: filepath.Join(defaultPeerDef, "couchdb-init.yaml"), IngressFile: filepath.Join(defaultPeerDef, "ingress.yaml"), diff --git a/pkg/apis/deployer/deployer.go b/pkg/apis/deployer/deployer.go index 1b4eb7e1..e6f3577a 100644 --- a/pkg/apis/deployer/deployer.go +++ b/pkg/apis/deployer/deployer.go @@ -145,15 +145,6 @@ type PeerImages struct { // GRPCWebDigest is the digest tag of the grpc web proxy image GRPCWebDigest string `json:"grpcwebDigest,omitempty"` - // FluentdImage is the name of the fluentd logger image - FluentdImage string `json:"fluentdImage,omitempty"` - - // FluentdTag is the tag of the fluentd logger image - FluentdTag string `json:"fluentdTag,omitempty"` - - // FluentdDigest is the digest tag of the fluentd logger image - FluentdDigest string `json:"fluentdDigest,omitempty"` - // CouchDBImage is the name of the couchdb image CouchDBImage string `json:"couchdbImage,omitempty"` @@ -479,7 +470,6 @@ func (i *PeerImages) Override(requested *PeerImages, registryURL string, arch st i.CouchDBImage = image.GetImage(registryURL, i.CouchDBImage, requested.CouchDBImage) i.DindImage = image.GetImage(registryURL, i.DindImage, requested.DindImage) i.GRPCWebImage = image.GetImage(registryURL, i.GRPCWebImage, requested.GRPCWebImage) - i.FluentdImage = image.GetImage(registryURL, i.FluentdImage, requested.FluentdImage) i.CCLauncherImage = image.GetImage(registryURL, i.CCLauncherImage, requested.CCLauncherImage) i.FileTransferImage = image.GetImage(registryURL, i.FileTransferImage, requested.FileTransferImage) i.BuilderImage = image.GetImage(registryURL, i.BuilderImage, requested.BuilderImage) @@ -495,7 +485,6 @@ func (i *PeerImages) Override(requested *PeerImages, registryURL string, arch st i.CouchDBTag = image.GetTag(arch, i.CouchDBTag, requested.CouchDBTag) i.DindTag = image.GetTag(arch, i.DindTag, requested.DindTag) i.GRPCWebTag = image.GetTag(arch, i.GRPCWebTag, requested.GRPCWebTag) - i.FluentdTag = image.GetTag(arch, i.FluentdTag, requested.FluentdTag) i.CCLauncherTag = image.GetTag(arch, i.CCLauncherTag, requested.CCLauncherTag) i.FileTransferTag = image.GetTag(arch, i.FileTransferTag, requested.FileTransferTag) i.BuilderTag = image.GetTag(arch, i.BuilderTag, requested.BuilderTag) @@ -511,7 +500,6 @@ func (i *PeerImages) Override(requested *PeerImages, registryURL string, arch st i.CouchDBDigest = image.GetTag(arch, i.CouchDBDigest, requested.CouchDBDigest) i.DindDigest = image.GetTag(arch, i.DindDigest, requested.DindDigest) i.GRPCWebDigest = image.GetTag(arch, i.GRPCWebDigest, requested.GRPCWebDigest) - i.FluentdDigest = image.GetTag(arch, i.FluentdDigest, requested.FluentdDigest) i.CCLauncherDigest = image.GetTag(arch, i.CCLauncherDigest, requested.CCLauncherDigest) i.FileTransferDigest = image.GetTag(arch, i.FileTransferDigest, requested.FileTransferDigest) i.BuilderDigest = image.GetTag(arch, i.BuilderDigest, requested.BuilderDigest) diff --git a/pkg/initializer/peer/initializer.go b/pkg/initializer/peer/initializer.go index dbeb943e..8528a015 100644 --- a/pkg/initializer/peer/initializer.go +++ b/pkg/initializer/peer/initializer.go @@ -55,7 +55,6 @@ type Config struct { RoleFile string ServiceAccountFile string RoleBindingFile string - FluentdConfigMapFile string CouchContainerFile string CouchInitContainerFile string IngressFile string diff --git a/pkg/offering/base/console/override/deployercm_test.go b/pkg/offering/base/console/override/deployercm_test.go index a261b082..a0b0cee0 100644 --- a/pkg/offering/base/console/override/deployercm_test.go +++ b/pkg/offering/base/console/override/deployercm_test.go @@ -90,8 +90,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "1.0.0", GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.0.0", - FluentdImage: "fluentd-image", - FluentdTag: "1.0.0", CouchDBImage: "couchdb-image", CouchDBTag: "1.0.0", }, @@ -108,8 +106,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "2.0.0", GRPCWebImage: "grpcweb-image", GRPCWebTag: "2.0.0", - FluentdImage: "fluentd-image", - FluentdTag: "2.0.0", CouchDBImage: "couchdb-image", CouchDBTag: "2.0.0", CCLauncherImage: "cclauncher-image", @@ -242,8 +238,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "1.0.0", GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.0.0", - FluentdImage: "fluentd-image", - FluentdTag: "1.0.0", CouchDBImage: "couchdb-image", CouchDBTag: "1.0.0", }, @@ -260,8 +254,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "2.0.0", GRPCWebImage: "grpcweb-image", GRPCWebTag: "2.0.0", - FluentdImage: "fluentd-image", - FluentdTag: "2.0.0", CouchDBImage: "couchdb-image", CouchDBTag: "2.0.0", CCLauncherImage: "cclauncher-image", @@ -375,8 +367,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "1.0.0", GRPCWebImage: "ghcr.io/ibm-blockchain/grpcweb-image", GRPCWebTag: "1.0.0", - FluentdImage: "ghcr.io/ibm-blockchain/fluentd-image", - FluentdTag: "1.0.0", CouchDBImage: "ghcr.io/ibm-blockchain/couchdb-image", CouchDBTag: "1.0.0", }, @@ -422,8 +412,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "1.0.0-amd64", GRPCWebImage: "ghcr.io/ibm-blockchain/grpcweb-image", GRPCWebTag: "1.0.0-amd64", - FluentdImage: "ghcr.io/ibm-blockchain/fluentd-image", - FluentdTag: "1.0.0-amd64", CouchDBImage: "ghcr.io/ibm-blockchain/couchdb-image", CouchDBTag: "1.0.0-amd64", }, @@ -470,9 +458,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.0.0", GRPCWebDigest: "", - FluentdImage: "fluentd-image", - FluentdTag: "1.0.0", - FluentdDigest: "", CouchDBImage: "couchdb-image", CouchDBTag: "1.0.0", CouchDBDigest: "", @@ -527,8 +512,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { Expect(config.Versions.Peer["1.4"].Image.PeerTag).To(Equal(expectedVersions.Peer["1.4"].Image.PeerTag)) Expect(config.Versions.Peer["1.4"].Image.DindImage).To(Equal(expectedVersions.Peer["1.4"].Image.DindImage)) Expect(config.Versions.Peer["1.4"].Image.DindTag).To(Equal(expectedVersions.Peer["1.4"].Image.DindTag)) - Expect(config.Versions.Peer["1.4"].Image.FluentdImage).To(Equal(expectedVersions.Peer["1.4"].Image.FluentdImage)) - Expect(config.Versions.Peer["1.4"].Image.FluentdTag).To(Equal(expectedVersions.Peer["1.4"].Image.FluentdTag)) Expect(config.Versions.Peer["1.4"].Image.CouchDBImage).To(Equal(expectedVersions.Peer["1.4"].Image.CouchDBImage)) Expect(config.Versions.Peer["1.4"].Image.CouchDBTag).To(Equal(expectedVersions.Peer["1.4"].Image.CouchDBTag)) Expect(config.Versions.Peer["1.4"].Image.GRPCWebImage).To(Equal(expectedVersions.Peer["1.4"].Image.GRPCWebImage)) @@ -574,8 +557,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "1.0.0", GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.0.0", - FluentdImage: "fluentd-image", - FluentdTag: "1.0.0", CouchDBImage: "couchdb-image", CouchDBTag: "1.0.0", }, @@ -621,8 +602,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { DindTag: "1.0.0-amd64", GRPCWebImage: "ghcr.io/ibm-blockchain/grpcweb-image", GRPCWebTag: "1.0.0-amd64", - FluentdImage: "ghcr.io/ibm-blockchain/fluentd-image", - FluentdTag: "1.0.0-amd64", CouchDBImage: "ghcr.io/ibm-blockchain/couchdb-image", CouchDBTag: "1.0.0-amd64", }, @@ -669,9 +648,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.0.0", GRPCWebDigest: "", - FluentdImage: "fluentd-image", - FluentdTag: "1.0.0", - FluentdDigest: "", CouchDBImage: "couchdb-image", CouchDBTag: "1.0.0", CouchDBDigest: "", @@ -726,8 +702,6 @@ var _ = Describe("Base Console Deployer Config Map Overrides", func() { Expect(config.Versions.Peer["1.4"].Image.PeerTag).To(Equal(expectedVersions.Peer["1.4"].Image.PeerTag)) Expect(config.Versions.Peer["1.4"].Image.DindImage).To(Equal(expectedVersions.Peer["1.4"].Image.DindImage)) Expect(config.Versions.Peer["1.4"].Image.DindTag).To(Equal(expectedVersions.Peer["1.4"].Image.DindTag)) - Expect(config.Versions.Peer["1.4"].Image.FluentdImage).To(Equal(expectedVersions.Peer["1.4"].Image.FluentdImage)) - Expect(config.Versions.Peer["1.4"].Image.FluentdTag).To(Equal(expectedVersions.Peer["1.4"].Image.FluentdTag)) Expect(config.Versions.Peer["1.4"].Image.CouchDBImage).To(Equal(expectedVersions.Peer["1.4"].Image.CouchDBImage)) Expect(config.Versions.Peer["1.4"].Image.CouchDBTag).To(Equal(expectedVersions.Peer["1.4"].Image.CouchDBTag)) Expect(config.Versions.Peer["1.4"].Image.GRPCWebImage).To(Equal(expectedVersions.Peer["1.4"].Image.GRPCWebImage)) diff --git a/pkg/offering/base/peer/override/deployment.go b/pkg/offering/base/peer/override/deployment.go index 9d735ae1..49ce5d6d 100644 --- a/pkg/offering/base/peer/override/deployment.go +++ b/pkg/offering/base/peer/override/deployment.go @@ -51,7 +51,6 @@ const ( PEER = "peer" DIND = "dind" PROXY = "proxy" - FLUENTD = "chaincode-logs" COUCHDB = "couchdb" COUCHDBINIT = "couchdbinit" CCLAUNCHER = "chaincode-launcher" @@ -153,8 +152,6 @@ func (o *Override) CreateDeployment(instance *current.IBPPeer, k8sDep *appsv1.De } deployment.AppendPVCVolumeIfMissing("fabric-peer-0", claimName) - deployment.AppendConfigMapVolumeIfMissing("fluentd-config", instance.Name+"-fluentd") - ecertintercertSecret := fmt.Sprintf("ecert-%s-intercerts", instance.Name) tlsintercertSecret := fmt.Sprintf("tls-%s-intercerts", instance.Name) secretName := fmt.Sprintf("tls-%s-cacerts", instance.Name) @@ -351,26 +348,14 @@ func (o *Override) V1Deployment(instance *current.IBPPeer, deployment *dep.Deplo }) } - fluentdContainer, err := deployment.GetContainer(FLUENTD) - if err != nil { - return errors.New("fluentD container not found in deployment") - } - dindContainer, err := deployment.GetContainer(DIND) if err != nil { return errors.New("dind container not found in deployment") } - dindargs := instance.Spec.DindArgs - if dindargs == nil { - dindargs = []string{"--log-driver", "fluentd", "--log-opt", "fluentd-address=localhost:9880", "--mtu", "1400"} - } - dindContainer.SetArgs(dindargs) - image := instance.Spec.Images if image != nil { dindContainer.SetImage(image.DindImage, image.DindTag) - fluentdContainer.SetImage(image.FluentdImage, image.FluentdTag) } resourcesRequest := instance.Spec.Resources @@ -382,12 +367,6 @@ func (o *Override) V1Deployment(instance *current.IBPPeer, deployment *dep.Deplo } } - if resourcesRequest.FluentD != nil { - err = fluentdContainer.UpdateResources(resourcesRequest.FluentD) - if err != nil { - return errors.Wrap(err, "resource update for fluentd failed") - } - } } peerContainer := deployment.MustGetContainer(PEER) @@ -402,7 +381,6 @@ func (o *Override) V1Deployment(instance *current.IBPPeer, deployment *dep.Deplo peerContainer.AppendEnvIfMissing("CORE_VM_DOCKER_ATTACHSTDOUT", "false") deployment.UpdateInitContainer(initContainer) - deployment.UpdateContainer(fluentdContainer) deployment.UpdateContainer(dindContainer) deployment.UpdateContainer(peerContainer) return nil @@ -494,7 +472,6 @@ func (o *Override) V2Deployment(instance *current.IBPPeer, deployment *dep.Deplo deployment.UpdateInitContainer(initContainer) deployment.UpdateContainer(peerContainer) - deployment.RemoveContainer(FLUENTD) deployment.RemoveContainer(DIND) return nil } diff --git a/pkg/offering/base/peer/override/deployment_test.go b/pkg/offering/base/peer/override/deployment_test.go index b7762457..601f70de 100644 --- a/pkg/offering/base/peer/override/deployment_test.go +++ b/pkg/offering/base/peer/override/deployment_test.go @@ -160,12 +160,11 @@ var _ = Describe("Base Peer Deployment Overrides", func() { License: current.License{ Accept: true, }, - MSPID: "peer-msp-id", - Storage: ¤t.PeerStorages{}, - Service: ¤t.Service{}, - Images: ¤t.PeerImages{}, - Arch: []string{"test-arch"}, - DindArgs: []string{"--log-driver", "fluentd", "--mtu", "1480"}, + MSPID: "peer-msp-id", + Storage: ¤t.PeerStorages{}, + Service: ¤t.Service{}, + Images: ¤t.PeerImages{}, + Arch: []string{"test-arch"}, Ingress: current.Ingress{ TlsSecretName: "tlssecret", }, @@ -210,7 +209,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { corev1.ResourceEphemeralStorage: testMatrix[2][5], }, }, - FluentD: &corev1.ResourceRequirements{ + CouchDB: &corev1.ResourceRequirements{ Requests: map[corev1.ResourceName]resource.Quantity{ corev1.ResourceCPU: testMatrix[3][0], corev1.ResourceMemory: testMatrix[3][1], @@ -222,18 +221,6 @@ var _ = Describe("Base Peer Deployment Overrides", func() { corev1.ResourceEphemeralStorage: testMatrix[3][5], }, }, - CouchDB: &corev1.ResourceRequirements{ - Requests: map[corev1.ResourceName]resource.Quantity{ - corev1.ResourceCPU: testMatrix[4][0], - corev1.ResourceMemory: testMatrix[4][1], - corev1.ResourceEphemeralStorage: testMatrix[4][4], - }, - Limits: map[corev1.ResourceName]resource.Quantity{ - corev1.ResourceCPU: testMatrix[4][2], - corev1.ResourceMemory: testMatrix[4][3], - corev1.ResourceEphemeralStorage: testMatrix[4][5], - }, - }, CCLauncher: &corev1.ResourceRequirements{ Requests: map[corev1.ResourceName]resource.Quantity{ corev1.ResourceCPU: testMatrix[5][0], @@ -266,22 +253,11 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Expect(err.Error()).To(Equal("failed to provide MSP ID for peer")) }) - It("sets default dind args if none provided", func() { - instance.Spec.DindArgs = nil - err := overrider.Deployment(instance, k8sDep, resources.Create) - Expect(err).NotTo(HaveOccurred()) - Expect(deployment.Spec.Template.Spec.Containers[0].Args).To(Equal([]string{"--log-driver", "fluentd", "--log-opt", "fluentd-address=localhost:9880", "--mtu", "1400"})) - }) - It("overrides value based on spec", func() { mockKubeClient.GetReturnsOnCall(1, errors.New("no inter cert found")) err := overrider.Deployment(instance, k8sDep, resources.Create) Expect(err).NotTo(HaveOccurred()) - By("setting dind args", func() { - Expect(len(deployment.Spec.Template.Spec.Containers[0].Args)).To(Equal(4)) - }) - By("setting service account", func() { Expect(deployment.Spec.Template.Spec.ServiceAccountName).To(Equal(instance.Name)) }) @@ -343,7 +319,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Name: "COUCHDB_USER", Value: overrider.CouchdbUser, } - Expect(deployment.Spec.Template.Spec.Containers[4].Env).To(ContainElement(ev)) + Expect(deployment.Spec.Template.Spec.Containers[3].Env).To(ContainElement(ev)) }) By("setting COUCHDB_PASSWORD env var", func() { @@ -351,7 +327,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Name: "COUCHDB_PASSWORD", Value: overrider.CouchdbPassword, } - Expect(deployment.Spec.Template.Spec.Containers[4].Env).To(ContainElement(ev)) + Expect(deployment.Spec.Template.Spec.Containers[3].Env).To(ContainElement(ev)) }) By("setting SKIP_PERMISSIONS_UPDATE env var", func() { @@ -359,7 +335,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Name: "SKIP_PERMISSIONS_UPDATE", Value: "true", } - Expect(deployment.Spec.Template.Spec.Containers[4].Env).To(ContainElement(ev)) + Expect(deployment.Spec.Template.Spec.Containers[3].Env).To(ContainElement(ev)) }) By("setting image pull secret", func() { @@ -380,20 +356,6 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Expect(deployment.Spec.Template.Spec.Volumes).To(ContainElement(v)) }) - By("setting fluentd-config volume", func() { - v := corev1.Volume{ - Name: "fluentd-config", - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: instance.Name + "-fluentd", - }, - }, - }, - } - Expect(deployment.Spec.Template.Spec.Volumes).To(ContainElement(v)) - }) - By("setting affinity", func() { expectedAffinity := overrider.GetAffinity(instance) Expect(deployment.Spec.Template.Spec.Affinity).To(Equal(expectedAffinity)) @@ -518,7 +480,6 @@ var _ = Describe("Base Peer Deployment Overrides", func() { CouchDBImage: "couchdb-image", PeerImage: "peer-image", GRPCWebImage: "proxy-image", - FluentdImage: "fluentd-image", } instance.Spec.Images = image }) @@ -531,8 +492,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(Equal("dind-image:latest")) Expect(deployment.Spec.Template.Spec.Containers[1].Image).To(Equal("peer-image:latest")) Expect(deployment.Spec.Template.Spec.Containers[2].Image).To(Equal("proxy-image:latest")) - Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("fluentd-image:latest")) - Expect(deployment.Spec.Template.Spec.Containers[4].Image).To(Equal("couchdb-image:latest")) + Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("couchdb-image:latest")) }) }) @@ -544,7 +504,6 @@ var _ = Describe("Base Peer Deployment Overrides", func() { image.PeerTag = "1.0.3" image.GRPCWebTag = "1.0.4" image.PeerInitTag = "2.0.0" - image.FluentdTag = "1.0.5" err := overrider.Deployment(instance, k8sDep, resources.Create) Expect(err).NotTo(HaveOccurred()) @@ -552,8 +511,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(Equal("dind-image:1.0.1")) Expect(deployment.Spec.Template.Spec.Containers[1].Image).To(Equal("peer-image:1.0.3")) Expect(deployment.Spec.Template.Spec.Containers[2].Image).To(Equal("proxy-image:1.0.4")) - Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("fluentd-image:1.0.5")) - Expect(deployment.Spec.Template.Spec.Containers[4].Image).To(Equal("couchdb-image:1.0.2")) + Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("couchdb-image:1.0.2")) }) }) @@ -691,7 +649,6 @@ var _ = Describe("Base Peer Deployment Overrides", func() { CouchDBImage: "couchdb-image", PeerImage: "peer-image", GRPCWebImage: "proxy-image", - FluentdImage: "fluentd-image", } instance.Spec.Images = image }) @@ -704,8 +661,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(Equal("dind-image:latest")) Expect(deployment.Spec.Template.Spec.Containers[1].Image).To(Equal("peer-image:latest")) Expect(deployment.Spec.Template.Spec.Containers[2].Image).To(Equal("proxy-image:latest")) - Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("fluentd-image:latest")) - Expect(deployment.Spec.Template.Spec.Containers[4].Image).To(Equal("couchdb-image:latest")) + Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("couchdb-image:latest")) }) }) @@ -716,7 +672,6 @@ var _ = Describe("Base Peer Deployment Overrides", func() { image.PeerTag = "1.0.3" image.GRPCWebTag = "1.0.4" image.PeerInitTag = "2.0.0" - image.FluentdTag = "1.0.5" err := overrider.Deployment(instance, k8sDep, resources.Update) Expect(err).NotTo(HaveOccurred()) @@ -724,8 +679,7 @@ var _ = Describe("Base Peer Deployment Overrides", func() { Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(Equal("dind-image:1.0.1")) Expect(deployment.Spec.Template.Spec.Containers[1].Image).To(Equal("peer-image:1.0.3")) Expect(deployment.Spec.Template.Spec.Containers[2].Image).To(Equal("proxy-image:1.0.4")) - Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("fluentd-image:1.0.5")) - Expect(deployment.Spec.Template.Spec.Containers[4].Image).To(Equal("couchdb-image:1.0.2")) + Expect(deployment.Spec.Template.Spec.Containers[3].Image).To(Equal("couchdb-image:1.0.2")) }) }) }) diff --git a/pkg/offering/base/peer/peer.go b/pkg/offering/base/peer/peer.go index b6806181..5859e49e 100644 --- a/pkg/offering/base/peer/peer.go +++ b/pkg/offering/base/peer/peer.go @@ -71,14 +71,13 @@ const ( DefaultCouchContainer = "./definitions/peer/couchdb.yaml" DefaultCouchInitContainer = "./definitions/peer/couchdb-init.yaml" - defaultDeployment = "./definitions/peer/deployment.yaml" - defaultPVC = "./definitions/peer/pvc.yaml" - defaultCouchDBPVC = "./definitions/peer/couchdb-pvc.yaml" - defaultService = "./definitions/peer/service.yaml" - defaultRole = "./definitions/peer/role.yaml" - defaultServiceAccount = "./definitions/peer/serviceaccount.yaml" - defaultRoleBinding = "./definitions/peer/rolebinding.yaml" - defaultFluentdConfigMap = "./definitions/peer/fluentd-configmap.yaml" + defaultDeployment = "./definitions/peer/deployment.yaml" + defaultPVC = "./definitions/peer/pvc.yaml" + defaultCouchDBPVC = "./definitions/peer/couchdb-pvc.yaml" + defaultService = "./definitions/peer/service.yaml" + defaultRole = "./definitions/peer/role.yaml" + defaultServiceAccount = "./definitions/peer/serviceaccount.yaml" + defaultRoleBinding = "./definitions/peer/rolebinding.yaml" DaysToSecondsConversion = int64(24 * 60 * 60) ) @@ -193,14 +192,13 @@ type Peer struct { Scheme *runtime.Scheme Config *config.Config - DeploymentManager DeploymentManager - ServiceManager resources.Manager - PVCManager resources.Manager - StateDBPVCManager resources.Manager - FluentDConfigMapManager resources.Manager - RoleManager resources.Manager - RoleBindingManager resources.Manager - ServiceAccountManager resources.Manager + DeploymentManager DeploymentManager + ServiceManager resources.Manager + PVCManager resources.Manager + StateDBPVCManager resources.Manager + RoleManager resources.Manager + RoleBindingManager resources.Manager + ServiceAccountManager resources.Manager Override Override Initializer InitializeIBPPeer @@ -244,7 +242,6 @@ func (p *Peer) CreateManagers() { p.DeploymentManager = resourceManager.CreateDeploymentManager("", override.Deployment, p.GetLabels, peerConfig.DeploymentFile) p.PVCManager = resourceManager.CreatePVCManager("", override.PVC, p.GetLabels, peerConfig.PVCFile) p.StateDBPVCManager = resourceManager.CreatePVCManager("statedb", override.StateDBPVC, p.GetLabels, peerConfig.CouchDBPVCFile) - p.FluentDConfigMapManager = resourceManager.CreateConfigMapManager("fluentd", nil, p.GetLabels, peerConfig.FluentdConfigMapFile, nil) p.RoleManager = resourceManager.CreateRoleManager("", nil, p.GetLabels, peerConfig.RoleFile) p.RoleBindingManager = resourceManager.CreateRoleBindingManager("", nil, p.GetLabels, peerConfig.RoleBindingFile) p.ServiceAccountManager = resourceManager.CreateServiceAccountManager("", nil, p.GetLabels, peerConfig.ServiceAccountFile) @@ -771,11 +768,6 @@ func (p *Peer) ReconcileManagers(instance *current.IBPPeer, updated Update) erro return errors.Wrap(err, "failed RBAC reconciliation") } - err = p.FluentDConfigMapManager.Reconcile(instance, update) - if err != nil { - return errors.Wrap(err, "failed FluentD ConfigMap reconciliation") - } - return nil } diff --git a/pkg/offering/base/peer/peer_test.go b/pkg/offering/base/peer/peer_test.go index de6db024..75d15b8f 100644 --- a/pkg/offering/base/peer/peer_test.go +++ b/pkg/offering/base/peer/peer_test.go @@ -75,7 +75,6 @@ var _ = Describe("Base Peer", func() { serviceMgr *managermocks.ResourceManager pvcMgr *managermocks.ResourceManager couchPvcMgr *managermocks.ResourceManager - configMapMgr *managermocks.ResourceManager roleMgr *managermocks.ResourceManager roleBindingMgr *managermocks.ResourceManager serviceAccountMgr *managermocks.ResourceManager @@ -158,7 +157,6 @@ var _ = Describe("Base Peer", func() { serviceMgr = &managermocks.ResourceManager{} pvcMgr = &managermocks.ResourceManager{} couchPvcMgr = &managermocks.ResourceManager{} - configMapMgr = &managermocks.ResourceManager{} roleMgr = &managermocks.ResourceManager{} roleBindingMgr = &managermocks.ResourceManager{} serviceAccountMgr = &managermocks.ResourceManager{} @@ -195,15 +193,14 @@ var _ = Describe("Base Peer", func() { Scheme: scheme, Config: cfg, - DeploymentManager: deploymentMgr, - ServiceManager: serviceMgr, - PVCManager: pvcMgr, - StateDBPVCManager: couchPvcMgr, - FluentDConfigMapManager: configMapMgr, - RoleManager: roleMgr, - RoleBindingManager: roleBindingMgr, - ServiceAccountManager: serviceAccountMgr, - Initializer: initializer, + DeploymentManager: deploymentMgr, + ServiceManager: serviceMgr, + PVCManager: pvcMgr, + StateDBPVCManager: couchPvcMgr, + RoleManager: roleMgr, + RoleBindingManager: roleBindingMgr, + ServiceAccountManager: serviceAccountMgr, + Initializer: initializer, CertificateManager: certificateMgr, RenewCertTimers: make(map[string]*time.Timer), @@ -542,13 +539,6 @@ var _ = Describe("Base Peer", func() { Expect(err.Error()).To(ContainSubstring("failed to reconcile service account")) }) - It("returns an error if config map manager fails to reconcile", func() { - configMapMgr.ReconcileReturns(errors.New("failed to reconcile config map")) - _, err := peer.Reconcile(instance, update) - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to reconcile managers: failed FluentD ConfigMap reconciliation: failed to reconcile config map")) - }) - It("does not return an error on a successful reconcile", func() { _, err := peer.Reconcile(instance, update) Expect(err).NotTo(HaveOccurred()) @@ -1008,8 +998,6 @@ var _ = Describe("Base Peer", func() { CouchDBTag: "2.0.0", GRPCWebImage: "grpcimage", GRPCWebTag: "2.0.0", - FluentdImage: "fluentdimage", - FluentdTag: "2.0.0", } }) @@ -1025,8 +1013,6 @@ var _ = Describe("Base Peer", func() { Expect(images.CouchDBTag).To(Equal("2.0.0")) Expect(images.GRPCWebImage).To(Equal("ghcr.io/ibm-blockchain/grpcimage")) Expect(images.GRPCWebTag).To(Equal("2.0.0")) - Expect(images.FluentdImage).To(Equal("ghcr.io/ibm-blockchain/fluentdimage")) - Expect(images.FluentdTag).To(Equal("2.0.0")) }) It("overrides images based with registry url and does not append more value on each call", func() { @@ -1041,8 +1027,7 @@ var _ = Describe("Base Peer", func() { Expect(images.CouchDBTag).To(Equal("2.0.0")) Expect(images.GRPCWebImage).To(Equal("ghcr.io/ibm-blockchain/images/grpcimage")) Expect(images.GRPCWebTag).To(Equal("2.0.0")) - Expect(images.FluentdImage).To(Equal("ghcr.io/ibm-blockchain/images/fluentdimage")) - Expect(images.FluentdTag).To(Equal("2.0.0")) + }) }) @@ -1059,8 +1044,6 @@ var _ = Describe("Base Peer", func() { CouchDBTag: "2.0.0", GRPCWebImage: "ghcr.io/ibm-blockchain/grpcimage", GRPCWebTag: "2.0.0", - FluentdImage: "ghcr.io/ibm-blockchain/fluentdimage", - FluentdTag: "2.0.0", } }) @@ -1076,8 +1059,7 @@ var _ = Describe("Base Peer", func() { Expect(images.CouchDBTag).To(Equal("2.0.0")) Expect(images.GRPCWebImage).To(Equal("ghcr.io/ibm-blockchain/grpcimage")) Expect(images.GRPCWebTag).To(Equal("2.0.0")) - Expect(images.FluentdImage).To(Equal("ghcr.io/ibm-blockchain/fluentdimage")) - Expect(images.FluentdTag).To(Equal("2.0.0")) + }) }) }) diff --git a/pkg/offering/common/reconcilechecks/images/fabricversion_test.go b/pkg/offering/common/reconcilechecks/images/fabricversion_test.go index 4fd61742..7c535ea0 100644 --- a/pkg/offering/common/reconcilechecks/images/fabricversion_test.go +++ b/pkg/offering/common/reconcilechecks/images/fabricversion_test.go @@ -78,8 +78,6 @@ var _ = Describe("fabric version", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", }, @@ -98,8 +96,6 @@ var _ = Describe("fabric version", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", }, @@ -118,8 +114,6 @@ var _ = Describe("fabric version", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", }, diff --git a/pkg/offering/common/reconcilechecks/images/images_test.go b/pkg/offering/common/reconcilechecks/images/images_test.go index e104c36c..7091dcc1 100644 --- a/pkg/offering/common/reconcilechecks/images/images_test.go +++ b/pkg/offering/common/reconcilechecks/images/images_test.go @@ -78,8 +78,6 @@ var _ = Describe("default images", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", }, @@ -98,8 +96,6 @@ var _ = Describe("default images", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", }, @@ -118,8 +114,6 @@ var _ = Describe("default images", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", }, @@ -347,8 +341,6 @@ var _ = Describe("default images", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ibp-enroller", EnrollerTag: "1.0.0-amd64", } @@ -363,8 +355,6 @@ var _ = Describe("default images", func() { Expect(instance.Spec.Images.CouchDBTag).To(Equal(peerImages.CouchDBTag)) Expect(instance.Spec.Images.GRPCWebImage).To(Equal(peerImages.GRPCWebImage)) Expect(instance.Spec.Images.GRPCWebTag).To(Equal(peerImages.GRPCWebTag)) - Expect(instance.Spec.Images.FluentdImage).To(Equal(peerImages.FluentdImage)) - Expect(instance.Spec.Images.FluentdTag).To(Equal(peerImages.FluentdTag)) Expect(instance.Spec.Images.EnrollerImage).To(Equal(peerImages.EnrollerImage)) Expect(instance.Spec.Images.EnrollerTag).To(Equal(peerImages.EnrollerTag)) }) @@ -385,8 +375,6 @@ var _ = Describe("default images", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ghcr.io/ibm-blockchain/ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ghcr.io/ibm-blockchain/ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ghcr.io/ibm-blockchain/ibp-enroller", EnrollerTag: "1.0.0-amd64", } @@ -401,8 +389,6 @@ var _ = Describe("default images", func() { Expect(instance.Spec.Images.CouchDBTag).To(Equal(peerImages.CouchDBTag)) Expect(instance.Spec.Images.GRPCWebImage).To(Equal(peerImages.GRPCWebImage)) Expect(instance.Spec.Images.GRPCWebTag).To(Equal(peerImages.GRPCWebTag)) - Expect(instance.Spec.Images.FluentdImage).To(Equal(peerImages.FluentdImage)) - Expect(instance.Spec.Images.FluentdTag).To(Equal(peerImages.FluentdTag)) Expect(instance.Spec.Images.EnrollerImage).To(Equal(peerImages.EnrollerImage)) Expect(instance.Spec.Images.EnrollerTag).To(Equal(peerImages.EnrollerTag)) }) @@ -429,8 +415,6 @@ var _ = Describe("default images", func() { CouchDBTag: "2.3.1-2511004-amd64", GRPCWebImage: "ghcr.io/ibm-blockchain/ibp-grpcweb", GRPCWebTag: "2.5.1-2511004-amd64", - FluentdImage: "ghcr.io/ibm-blockchain/ibp-fluentd", - FluentdTag: "2.5.1-2511004-amd64", EnrollerImage: "ghcr.io/ibm-blockchain/ibp-enroller", EnrollerTag: "1.0.0-amd64", } @@ -445,8 +429,6 @@ var _ = Describe("default images", func() { Expect(instance.Spec.Images.CouchDBTag).To(Equal(peerImages.CouchDBTag)) Expect(instance.Spec.Images.GRPCWebImage).To(Equal(peerImages.GRPCWebImage)) Expect(instance.Spec.Images.GRPCWebTag).To(Equal(peerImages.GRPCWebTag)) - Expect(instance.Spec.Images.FluentdImage).To(Equal(peerImages.FluentdImage)) - Expect(instance.Spec.Images.FluentdTag).To(Equal(peerImages.FluentdTag)) Expect(instance.Spec.Images.EnrollerImage).To(Equal(peerImages.EnrollerImage)) Expect(instance.Spec.Images.EnrollerTag).To(Equal(peerImages.EnrollerTag)) }) diff --git a/pkg/offering/k8s/console/override/deployercm_test.go b/pkg/offering/k8s/console/override/deployercm_test.go index 1127960c..e0d59d68 100644 --- a/pkg/offering/k8s/console/override/deployercm_test.go +++ b/pkg/offering/k8s/console/override/deployercm_test.go @@ -83,8 +83,6 @@ var _ = Describe("K8S Console Deployer Config Map Overrides", func() { DindTag: "1.4.6", GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.4.6", - FluentdImage: "fluentd-image", - FluentdTag: "1.4.6", CouchDBImage: "couchdb-image", CouchDBTag: "1.4.6", }, @@ -209,8 +207,6 @@ var _ = Describe("K8S Console Deployer Config Map Overrides", func() { DindTag: "1.4.6", GRPCWebImage: fmt.Sprintf("%sgrpcweb-image", instance.Spec.RegistryURL), GRPCWebTag: "1.4.6", - FluentdImage: fmt.Sprintf("%sfluentd-image", instance.Spec.RegistryURL), - FluentdTag: "1.4.6", CouchDBImage: fmt.Sprintf("%scouchdb-image", instance.Spec.RegistryURL), CouchDBTag: "1.4.6", }, diff --git a/pkg/offering/k8s/peer/peer_test.go b/pkg/offering/k8s/peer/peer_test.go index be33a190..5f5b2abc 100644 --- a/pkg/offering/k8s/peer/peer_test.go +++ b/pkg/offering/k8s/peer/peer_test.go @@ -54,7 +54,6 @@ var _ = Describe("K8s Peer", func() { serviceMgr *managermocks.ResourceManager pvcMgr *managermocks.ResourceManager couchPvcMgr *managermocks.ResourceManager - configMapMgr *managermocks.ResourceManager roleMgr *managermocks.ResourceManager roleBindingMgr *managermocks.ResourceManager serviceAccountMgr *managermocks.ResourceManager @@ -128,7 +127,6 @@ var _ = Describe("K8s Peer", func() { serviceMgr = &managermocks.ResourceManager{} pvcMgr = &managermocks.ResourceManager{} couchPvcMgr = &managermocks.ResourceManager{} - configMapMgr = &managermocks.ResourceManager{} roleMgr = &managermocks.ResourceManager{} roleBindingMgr = &managermocks.ResourceManager{} serviceAccountMgr = &managermocks.ResourceManager{} @@ -151,17 +149,16 @@ var _ = Describe("K8s Peer", func() { Scheme: scheme, Config: cfg, - DeploymentManager: deploymentMgr, - ServiceManager: serviceMgr, - PVCManager: pvcMgr, - StateDBPVCManager: couchPvcMgr, - FluentDConfigMapManager: configMapMgr, - RoleManager: roleMgr, - RoleBindingManager: roleBindingMgr, - ServiceAccountManager: serviceAccountMgr, - Initializer: initializer, - CertificateManager: certificateMgr, - Restart: restartMgr, + DeploymentManager: deploymentMgr, + ServiceManager: serviceMgr, + PVCManager: pvcMgr, + StateDBPVCManager: couchPvcMgr, + RoleManager: roleMgr, + RoleBindingManager: roleBindingMgr, + ServiceAccountManager: serviceAccountMgr, + Initializer: initializer, + CertificateManager: certificateMgr, + Restart: restartMgr, }, IngressManager: ingressMgr, } @@ -217,13 +214,6 @@ var _ = Describe("K8s Peer", func() { Expect(err.Error()).To(ContainSubstring("failed to reconcile service account")) }) - It("returns an error if config map manager fails to reconcile", func() { - configMapMgr.ReconcileReturns(errors.New("failed to reconcile config map")) - _, err := peer.Reconcile(instance, update) - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("failed to reconcile managers: failed FluentD ConfigMap reconciliation: failed to reconcile config map")) - }) - It("returns a breaking error if initialization fails", func() { cfg.PeerInitConfig.CorePeerFile = "../../../../../defaultconfig/peer/badfile.yaml" peer.Initializer = peerinit.New(cfg.PeerInitConfig, nil, nil, nil, nil, enroller.HSMEnrollJobTimeouts{}) diff --git a/pkg/offering/openshift/console/override/deployercm_test.go b/pkg/offering/openshift/console/override/deployercm_test.go index 51ddfc20..bba45577 100644 --- a/pkg/offering/openshift/console/override/deployercm_test.go +++ b/pkg/offering/openshift/console/override/deployercm_test.go @@ -80,8 +80,6 @@ var _ = Describe("Openshift Console Deployer Config Map Overrides", func() { DindTag: "1.4.6", GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.4.6", - FluentdImage: "fluentd-image", - FluentdTag: "1.4.6", CouchDBImage: "couchdb-image", CouchDBTag: "1.4.6", CCLauncherImage: "cclauncer-image", @@ -192,8 +190,6 @@ var _ = Describe("Openshift Console Deployer Config Map Overrides", func() { DindTag: "1.4.6", GRPCWebImage: "grpcweb-image", GRPCWebTag: "1.4.6", - FluentdImage: "fluentd-image", - FluentdTag: "1.4.6", CouchDBImage: "couchdb-image", CouchDBTag: "1.4.6", CCLauncherImage: "cclauncer-image", diff --git a/pkg/offering/openshift/peer/peer.go b/pkg/offering/openshift/peer/peer.go index f8f7a16a..1f4e85b4 100644 --- a/pkg/offering/openshift/peer/peer.go +++ b/pkg/offering/openshift/peer/peer.go @@ -21,7 +21,6 @@ package openshiftpeer import ( "context" "fmt" - "regexp" current "github.com/IBM-Blockchain/fabric-operator/api/v1beta1" config "github.com/IBM-Blockchain/fabric-operator/operatorconfig" @@ -309,14 +308,5 @@ func (p *Peer) SelectDinDArgs(instance *current.IBPPeer) (bool, error) { return false, err } - dindargs := []string{"--log-driver", "fluentd", "--log-opt", "fluentd-address=localhost:9880", "--mtu", "1400", "--iptables=true"} - - re := regexp.MustCompile(`4\.[0-9]\.[0-9]`) - if re.MatchString(clusterversion.Status.Desired.Version) { - dindargs = []string{"--log-driver", "fluentd", "--log-opt", "fluentd-address=localhost:9880", "--mtu", "1400", "--iptables=false"} - } - - instance.Spec.DindArgs = dindargs - return true, nil } diff --git a/pkg/offering/openshift/peer/peer_test.go b/pkg/offering/openshift/peer/peer_test.go index ae6b9049..b5afb035 100644 --- a/pkg/offering/openshift/peer/peer_test.go +++ b/pkg/offering/openshift/peer/peer_test.go @@ -117,7 +117,6 @@ var _ = Describe("Openshift Peer", func() { serviceMgr := &managermocks.ResourceManager{} pvcMgr := &managermocks.ResourceManager{} couchPvcMgr := &managermocks.ResourceManager{} - configMapMgr := &managermocks.ResourceManager{} roleMgr := &managermocks.ResourceManager{} roleBindingMgr := &managermocks.ResourceManager{} serviceAccountMgr := &managermocks.ResourceManager{} @@ -139,20 +138,19 @@ var _ = Describe("Openshift Peer", func() { initializer.GetInitPeerReturns(&peerinit.Peer{}, nil) peer = &openshiftpeer.Peer{ Peer: &basepeer.Peer{ - Config: cfg, - Client: mockKubeClient, - Scheme: scheme, - DeploymentManager: deploymentMgr, - ServiceManager: serviceMgr, - PVCManager: pvcMgr, - StateDBPVCManager: couchPvcMgr, - FluentDConfigMapManager: configMapMgr, - RoleManager: roleMgr, - RoleBindingManager: roleBindingMgr, - ServiceAccountManager: serviceAccountMgr, - Initializer: initializer, - CertificateManager: certificateMgr, - Restart: restartMgr, + Config: cfg, + Client: mockKubeClient, + Scheme: scheme, + DeploymentManager: deploymentMgr, + ServiceManager: serviceMgr, + PVCManager: pvcMgr, + StateDBPVCManager: couchPvcMgr, + RoleManager: roleMgr, + RoleBindingManager: roleBindingMgr, + ServiceAccountManager: serviceAccountMgr, + Initializer: initializer, + CertificateManager: certificateMgr, + Restart: restartMgr, }, RouteManager: peerRouteManager, OperationsRouteManager: operationsRouteManager,