#
# 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: ibp.com/v1beta1
kind: IBPOrderer
metadata:
  name: org0-orderers
spec:
  version: "${FABRIC_VERSION}"
  domain: "${INGRESS_DOMAIN}"
  license:
    accept: true
  action:
    enroll: {}
    reenroll: {}
  clusterSize: 3
  clusterconfigoverride:
    - general:
        keepalive:
          serverMinInterval: 61s
    - general:
        keepalive:
          serverMinInterval: 61s
    - general:
        keepalive:
          serverMinInterval: 61s
  clustersecret:
    - enrollment:
        component:
          caname: ca
          cahost: test-network-org0-ca-ca.${INGRESS_DOMAIN}
          caport: "443"
          catls:
            cacert: "${ORG0_CA_CERT}"
          enrollid: "orderer1"
          enrollsecret: "orderer1pw"
        tls:
          caname: tlsca
          cahost: test-network-org0-ca-ca.${INGRESS_DOMAIN}
          caport: "443"
          catls:
            cacert: "${ORG0_CA_CERT}"
          enrollid: "orderer1"
          enrollsecret: "orderer1pw"
          csr:
            hosts:
              - "org0-orderersnode1"
              - "org0-orderersnode1.${KUBE_DNS_DOMAIN}"
    - enrollment:
        component:
          caname: ca
          cahost: test-network-org0-ca-ca.${INGRESS_DOMAIN}
          caport: "443"
          catls:
            cacert: "${ORG0_CA_CERT}"
          enrollid: "orderer2"
          enrollsecret: "orderer2pw"
        tls:
          caname: tlsca
          cahost: test-network-org0-ca-ca.${INGRESS_DOMAIN}
          caport: "443"
          catls:
            cacert: "${ORG0_CA_CERT}"
          enrollid: "orderer2"
          enrollsecret: "orderer2pw"
          csr:
            hosts:
              - "org0-orderersnode2"
              - "org0-orderersnode2.${KUBE_DNS_DOMAIN}"
    - enrollment:
        component:
          caname: ca
          cahost: test-network-org0-ca-ca.${INGRESS_DOMAIN}
          caport: "443"
          catls:
            cacert: "${ORG0_CA_CERT}"
          enrollid: "orderer3"
          enrollsecret: "orderer3pw"
        tls:
          caname: tlsca
          cahost: test-network-org0-ca-ca.${INGRESS_DOMAIN}
          caport: "443"
          catls:
            cacert: "${ORG0_CA_CERT}"
          enrollid: "orderer3"
          enrollsecret: "orderer3pw"
          csr:
            hosts:
              - "org0-orderersnode3"
              - "org0-orderersnode3.${KUBE_DNS_DOMAIN}"

  customNames:
    pvc: {}
  images:
    ordererInitImage: ${INIT_IMAGE}
    ordererInitTag: ${INIT_IMAGE_LABEL}
    ordererImage: ${ORDERER_IMAGE}
    ordererTag: ${ORDERER_IMAGE_LABEL}
    grpcwebImage: ${GRPCWEB_IMAGE}
    grpcwebTag: ${GRPCWEB_IMAGE_LABEL}
  ingress:
    class: ""
    tlsSecretName: ""
  mspID: OrdererMSP
  ordererType: etcdraft
  orgName: OrdererOrg
  useChannelLess: true
  systemChannelName: testchainid
  resources:
    init:
      limits:
        cpu: 100m
        memory: 200M
      requests:
        cpu: 10m
        memory: 10M
    orderer:
      limits:
        cpu: 600m
        memory: 1200M
      requests:
        cpu: 10m
        memory: 10M
    proxy:
      limits:
        cpu: 100m
        memory: 200M
      requests:
        cpu: 10m
        memory: 10M
  service:
    type: ClusterIP
  storage:
    orderer:
      class: "${STORAGE_CLASS}"
      size: 5G
