From 355cabb2dcdbc03e555b83827dd8d1e5e01fdc94 Mon Sep 17 00:00:00 2001 From: Yuanmao Zhu Date: Sun, 5 Feb 2023 15:44:11 -0500 Subject: [PATCH 1/2] Remove the modules that have not been developed and unused code Signed-off-by: Yuanmao Zhu --- .../docker/agent/ansible/Dockerfile.in | 38 -- cmd/cmd/create.go | 79 --- cmd/cmd/delete.go | 53 -- cmd/cmd/get.go | 113 ---- cmd/cmd/root.go | 100 ---- cmd/cmd/token.go | 31 - cmd/cmd/version.go | 24 - cmd/internal/agent.go | 137 ----- cmd/internal/login.go | 50 -- cmd/internal/node.go | 102 ---- cmd/internal/organization.go | 102 ---- cmd/internal/user.go | 101 ---- cmd/main.go | 12 - cmd/model/agent.go | 39 -- cmd/model/config.go | 10 - cmd/model/node.go | 35 -- cmd/model/organization.go | 26 - cmd/model/token.go | 17 - cmd/model/user.go | 29 - docs/agents/ansible.md | 95 --- go.mod | 13 - go.sum | 51 -- src/agent/ansible/.gitignore | 4 - src/agent/ansible/ansible.cfg | 4 - src/agent/ansible/group_vars/all.yml | 6 - src/agent/ansible/hosts | 1 - .../ansible/roles/common/config_apply.yml | 213 ------- .../ansible/roles/common/config_destroy.yml | 5 - .../ansible/roles/common/publicports.yml | 47 -- src/agent/ansible/roles/deploy_k8s/README.md | 1 - .../deploy_k8s/certsetup/tasks/apply.yml | 108 ---- .../deploy_k8s/certsetup/tasks/destroy.yml | 1 - .../certsetup/templates/configtx.j2 | 215 ------- .../deploy_k8s/certsetup/templates/core.j2 | 326 ----------- .../certsetup/templates/crypto-config.j2 | 50 -- .../templates/fabric-ca-server-config.j2 | 29 - .../deploy_k8s/certsetup/templates/policy.j2 | 14 - .../deploy_k8s/fabricsetup/tasks/apply.yml | 357 ------------ .../deploy_k8s/fabricsetup/tasks/destroy.yml | 36 -- .../fabricsetup/templates/bndsamplerconfig.j2 | 12 - .../fabricsetup/templates/certssetup.j2 | 20 - .../fabricsetup/templates/cli-k8s.j2 | 38 -- .../fabricsetup/templates/dochannel.j2 | 149 ----- .../fabricsetup/templates/fabric-pod.j2 | 439 -------------- .../fabricsetup/templates/fabric-services.j2 | 197 ------- .../fabricsetup/templates/firstcode.go | 199 ------- .../fabricsetup/templates/namespace.j2 | 11 - .../deploy_k8s/fabricsetup/templates/pvc.j2 | 13 - .../fabricsetup/templates/secrets.j2 | 12 - .../roles/deploy_k8s/getbin/tasks/apply.yml | 23 - .../roles/deploy_k8s/getbin/tasks/destroy.yml | 1 - src/agent/ansible/roles/deploy_k8s/plays.yml | 19 - .../roles/deploy_k8s/priconn/tasks/apply.yml | 18 - .../deploy_k8s/priconn/tasks/destroy.yml | 1 - .../priconn/templates/connection.j2 | 86 --- .../deploy_k8s/priconn/templates/connyaml.j2 | 71 --- .../deploy_k8s/priconn/templates/metriccfg.j2 | 21 - .../roles/deploy_k8s/pubconn/tasks/apply.yml | 31 - .../deploy_k8s/pubconn/tasks/destroy.yml | 1 - .../pubconn/templates/connection.j2 | 107 ---- .../deploy_k8s/pubconn/templates/connyaml.j2 | 87 --- .../deploy_k8s/pubconn/templates/metriccfg.j2 | 20 - .../pubconn/templates/ordererendpoints.j2 | 13 - src/agent/ansible/setupfabric.yml | 21 - src/agent/ansible/vars/bc1st.yml | 123 ---- src/agent/ansible/vars/bc2nd.yml | 84 --- src/agent/ansible/vars/ordereronly.yml | 37 -- src/agent/ansible/vars/peeronly.yml | 45 -- src/agent/ansible/vars/resource.yml | 43 -- src/agent/ansible/vars/vb1st.yml | 93 --- src/agent/fabric-operator/.gitignore | 78 --- src/agent/fabric-operator/Dockerfile | 29 - src/agent/fabric-operator/README.md | 124 ---- src/agent/fabric-operator/agent/Dockerfile | 22 - .../fabric-operator/agent/agent_operation.sh | 30 - src/agent/fabric-operator/agent/create.sh | 155 ----- src/agent/fabric-operator/agent/delete.sh | 32 -- .../fabric-operator/agent/download_files.sh | 20 - .../agent/samples/peer_config.json | 36 -- src/agent/fabric-operator/build/Dockerfile | 15 - .../fabric-operator/build/bin/entrypoint | 12 - .../build/bin/scripts/ca_config.sh | 1 - .../build/bin/scripts/ca_config.yaml | 26 - .../build/bin/scripts/orderer_config.sh | 14 - .../build/bin/scripts/orderer_configtx.yaml | 149 ----- .../build/bin/scripts/peer_config.sh | 13 - .../build/bin/templates/ca/ca_secret.yaml | 7 - .../build/bin/templates/ca/ca_service.yaml | 13 - .../bin/templates/ca/ca_statefulset.yaml | 71 --- .../bin/templates/orderer/orderer_secret.yaml | 5 - .../templates/orderer/orderer_service.yaml | 13 - .../orderer/orderer_statefulset.yaml | 80 --- .../build/bin/templates/peer/peer_secret.yaml | 5 - .../bin/templates/peer/peer_service.yaml | 13 - .../bin/templates/peer/peer_statefulset.yaml | 82 --- .../fabric-operator/build/bin/user_setup | 13 - src/agent/fabric-operator/cmd/manager/main.go | 162 ------ .../deploy/crds/fabric_v1alpha1_crd.yaml | 357 ------------ .../deploy/crs/fabric_v1alpha1_ca_cr.yaml | 45 -- .../crs/fabric_v1alpha1_orderer_cr.yaml | 37 -- .../deploy/crs/fabric_v1alpha1_peer_cr.yaml | 40 -- .../deploy/fabric-operator.yaml | 145 ----- src/agent/fabric-operator/go.mod | 32 -- src/agent/fabric-operator/go.sum | 544 ------------------ .../pkg/apis/addtoscheme_fabric_v1alpha1.go | 10 - src/agent/fabric-operator/pkg/apis/apis.go | 13 - .../fabric-operator/pkg/apis/fabric/group.go | 6 - .../fabric-operator/pkg/apis/fabric/utils.go | 126 ---- .../pkg/apis/fabric/v1alpha1/ca_types.go | 55 -- .../pkg/apis/fabric/v1alpha1/doc.go | 4 - .../pkg/apis/fabric/v1alpha1/helper.go | 68 --- .../pkg/apis/fabric/v1alpha1/orderer_types.go | 34 -- .../pkg/apis/fabric/v1alpha1/peer_types.go | 34 -- .../pkg/apis/fabric/v1alpha1/register.go | 19 - .../fabric/v1alpha1/zz_generated.deepcopy.go | 355 ------------ .../fabric/v1alpha1/zz_generated.openapi.go | 467 --------------- .../fabric-operator/pkg/controller/add_ca.go | 10 - .../pkg/controller/add_orderer.go | 10 - .../pkg/controller/add_peer.go | 10 - .../pkg/controller/ca/ca_controller.go | 344 ----------- .../pkg/controller/controller.go | 18 - .../controller/orderer/orderer_controller.go | 334 ----------- .../pkg/controller/peer/peer_controller.go | 337 ----------- src/agent/fabric-operator/tools.go | 7 - src/agent/fabric-operator/version/version.go | 5 - 125 files changed, 9395 deletions(-) delete mode 100644 build_image/docker/agent/ansible/Dockerfile.in delete mode 100644 cmd/cmd/create.go delete mode 100644 cmd/cmd/delete.go delete mode 100644 cmd/cmd/get.go delete mode 100644 cmd/cmd/root.go delete mode 100644 cmd/cmd/token.go delete mode 100644 cmd/cmd/version.go delete mode 100644 cmd/internal/agent.go delete mode 100644 cmd/internal/login.go delete mode 100644 cmd/internal/node.go delete mode 100644 cmd/internal/organization.go delete mode 100644 cmd/internal/user.go delete mode 100644 cmd/main.go delete mode 100644 cmd/model/agent.go delete mode 100644 cmd/model/config.go delete mode 100644 cmd/model/node.go delete mode 100644 cmd/model/organization.go delete mode 100644 cmd/model/token.go delete mode 100644 cmd/model/user.go delete mode 100644 docs/agents/ansible.md delete mode 100644 go.mod delete mode 100644 go.sum delete mode 100644 src/agent/ansible/.gitignore delete mode 100755 src/agent/ansible/ansible.cfg delete mode 100755 src/agent/ansible/group_vars/all.yml delete mode 100644 src/agent/ansible/hosts delete mode 100755 src/agent/ansible/roles/common/config_apply.yml delete mode 100755 src/agent/ansible/roles/common/config_destroy.yml delete mode 100755 src/agent/ansible/roles/common/publicports.yml delete mode 100644 src/agent/ansible/roles/deploy_k8s/README.md delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/tasks/apply.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/tasks/destroy.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/templates/configtx.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/templates/core.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/templates/crypto-config.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/templates/fabric-ca-server-config.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/certsetup/templates/policy.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/apply.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/destroy.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/bndsamplerconfig.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/certssetup.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/cli-k8s.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/dochannel.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-pod.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-services.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/firstcode.go delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/namespace.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/pvc.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/secrets.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/getbin/tasks/apply.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/getbin/tasks/destroy.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/plays.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/priconn/tasks/apply.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/priconn/tasks/destroy.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/priconn/templates/connection.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/priconn/templates/connyaml.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/priconn/templates/metriccfg.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/pubconn/tasks/apply.yml delete mode 100755 src/agent/ansible/roles/deploy_k8s/pubconn/tasks/destroy.yml delete mode 100644 src/agent/ansible/roles/deploy_k8s/pubconn/templates/connection.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/pubconn/templates/connyaml.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/pubconn/templates/metriccfg.j2 delete mode 100755 src/agent/ansible/roles/deploy_k8s/pubconn/templates/ordererendpoints.j2 delete mode 100755 src/agent/ansible/setupfabric.yml delete mode 100755 src/agent/ansible/vars/bc1st.yml delete mode 100755 src/agent/ansible/vars/bc2nd.yml delete mode 100755 src/agent/ansible/vars/ordereronly.yml delete mode 100755 src/agent/ansible/vars/peeronly.yml delete mode 100644 src/agent/ansible/vars/resource.yml delete mode 100755 src/agent/ansible/vars/vb1st.yml delete mode 100644 src/agent/fabric-operator/.gitignore delete mode 100644 src/agent/fabric-operator/Dockerfile delete mode 100755 src/agent/fabric-operator/README.md delete mode 100644 src/agent/fabric-operator/agent/Dockerfile delete mode 100644 src/agent/fabric-operator/agent/agent_operation.sh delete mode 100755 src/agent/fabric-operator/agent/create.sh delete mode 100644 src/agent/fabric-operator/agent/delete.sh delete mode 100755 src/agent/fabric-operator/agent/download_files.sh delete mode 100644 src/agent/fabric-operator/agent/samples/peer_config.json delete mode 100644 src/agent/fabric-operator/build/Dockerfile delete mode 100755 src/agent/fabric-operator/build/bin/entrypoint delete mode 100755 src/agent/fabric-operator/build/bin/scripts/ca_config.sh delete mode 100755 src/agent/fabric-operator/build/bin/scripts/ca_config.yaml delete mode 100644 src/agent/fabric-operator/build/bin/scripts/orderer_config.sh delete mode 100644 src/agent/fabric-operator/build/bin/scripts/orderer_configtx.yaml delete mode 100644 src/agent/fabric-operator/build/bin/scripts/peer_config.sh delete mode 100644 src/agent/fabric-operator/build/bin/templates/ca/ca_secret.yaml delete mode 100755 src/agent/fabric-operator/build/bin/templates/ca/ca_service.yaml delete mode 100755 src/agent/fabric-operator/build/bin/templates/ca/ca_statefulset.yaml delete mode 100644 src/agent/fabric-operator/build/bin/templates/orderer/orderer_secret.yaml delete mode 100755 src/agent/fabric-operator/build/bin/templates/orderer/orderer_service.yaml delete mode 100755 src/agent/fabric-operator/build/bin/templates/orderer/orderer_statefulset.yaml delete mode 100644 src/agent/fabric-operator/build/bin/templates/peer/peer_secret.yaml delete mode 100755 src/agent/fabric-operator/build/bin/templates/peer/peer_service.yaml delete mode 100755 src/agent/fabric-operator/build/bin/templates/peer/peer_statefulset.yaml delete mode 100755 src/agent/fabric-operator/build/bin/user_setup delete mode 100644 src/agent/fabric-operator/cmd/manager/main.go delete mode 100644 src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_crd.yaml delete mode 100755 src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml delete mode 100755 src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml delete mode 100755 src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml delete mode 100755 src/agent/fabric-operator/deploy/fabric-operator.yaml delete mode 100644 src/agent/fabric-operator/go.mod delete mode 100644 src/agent/fabric-operator/go.sum delete mode 100644 src/agent/fabric-operator/pkg/apis/addtoscheme_fabric_v1alpha1.go delete mode 100644 src/agent/fabric-operator/pkg/apis/apis.go delete mode 100755 src/agent/fabric-operator/pkg/apis/fabric/group.go delete mode 100755 src/agent/fabric-operator/pkg/apis/fabric/utils.go delete mode 100755 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/ca_types.go delete mode 100644 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/doc.go delete mode 100755 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/helper.go delete mode 100755 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/orderer_types.go delete mode 100755 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/peer_types.go delete mode 100644 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/register.go delete mode 100644 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.deepcopy.go delete mode 100644 src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.openapi.go delete mode 100644 src/agent/fabric-operator/pkg/controller/add_ca.go delete mode 100644 src/agent/fabric-operator/pkg/controller/add_orderer.go delete mode 100644 src/agent/fabric-operator/pkg/controller/add_peer.go delete mode 100755 src/agent/fabric-operator/pkg/controller/ca/ca_controller.go delete mode 100644 src/agent/fabric-operator/pkg/controller/controller.go delete mode 100644 src/agent/fabric-operator/pkg/controller/orderer/orderer_controller.go delete mode 100644 src/agent/fabric-operator/pkg/controller/peer/peer_controller.go delete mode 100644 src/agent/fabric-operator/tools.go delete mode 100644 src/agent/fabric-operator/version/version.go diff --git a/build_image/docker/agent/ansible/Dockerfile.in b/build_image/docker/agent/ansible/Dockerfile.in deleted file mode 100644 index 312c7b436..000000000 --- a/build_image/docker/agent/ansible/Dockerfile.in +++ /dev/null @@ -1,38 +0,0 @@ -# Dockerfile for hyperledger cello ansible agent -# -# @see https://github.com/hyperledger/cello/blob/master/docs/worker_ansible_howto.md -# -FROM python:3.6 -MAINTAINER Hyperledger Cello Team - -ARG user=ubuntu -ARG uid=1000 -ARG gid=1000 - -RUN apt-get update && \ - apt-get install -y bash curl python-dev sudo \ - python3-pip build-essential openssh-client libffi-dev \ - libssl-dev && \ - pip install --upgrade pip ansible pyyaml && \ - groupadd -g ${gid} ${user} && \ - useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \ - usermod -a -G root ${user} && \ - echo "${user} ALL=(ALL) NOPASSWD: ALL"|tee /etc/sudoers.d/${user} && \ - mkdir -p /opt/agent/.ssh && \ - cd /opt/agent/.ssh && \ - echo "host *" > config && \ - echo " StrictHostKeyChecking no" >> config && \ - echo " UserKnownHostsFile /dev/null" >> config - -ADD src/agent/ansible /opt/agent -RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ - mv kubectl /usr/local/bin/kubectl -RUN chown -R ${uid}:${gid} /opt/agent && \ - chmod 755 /usr/local/bin/kubectl - -ENV HOME /opt/agent -ENV WORKDIR /opt/agent -WORKDIR /opt/agent -USER ${user} - -CMD [ "ansible-playbook", "--version" ] diff --git a/cmd/cmd/create.go b/cmd/cmd/create.go deleted file mode 100644 index c7febba7c..000000000 --- a/cmd/cmd/create.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package cmd - -import ( - "github.com/hyperledger/cello/cmd/internal" - "github.com/hyperledger/cello/cmd/model" - "github.com/spf13/cobra" - "gopkg.in/yaml.v2" - "io/ioutil" -) - -var file string - -var createCmd = &cobra.Command{ - Use: "create", - Short: "Create resource in cell service from a file", - Long: ` -Create resource in cello service from a file, - -supported kind: Agent,Organization,Node. - -Examples: - $ Create a agent using the data in agent.yaml - celloctl create -f ./agent.yaml -`, - Run: func(cmd *cobra.Command, args []string) { - source, err := ioutil.ReadFile(file) - if err != nil { - panic(err) - } - var config model.Config - err = yaml.Unmarshal(source, &config) - if err != nil { - panic(err) - } - switch config.Kind { - case "Agent": - err := internal.CreateAgent(source) - if err != nil { - panic(err) - } - break - case "Organization": - err := internal.CreateOrganization(source) - if err != nil { - panic(err) - } - break - case "Node": - err := internal.CreateNode(source) - if err != nil { - panic(err) - } - break - case "User": - err := internal.CreateUser(source) - if err != nil { - panic(err) - } - break - default: - break - } - }, -} - -func init() { - RootCmd.AddCommand(createCmd) - - createCmd.Flags().StringVarP(&file, "file", "f", "", "yaml file for create") - err := createCmd.MarkFlagRequired("file") - if err != nil { - panic(err) - } -} diff --git a/cmd/cmd/delete.go b/cmd/cmd/delete.go deleted file mode 100644 index 754eabf29..000000000 --- a/cmd/cmd/delete.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package cmd - -import ( - "github.com/hyperledger/cello/cmd/internal" - "github.com/spf13/cobra" -) - -var deleteCmd = &cobra.Command{ - Use: "delete", - Short: "Delete resource in cell service", - Long: ` -Delete resource in cello service, - -supported kind: Agent,Organization,Node - -Examples: - $ Delete a agent using agent id. - celloctl delete agent 1 - `, - Args: cobra.MinimumNArgs(2), - Run: func(cmd *cobra.Command, args []string) { - switch args[0] { - case "agent", "Agent": - err := internal.DeleteAgent(args[1]) - if err != nil { - panic(err) - } - break - case "org", "organization": - err := internal.DeleteOrganization(args[1]) - if err != nil { - panic(err) - } - break - case "node", "Node": - err := internal.DeleteNode(args[1]) - if err != nil { - panic(err) - } - default: - break - } - }, -} - -func init() { - RootCmd.AddCommand(deleteCmd) -} diff --git a/cmd/cmd/get.go b/cmd/cmd/get.go deleted file mode 100644 index 981c8103a..000000000 --- a/cmd/cmd/get.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package cmd - -import ( - "fmt" - "github.com/hyperledger/cello/cmd/internal" - "github.com/jedib0t/go-pretty/table" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "os" - "strings" -) - -var page int -var pageSize int - -var getCmd = &cobra.Command{ - Use: "get", - Short: "Get resource in cell service", - Long: `Get resource in cello service, - supported kind: agent,organization`, - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - if len(args) == 0 { - fmt.Println("Please input type to get, agent") - os.Exit(1) - } - types := strings.Split(args[0], ",") - for _, resourceType := range types { - switch resourceType { - case "agent": - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - baseUrl := viper.GetString("server.url") - agentListResponse, err := internal.ListAgents(baseUrl, token) - if err != nil { - panic(err) - } else { - t := table.NewWriter() - t.SetOutputMirror(os.Stdout) - t.AppendHeader(table.Row{"#", "Name", "Type", "Worker API", "Capacity", "Node Capacity", "Status", "Create Time", "Organization"}) - for _, value := range agentListResponse.Agents { - t.AppendRow([]interface{}{value.ID, value.Name, value.Type, value.WorkerAPI, value.Capacity, value.NodeCapacity, value.Status, value.CreateTime, value.OrgID}) - } - t.AppendFooter(table.Row{"", "", "", "", "", "", "", "Total", agentListResponse.Total}) - fmt.Println("Agent") - t.Render() - } - break - case "organization", "org": - organizationListResponse, err := internal.ListOrganization() - if err != nil { - panic(err) - } else { - t := table.NewWriter() - t.SetOutputMirror(os.Stdout) - t.AppendHeader(table.Row{"#", "Name", "Create Time"}) - for _, value := range organizationListResponse.Organizations { - t.AppendRow([]interface{}{value.ID, value.Name, value.CreateTime}) - } - t.AppendFooter(table.Row{"", "Total", organizationListResponse.Total}) - fmt.Println("Organization") - t.Render() - } - break - case "node": - nodeListResponse, err := internal.ListNodes() - if err != nil { - panic(err) - } else { - t := table.NewWriter() - t.SetOutputMirror(os.Stdout) - t.AppendHeader(table.Row{"#", "Name", "Type", "Network", "Create Time"}) - for _, value := range nodeListResponse.Nodes { - network := fmt.Sprintf("%s-%s", value.NetworkType, value.NetworkVersion) - t.AppendRow([]interface{}{value.ID, value.Name, value.Type, network, value.CreateTime}) - } - t.AppendFooter(table.Row{"", "", "", "Total", nodeListResponse.Total}) - fmt.Println("Node") - t.Render() - } - break - case "user": - userListResponse, err := internal.ListUsers(page, pageSize) - if err != nil { - panic(err) - } else { - t := table.NewWriter() - t.SetOutputMirror(os.Stdout) - t.AppendHeader(table.Row{"#", "Username", "Role"}) - for _, value := range userListResponse.Users { - t.AppendRow([]interface{}{value.ID, value.Username, value.Role}) - } - t.AppendFooter(table.Row{"", "Total", userListResponse.Total}) - fmt.Println("User") - t.Render() - } - default: - break - } - } - }, -} - -func init() { - RootCmd.AddCommand(getCmd) - - getCmd.Flags().IntVarP(&page, "page", "p", 1, "page to query") - getCmd.Flags().IntVarP(&pageSize, "pageSize", "s", 10, "page size to query") -} diff --git a/cmd/cmd/root.go b/cmd/cmd/root.go deleted file mode 100644 index 19c2d375c..000000000 --- a/cmd/cmd/root.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -package cmd - -import ( - "fmt" - "github.com/hyperledger/cello/cmd/internal" - "os" - - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -var cfgFile string - -type UserInfo struct { - ID string `json:"pk"` - Name string `json:"username"` - Email string `json:"email"` -} - -type TokenResponse struct { - Token string `json:"token"` - User UserInfo `json:"user"` -} - -// RootCmd represents the base command when called without any subcommands -var RootCmd = &cobra.Command{ - Use: "celloctl", - Short: "Cello ctl is a tool to manage cello api service", - Long: ` -This application can manage all cello api service, to control Networks of hyperledger deployment. - -The default config store directory is, $HOME/.cello or /etc/cello, you can create config.yaml under these folders. -`, - // Uncomment the following line if your bare application - // has an action associated with it: - // Run: func(cmd *cobra.Command, args []string) { }, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - token := viper.GetString("auth.token") - if token == "" { - err := internal.Login(viper.GetString("server.url")) - if err != nil { - panic(err) - } - } - }, -} - -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() { - if err := RootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} - -func init() { - cobra.OnInitialize(initConfig) - - // Here you will define your flags and configuration settings. - // Cobra supports persistent flags, which, if defined here, - // will be global for your application. - RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cello/config.yaml)") - - // Cobra also supports local flags, which will only run - // when this action is called directly. - RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} - -// initConfig reads in config file and ENV variables if set. -func initConfig() { - if cfgFile != "" { - // Use config file from the flag. - viper.SetConfigFile(cfgFile) - } else { - // Search config in home directory with name ".cobra-example" (without extension). - viper.AddConfigPath("$HOME/.cello") - viper.AddConfigPath("/etc/cello/") - viper.SetConfigType("yaml") - viper.SetConfigName("config") - } - - err := viper.ReadInConfig() - if err != nil { - panic(fmt.Errorf("Fatal error config file: %s \n", err)) - } - - viper.AutomaticEnv() // read in environment variables that match - - // If a config file is found, read it in. - if err := viper.ReadInConfig(); err != nil { - panic(err) - } -} \ No newline at end of file diff --git a/cmd/cmd/token.go b/cmd/cmd/token.go deleted file mode 100644 index 72bccb51e..000000000 --- a/cmd/cmd/token.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package cmd - -import ( - "fmt" - "github.com/hyperledger/cello/cmd/internal" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func init() { - RootCmd.AddCommand(tokenCmd) -} - -var tokenCmd = &cobra.Command{ - Use: "refresh-token", - Short: "Refresh user token", - Long: `Refresh token`, - Run: func(cmd *cobra.Command, args []string) { - err := internal.Login(viper.GetString("server.url")) - if err != nil { - panic(err) - } else { - fmt.Printf("Refresh token success.") - } - }, -} diff --git a/cmd/cmd/version.go b/cmd/cmd/version.go deleted file mode 100644 index b7f03d18d..000000000 --- a/cmd/cmd/version.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package cmd - -import ( - "fmt" - "github.com/spf13/cobra" -) - -func init() { - RootCmd.AddCommand(versionCmd) -} - -var versionCmd = &cobra.Command{ - Use: "version", - Short: "Print the version number of cello client", - Long: `Show version number of cello client`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Cello Client v0.1 -- HEAD") - }, -} diff --git a/cmd/internal/agent.go b/cmd/internal/agent.go deleted file mode 100644 index ad7d442cc..000000000 --- a/cmd/internal/agent.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package internal - -import ( - "errors" - "fmt" - ghYaml "github.com/ghodss/yaml" - "github.com/hyperledger/cello/cmd/model" - "github.com/levigross/grequests" - "github.com/spf13/viper" - "gopkg.in/yaml.v2" - "log" -) - -var agentBaseUrl = "agents" - -func ListAgents(baseUrl string, token string) (*model.AgentListResponse, error) { - url := fmt.Sprintf("%s/%s", baseUrl, agentBaseUrl) - resp, err := grequests.Get(url, &grequests.RequestOptions{Headers: map[string]string{ - "Authorization": token, - }}) - - if err != nil { - log.Fatalln("Unable to make request: ", err) - return nil, errors.New("list agents failed") - } - if resp.Ok != true { - log.Printf("Get agents failed %v %v", resp.StatusCode, resp.String()) - return nil, errors.New("list agents failed") - } else { - var agentListResponse model.AgentListResponse - err := resp.JSON(&agentListResponse) - if err != nil { - panic(err) - } - - return &agentListResponse, nil - } -} - -func parseAgentSpec(source [] byte) (*model.AgentSpec, error) { - var agentSpec model.AgentSpec - err := yaml.Unmarshal(source, &agentSpec) - if err != nil { - return nil, err - } else { - return &agentSpec, nil - } -} - -func CreateAgent(source []byte) error { - agentSpec, err := parseAgentSpec(source) - if err != nil { - panic(err) - } - yamlOuts, err := yaml.Marshal(agentSpec.Spec) - if err != nil { - panic(err) - } - jsonOuts, err := ghYaml.YAMLToJSON(yamlOuts) - if err != nil { - panic(err) - } - - url := fmt.Sprintf("%s/%s", viper.GetString("server.url"), agentBaseUrl) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - - switch agentSpec.Spec.Type { - case "docker": - resp, err := grequests.Post(url, &grequests.RequestOptions{JSON: jsonOuts, Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - fmt.Printf("Create agent failed") - return err - } else { - fmt.Printf(resp.String()) - } - break - case "kubernetes": - fd, err := grequests.FileUploadFromDisk(agentSpec.Spec.K8sConfigFile) - if err != nil { - panic(err) - } - fd[0].FieldName = "k8s_config_file" - x := map[string] string { - "name": agentSpec.Spec.Name, - "type": agentSpec.Spec.Type, - "capacity": fmt.Sprint(agentSpec.Spec.Capacity), - "log_level": agentSpec.Spec.LogLevel, - "node_capacity": fmt.Sprint(agentSpec.Spec.NodeCapacity), - "schedulable": fmt.Sprint(agentSpec.Spec.Schedulable), - } - resp, err := grequests.Post(url, - &grequests.RequestOptions{ - Files: fd, - Data: x, - Headers: map[string] string { - "Authorization": token, - }, - }) - if err != nil { - fmt.Printf("Create agent failed") - return err - } else { - fmt.Printf(resp.String()) - } - break - default: - fmt.Printf("Unknow type for agent") - return nil - } - return nil -} - -func DeleteAgent(id string) error { - url := fmt.Sprintf("%s/%s/%s", viper.GetString("server.url"), agentBaseUrl, id) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - resp, err := grequests.Delete(url, &grequests.RequestOptions{Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - return err - } else { - if resp.StatusCode != 204 { - errMsg := fmt.Sprintf("delete agent %s failed, %s", id, resp.String()) - return errors.New(errMsg) - } else { - fmt.Printf("Delete agent %s success\n", id) - } - } - return nil -} diff --git a/cmd/internal/login.go b/cmd/internal/login.go deleted file mode 100644 index 5da2c3885..000000000 --- a/cmd/internal/login.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package internal - -import ( - "errors" - "fmt" - "github.com/hyperledger/cello/cmd/model" - "github.com/levigross/grequests" - "github.com/spf13/viper" - "log" -) - -var loginBaseUrl = "auth" - -func Login(baseUrl string) error { - authUrl := fmt.Sprintf("%s/%s", baseUrl, loginBaseUrl) - resp, err := grequests.Post(authUrl, &grequests.RequestOptions{JSON: map[string]string{ - "username": viper.GetString("auth.username"), - "password": viper.GetString("auth.password"), - }}) - // You can modify the request by passing an optional RequestOptions struct - - if err != nil { - log.Fatalln("Unable to make request: ", err) - return err - } - - if resp.Ok != true { - log.Printf("Get token failed") - return errors.New("get token failed") - } else { - var token model.TokenResponse - err := resp.JSON(&token) - if err != nil { - panic(err) - } - viper.Set("auth.token", token.Token) - viper.Set("auth.email", token.User.Email) - writeErr := viper.WriteConfig() - if writeErr != nil { - return writeErr - } - } - - return nil -} diff --git a/cmd/internal/node.go b/cmd/internal/node.go deleted file mode 100644 index 8ba09e59e..000000000 --- a/cmd/internal/node.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package internal - -import ( - "errors" - "fmt" - ghYaml "github.com/ghodss/yaml" - "github.com/hyperledger/cello/cmd/model" - "github.com/levigross/grequests" - "github.com/spf13/viper" - "gopkg.in/yaml.v2" - "log" -) - -var nodeBaseUrl = "nodes" - -func ListNodes() (*model.NodeListResponse, error) { - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - baseUrl := viper.GetString("server.url") - url := fmt.Sprintf("%s/%s", baseUrl, nodeBaseUrl) - resp, err := grequests.Get(url, &grequests.RequestOptions{Headers: map[string]string{ - "Authorization": token, - }}) - - if err != nil { - log.Fatalln("Unable to make request: ", err) - return nil, errors.New("list agents failed") - } - if resp.Ok != true { - log.Printf("Get agents failed %v %v", resp.StatusCode, resp.String()) - return nil, errors.New("list agents failed") - } else { - var nodeListResponse model.NodeListResponse - err := resp.JSON(&nodeListResponse) - if err != nil { - panic(err) - } - - return &nodeListResponse, nil - } -} - -func parseNodeSpec(source [] byte) (*model.NodeSpec, error) { - var nodeSpec model.NodeSpec - err := yaml.Unmarshal(source, &nodeSpec) - if err != nil { - return nil, err - } else { - return &nodeSpec, nil - } -} - -func CreateNode(source []byte) error { - agentSpec, err := parseNodeSpec(source) - if err != nil { - panic(err) - } - yamlOuts, err := yaml.Marshal(agentSpec.Spec) - if err != nil { - panic(err) - } - jsonOuts, err := ghYaml.YAMLToJSON(yamlOuts) - if err != nil { - panic(err) - } - - url := fmt.Sprintf("%s/%s", viper.GetString("server.url"), nodeBaseUrl) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - resp, err := grequests.Post(url, &grequests.RequestOptions{JSON: jsonOuts, Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - fmt.Printf("Create node failed") - return err - } else { - fmt.Printf(resp.String()) - } - return nil -} - -func DeleteNode(id string) error { - url := fmt.Sprintf("%s/%s/%s", viper.GetString("server.url"), nodeBaseUrl, id) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - resp, err := grequests.Delete(url, &grequests.RequestOptions{Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - return err - } else { - if resp.StatusCode != 204 { - errMsg := fmt.Sprintf("delete node %s failed, %s", id, resp.String()) - return errors.New(errMsg) - } else { - fmt.Printf("Delete node %s success\n", id) - } - } - return nil -} diff --git a/cmd/internal/organization.go b/cmd/internal/organization.go deleted file mode 100644 index 57076fcb2..000000000 --- a/cmd/internal/organization.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package internal - -import ( - "errors" - "fmt" - ghYaml "github.com/ghodss/yaml" - "github.com/hyperledger/cello/cmd/model" - "github.com/levigross/grequests" - "github.com/spf13/viper" - "gopkg.in/yaml.v2" - "log" -) - -var organizationBaseUrl = "organizations" - -func ListOrganization() (*model.OrganizationListResponse, error) { - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - baseUrl := viper.GetString("server.url") - url := fmt.Sprintf("%s/%s", baseUrl, organizationBaseUrl) - resp, err := grequests.Get(url, &grequests.RequestOptions{Headers: map[string]string{ - "Authorization": token, - }}) - - if err != nil { - log.Fatalln("Unable to make request: ", err) - return nil, errors.New("list agents failed") - } - if resp.Ok != true { - log.Printf("Get agents failed %v %v", resp.StatusCode, resp.String()) - return nil, errors.New("list agents failed") - } else { - var organizationListResponse model.OrganizationListResponse - err := resp.JSON(&organizationListResponse) - if err != nil { - panic(err) - } - - return &organizationListResponse, nil - } -} - -func parseOrganizationSpec(source [] byte) (*model.OrganizationSpec, error) { - var organizationSpec model.OrganizationSpec - err := yaml.Unmarshal(source, &organizationSpec) - if err != nil { - return nil, err - } else { - return &organizationSpec, nil - } -} - -func CreateOrganization(source []byte) error { - agentSpec, err := parseOrganizationSpec(source) - if err != nil { - panic(err) - } - yamlOuts, err := yaml.Marshal(agentSpec.Spec) - if err != nil { - panic(err) - } - jsonOuts, err := ghYaml.YAMLToJSON(yamlOuts) - if err != nil { - panic(err) - } - - url := fmt.Sprintf("%s/%s", viper.GetString("server.url"), organizationBaseUrl) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - resp, err := grequests.Post(url, &grequests.RequestOptions{JSON: jsonOuts, Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - fmt.Printf("Create agent failed") - return err - } else { - fmt.Printf(resp.String()) - } - return nil -} - -func DeleteOrganization(id string) error { - url := fmt.Sprintf("%s/%s/%s", viper.GetString("server.url"), organizationBaseUrl, id) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - resp, err := grequests.Delete(url, &grequests.RequestOptions{Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - return err - } else { - if resp.StatusCode != 204 { - errMsg := fmt.Sprintf("delete organization %s failed, %s", id, resp.String()) - return errors.New(errMsg) - } else { - fmt.Printf("Delete organization %s success\n", id) - } - } - return nil -} diff --git a/cmd/internal/user.go b/cmd/internal/user.go deleted file mode 100644 index 7ed6dd036..000000000 --- a/cmd/internal/user.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package internal - -import ( - "errors" - "fmt" - ghYaml "github.com/ghodss/yaml" - "github.com/hyperledger/cello/cmd/model" - "github.com/levigross/grequests" - "github.com/spf13/viper" - "gopkg.in/yaml.v2" - "log" -) - -var userBaseUrl = "users" - -func ListUsers(page int, pageSize int) (*model.UserListResponse, error) { - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - baseUrl := viper.GetString("server.url") - url := fmt.Sprintf("%s/%s", baseUrl, userBaseUrl) - resp, err := grequests.Get(url, &grequests.RequestOptions{Headers: map[string]string{ - "Authorization": token, - }, Params: map[string]string{"page": fmt.Sprint(page), "per_page": fmt.Sprint(pageSize)}}) - - if err != nil { - log.Fatalln("Unable to make request: ", err) - return nil, errors.New("list agents failed") - } - if resp.Ok != true { - log.Printf("Get agents failed %v %v", resp.StatusCode, resp.String()) - return nil, errors.New("list agents failed") - } else { - var userListResponse model.UserListResponse - err := resp.JSON(&userListResponse) - if err != nil { - panic(err) - } - - return &userListResponse, nil - } -} - -func parseUserSpec(source [] byte) ([] byte, error) { - var userSpec model.UserSpec - err := yaml.Unmarshal(source, &userSpec) - if err != nil { - return nil, err - } else { - yamlOuts, err := yaml.Marshal(userSpec.Spec) - if err != nil { - panic(err) - } - jsonOuts, err := ghYaml.YAMLToJSON(yamlOuts) - if err != nil { - panic(err) - } - return jsonOuts, nil - } -} - -func CreateUser(source []byte) error { - jsonOuts, err := parseUserSpec(source) - if err != nil { - panic(err) - } - url := fmt.Sprintf("%s/%s", viper.GetString("server.url"), userBaseUrl) - token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) - resp, err := grequests.Post(url, &grequests.RequestOptions{JSON: jsonOuts, Headers: map[string] string { - "Authorization": token, - }}) - if err != nil { - fmt.Printf("Create user failed") - return err - } else { - fmt.Printf(resp.String()) - } - return nil -} -// -//func DeleteAgent(id string) error { -// url := fmt.Sprintf("%s/%s/%s", viper.GetString("server.url"), agentBaseUrl, id) -// token := fmt.Sprintf("JWT %s", viper.GetString("auth.token")) -// resp, err := grequests.Delete(url, &grequests.RequestOptions{Headers: map[string] string { -// "Authorization": token, -// }}) -// if err != nil { -// return err -// } else { -// if resp.StatusCode != 204 { -// errMsg := fmt.Sprintf("delete agent %s failed, %s", id, resp.String()) -// return errors.New(errMsg) -// } else { -// fmt.Printf("Delete agent %s success\n", id) -// } -// } -// return nil -//} diff --git a/cmd/main.go b/cmd/main.go deleted file mode 100644 index 471f1de12..000000000 --- a/cmd/main.go +++ /dev/null @@ -1,12 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package main - -import "github.com/hyperledger/cello/cmd/cmd" - -func main() { - cmd.Execute() -} \ No newline at end of file diff --git a/cmd/model/agent.go b/cmd/model/agent.go deleted file mode 100644 index 753c2c909..000000000 --- a/cmd/model/agent.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package model - -type AgentData struct { - ID string `json:"id"` - Name string `json:"name"` - WorkerAPI string `json:"worker_api"` - Capacity int32 `json:"capacity"` - NodeCapacity int32 `json:"node_capacity"` - Status string `json:"status"` - CreateTime string `json:"created_at"` - Type string `json:"type"` - OrgID string `json:"organization_id"` -} - -type AgentListResponse struct { - Total int32 `json:"total"` - Agents [] AgentData `json:"data"` -} - -type AgentSpecInfo struct { - Name string `yaml:"name"` - WorkerApi string `yaml:"worker_api"` - Capacity int32 `yaml:"capacity"` - NodeCapacity int32 `yaml:"node_capacity"` - LogLevel string `yaml:"log_level"` - Type string `yaml:"type"` - Schedulable bool `yaml:"schedulable"` - K8sConfigFile string `yaml:"k8s_config"` -} - -type AgentSpec struct { - Spec AgentSpecInfo `yaml:"spec"` -} - diff --git a/cmd/model/config.go b/cmd/model/config.go deleted file mode 100644 index ced343614..000000000 --- a/cmd/model/config.go +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package model - -type Config struct { - Kind string `yaml:"kind"` -} diff --git a/cmd/model/node.go b/cmd/model/node.go deleted file mode 100644 index 5eb94e13c..000000000 --- a/cmd/model/node.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package model - - -type NodeData struct { - ID string `json:"id"` - Type string `json:"type"` - Name string `json:"name"` - NetworkType string `json:"network_type"` - NetworkVersion string `json:"network_version"` - CreateTime string `json:"created_at"` - AgentID string `json:"agent_id"` - NetworkID string `json:"network_id"` -} - -type NodeListResponse struct { - Total int32 `json:"total"` - Nodes [] NodeData `json:"data"` -} - -type NodeSpecInfo struct { - Name string `yaml:"name"` - NetworkType string `yaml:"network_type"` - NetworkVersion string `yaml:"network_version"` - Type string `yaml:"type"` - AgentType string `yaml:"agent_type"` -} - -type NodeSpec struct { - Spec NodeSpecInfo `yaml:"spec"` -} diff --git a/cmd/model/organization.go b/cmd/model/organization.go deleted file mode 100644 index 386ff3dbe..000000000 --- a/cmd/model/organization.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package model - - -type OrganizationData struct { - ID string `json:"id"` - Name string `json:"name"` - CreateTime string `json:"created_at"` -} - -type OrganizationListResponse struct { - Total int32 `json:"total"` - Organizations [] OrganizationData `json:"data"` -} - -type OrganizationSpecInfo struct { - Name string `yaml:"name"` -} - -type OrganizationSpec struct { - Spec OrganizationSpecInfo `yaml:"spec"` -} diff --git a/cmd/model/token.go b/cmd/model/token.go deleted file mode 100644 index 970759855..000000000 --- a/cmd/model/token.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package model - -type UserInfo struct { - ID string `json:"pk"` - Name string `json:"username"` - Email string `json:"email"` -} - -type TokenResponse struct { - Token string `json:"token"` - User UserInfo `json:"user"` -} diff --git a/cmd/model/user.go b/cmd/model/user.go deleted file mode 100644 index 19d742aed..000000000 --- a/cmd/model/user.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ -package model - -type UserData struct { - ID string `json:"id"` - Username string `json:"username"` - Role string `json:"role"` -} - -type UserListResponse struct { - Total int32 `json:"total"` - Users [] UserData `json:"data"` -} - -type UserSpecInfo struct { - Username string `yaml:"username"` - Password string `yaml:"password"` - Role string `yaml:"role"` - Email string `yaml:"email"` - Organization string `yaml:"organization"` -} - -type UserSpec struct { - Spec UserSpecInfo `yaml:"spec"` -} diff --git a/docs/agents/ansible.md b/docs/agents/ansible.md deleted file mode 100644 index 0e5bc55c4..000000000 --- a/docs/agents/ansible.md +++ /dev/null @@ -1,95 +0,0 @@ -Cello Ansible agent docker container how-to -=========================================== - -Cello Ansible agent is a set of Ansible playbooks which allows developers and -Fabric network operators to stand up a Hyperledger Fabric network very quickly -in a k8s cluster. - -The following is the list of the general steps you can follow to use the -Ansible agent docker image to stand up your own fabric network: - -1. [Get the docker image](#get-the-docker-image) -2. [Create configuration files](#create-configuration-files) -3. [Setup fabric network](#setup-fabric-network) - - -## Get the docker image - -The Ansible agent docker image is available on docker hub, use the following -command to pull it: - -``` - docker pull hyperledger/cello-ansible-agent:latest - docker run --rm hyperledger/cello-ansible-agent:latest ansible --version -``` -The results should show ansible configuration and version number. If you are -getting errors, then you may have not had docker engine installed. Please refer -offical [docker installation](#https://docs.docker.com/install/) document to -install your docker. - -## Create configuration files - -To stand up a fabric network, you will need a set of files, here is the list - - 1. K8s configuration file, to get access to a k8s cluster - 2. Network spec file, to define fabric network layout - 3. Resource file, k8s resource allocation for each type of fabric nodes - -The k8s configuration file is needed to gain access to a k8s cluster. Many cloud -providers provide the k8s configuration file for you to download once you have -a k8s cluster. If no direct download, these providers most likely provides you -a way to create such file. - -The Fabric network spec file defines how your Fabric network will look, -how many organizations you would like to create, how many peers and orderers -each organization has, and how many kafka and zookeeper containers will be set -up. Additionally, it defines what names will be given to organizations, peers, -orderers etc. This file defines the topology of your Fabric network, and a good -understanding of this file is essential in order to create the Fabric network -you like. - -The resource file allows you to allocate k8s resources such as cpu and memory for -each type of nodes in your fabric network, for example, peer and orderer. - -[Download sample network sepc files and resource files](https://github.com/hyperledger/cello/tree/master/src/operator-dashboard/agent/ansible/vars) - -Sample fabric network spec -[bc1st.yml](https://github.com/hyperledger/cello/tree/master/src/operator-dashboard/agent/ansible/vars/bc1st.yml) and -[bc2nd.yml](https://github.com/hyperledger/cello/tree/master/src/operator-dashboard/agent/ansible/vars/bc2nd.yml) - -Sample resource file [resource.yml](https://github.com/hyperledger/cello/tree/master/src/operator-dashboard/agent/ansible/vars/resource.yml) - - -Follow the below process to prepare for setting up your fabric network: - -``` - 1. Create a directory named vars, any file mentioned must be in this directory - 2. Name your k8s configuration file kubeconfig - 3. Download or create your own network spec file, name it networkspec.yml - 4. Download or create your own resource file, name it resource.yml -``` - -## Set up and destroy the Fabric network - -This step will stand up a fabric network based on your network spec file - -``` - docker run --rm -v $(pwd)/vars:/opt/agent/vars hyperledger/cello-ansible-agent \ - ansible-playbook -i hosts -e "mode=apply env=networkspec" setupfabric.yml -``` - -To remove everything the above step created, run the following command: - -``` - docker run --rm -v $(pwd)/vars:/opt/agent/vars hyperledger/cello-ansible-agent \ - ansible-playbook -i hosts -e "mode=destroy env=networkspec" setupfabric.yml -``` - -Notice the only difference between these two commands is the word `apply` and `destroy` - - -Creative Commons License
-This work is licensed under a - -Creative Commons Attribution 4.0 International License. diff --git a/go.mod b/go.mod deleted file mode 100644 index c5ca21013..000000000 --- a/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module github.com/hyperledger/cello/cmd - -go 1.12 - -require ( - github.com/ghodss/yaml v1.0.0 // indirect - github.com/google/go-querystring v1.0.0 // indirect - github.com/jedib0t/go-pretty v4.0.2+incompatible // indirect - github.com/levigross/grequests v0.0.0-20190130132859-37c80f76a0da // indirect - github.com/spf13/cobra v0.0.3 // indirect - github.com/spf13/viper v1.3.2 // indirect - golang.org/x/net v0.0.0-20190328230028-74de082e2cca // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 8b771f7bc..000000000 --- a/go.sum +++ /dev/null @@ -1,51 +0,0 @@ -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/jedib0t/go-pretty v4.0.2+incompatible h1:bU7rhIKsGljSXgWOdElmiciqy+5AWbDpdmBJwl55PPg= -github.com/jedib0t/go-pretty v4.0.2+incompatible/go.mod h1:XemHduiw8R651AF9Pt4FwCTKeG3oo7hrHJAoznj9nag= -github.com/levigross/grequests v0.0.0-20190130132859-37c80f76a0da h1:ixpx9UaTDElZrjbd9GeOVG4Deut0FFumoeel7PvVNm4= -github.com/levigross/grequests v0.0.0-20190130132859-37c80f76a0da/go.mod h1:uCZIhROSrVmuF/BPYFPwDeiiQ6juSLp0kikFoEcNcEs= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190328230028-74de082e2cca h1:hyA6yiAgbUwuWqtscNvWAI7U1CtlaD1KilQ6iudt1aI= -golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a h1:1n5lsVfiQW3yfsRGu98756EH1YthsFqr/5mxHduZW2A= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/src/agent/ansible/.gitignore b/src/agent/ansible/.gitignore deleted file mode 100644 index 53e146cc3..000000000 --- a/src/agent/ansible/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ansible modules -run/* -vars/* -*.retry diff --git a/src/agent/ansible/ansible.cfg b/src/agent/ansible/ansible.cfg deleted file mode 100755 index c0fdf8499..000000000 --- a/src/agent/ansible/ansible.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[defaults] -log_path=./vars/ansible.log -inventory = ./hosts -host_key_checking = False diff --git a/src/agent/ansible/group_vars/all.yml b/src/agent/ansible/group_vars/all.yml deleted file mode 100755 index 0ce61c0f5..000000000 --- a/src/agent/ansible/group_vars/all.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -etcdtoken: "{{ lookup('password', - '/tmp/etcdtoken chars=ascii_letters,digits length=16') }}" - -proxy_env: { -} \ No newline at end of file diff --git a/src/agent/ansible/hosts b/src/agent/ansible/hosts deleted file mode 100644 index c023aec5b..000000000 --- a/src/agent/ansible/hosts +++ /dev/null @@ -1 +0,0 @@ -cloud ansible_host=127.0.0.1 ansible_python_interpreter=python diff --git a/src/agent/ansible/roles/common/config_apply.yml b/src/agent/ansible/roles/common/config_apply.yml deleted file mode 100755 index 01a6cff32..000000000 --- a/src/agent/ansible/roles/common/config_apply.yml +++ /dev/null @@ -1,213 +0,0 @@ ---- -- name: Setup and initialize variables - set_fact: - fabricworkdir: "{{ pjroot }}/vars/{{ env }}/fabric" - fabricpath: "{{ pjroot }}/vars/{{ env }}" - pjrun: "{{ pjroot }}/vars/{{ env }}/run" - peers: "{{ [] }}" - orderers: "{{ [] }}" - cas: "{{ [] }}" - kafkas: "{{ [] }}" - zookeepers: "{{ [] }}" - znodes: "" - zkparam: "" - index: 1 - zoo_ids: "{{ {} }}" - kafka_ids: "{{ {} }}" - zookeeperls: "{{ [] }}" - kafkals: "{{ [] }}" - peerls: "{{ [] }}" - ordererls: "{{ [] }}" - cals: "{{ [] }}" - allpeers: "{{ [] }}" - allcas: "{{ [] }}" - allorderers: "{{ [] }}" - clipeer: "{}" - cliorderer: "{}" - tls: "{}" - mutualtls: "{}" - allcerts: "{{ [] }}" - tag: "{{ fabric.baseimage_tag.split('-') }}" - -- name: Set project_version value - set_fact: - project_version: "{{ fabric.baseimage_tag }}" - when: >- - 'stable' in fabric.baseimage_tag or - 'latest' in fabric.baseimage_tag or - (tag|length) == 1 - -- name: Set project_version value - set_fact: - project_version: "{{ tag[1] }}" - when: >- - 'stable' not in fabric.baseimage_tag and - 'latest' not in fabric.baseimage_tag and - (tag|length) > 1 - -- name: Set deployment namespace - set_fact: - namespace: "{{ fabric.namespace | default('default') | lower }}" - -- name: Generate namespace - set_fact: - namespace: "{{ (ansible_date_time.iso8601_micro | to_uuid | lower)[:8] }}" - when: namespace == 'generate' - -- name: Make sure that working directory exists - file: - path: "{{ pjrun }}" - state: "directory" - mode: 0775 - -- name: Create component list - set_fact: - cals: "{{ cals | default([]) + item.value.cas | default([]) }}" - ordererls: "{{ ordererls | default([]) + item.value.orderers | default([]) }}" - peerls: "{{ peerls | default([]) + item.value.peers | default([]) }}" - zookeeperls: "{{ zookeeperls | default([]) + item.value.zookeepers | default([]) }}" - kafkals: "{{ kafkals | default([]) + item.value.kafkas | default([]) }}" - with_dict: "{{ fabric.network }}" - -- name: Sort component list - set_fact: - zookeeperls: "{{ zookeeperls | sort }}" - kafkals: "{{ kafkals | sort }}" - -- name: Generate zookeeper node list - set_fact: - znodes: "{{ znodes }} server.{{ index }}={{ item }}:2888:3888" - zkparam: "{{ zkparam + item }}:2181 " - zoo_ids: "{{ zoo_ids | combine({item: index}) }}" - index: "{{ index | int + 1 }}" - with_items: "{{ zookeeperls | default([]) }}" - -- name: Reset the index - set_fact: - index: 1 - -- name: Generate kafka broker ids - set_fact: - kafka_ids: "{{ kafka_ids | combine({item: index}) }}" - index: "{{ index | int + 1 }}" - with_items: "{{ kafkals | default([]) }}" - -- name: Get all ca object list - set_fact: - allcas: | - {{ allcas | default([]) + [{ 'org':item.split('.')[-1], - 'name':item | replace('.', '-') }] }} - with_items: "{{ cals }}" - -- name: Get all peer object list - set_fact: - allpeers: | - {{ allpeers | default([]) + [{'org':item.split('@')[1].split('.')[-1], - 'name':item.split('@')[1] | replace('.', '-'), - 'role':item.split('@')[0]}] }} - with_items: "{{ peerls }}" - -- name: Get all orderer object list - set_fact: - allorderers: | - {{ allorderers | default([]) + [{ 'org':item.split('.')[-1], - 'name':item | replace('.', '-') }] }} - with_items: "{{ ordererls }}" - -- name: Select a peer to run channel and chaincode command - set_fact: - clipeer: "{{ allpeers | random }}" - when: allpeers | default([]) | length > 0 - -- name: Select an orderer to run channel and chaincode command - set_fact: - cliorderer: "{{ allorderers | random }}" - when: allorderers | default([]) | length > 0 - -- name: Get ca, peer and orderer orgs - set_fact: - caorgs: "{{ allcas | default([]) | map(attribute='org') | list | unique | sort }}" - peerorgs: "{{ allpeers | default([]) | map(attribute='org') | list | unique | sort }}" - ordererorgs: "{{ allorderers | default([]) | map(attribute='org') | list | unique | sort }}" - -- name: Create all orgs list - set_fact: - allorgs: "{{ (caorgs + peerorgs + ordererorgs) | sort | unique }}" - -- name: TLS - set_fact: - tls: "{{ fabric.tls | default('true') }}" - mutualtls: "false" - when: fabric.tls != "client" - -- name: Mutual tls - set_fact: - mutualtls: "true" - tls: "true" - when: fabric.tls == "client" - -- name: Initialize sets - set_fact: - orderer_rootca: "{{ [] }}" - peerorg_rootca: "{{ [] }}" - peers_rootca: "{{ [] }}" - -- name: Create peerorg rootca list - set_fact: - peerorg_rootca: | - {{ peerorg_rootca | default([]) | replace('+', ',') }} + [ '/etc/hyperledger/fabric/artifacts/keyfiles/{{ item }}/ca/ca.{{ item }}-cert.pem' ] - with_items: "{{ peerorgs }}" - when: fabric.tls != false - -- name: Create peers rootca list - set_fact: - peers_rootca: | - {{ peers_rootca | default([]) | replace('+', ',') }} + [ '/etc/hyperledger/fabric/artifacts/keyfiles/{{ item }}/tlsca/tlsca.{{ item }}-cert.pem' ] - with_items: "{{ peerorgs }}" - when: fabric.tls != false - -- name: Create all org admin certs list - set_fact: - allcerts: >- - {{ allcerts | default([]) + - [ '/etc/hyperledger/fabric/artifacts/keyfiles/'+item+'/users/Admin@'+item+'/tls/client.crt' ] + - [ '/etc/hyperledger/fabric/artifacts/keyfiles/'+item+'/ca/ca.'+item+'-cert.pem' ] + - [ '/etc/hyperledger/fabric/artifacts/keyfiles/'+item+'/tlsca/tlsca.'+item+'-cert.pem' ] }} - with_items: "{{ allorgs }}" - when: fabric.tls != false - -- debug: - var: allcerts - -- name: Create orderers rootca list - set_fact: - orderer_rootca: | - {{ orderer_rootca | default([]) | replace('+', ',') }} + [ '/etc/hyperledger/fabric/artifacts/keyfiles/{{ item}}/tlsca/tlsca.{{ item }}-cert.pem' ] - with_items: "{{ ordererorgs }}" - when: fabric.tls != false - -- name: Make orderer rootca list unique - set_fact: - orderer_rootca: "{{ orderer_rootca | unique }}" - when: fabric.tls != false - -- name: Joining the orderer rootca list and peerorg rootca list - set_fact: - rootca: "{{ peerorg_rootca }} + {{ peers_rootca }} + {{ orderer_rootca }}" - when: fabric.tls != false - -- name: Make rootca list unique - set_fact: - rootca: "{{ allcerts | unique }}" - when: fabric.tls != false - -- name: Query node names - command: >- - kubectl --kubeconfig kubeconfig get nodes - -o=jsonpath={.items[*].metadata.name} - register: nodenames - args: - chdir: "{{ playbook_dir }}/../../vars/" - -- set_fact: - k8snodes: "{{ nodenames.stdout.split(' ') }}" diff --git a/src/agent/ansible/roles/common/config_destroy.yml b/src/agent/ansible/roles/common/config_destroy.yml deleted file mode 100755 index 85c4bbd80..000000000 --- a/src/agent/ansible/roles/common/config_destroy.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Make sure that working directory is clean - file: - path: "{{ pjroot }}/vars/{{ env }}/fabric/run" - state: "absent" diff --git a/src/agent/ansible/roles/common/publicports.yml b/src/agent/ansible/roles/common/publicports.yml deleted file mode 100755 index 28e0d865c..000000000 --- a/src/agent/ansible/roles/common/publicports.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- name: Query node public ip address - command: >- - kubectl --kubeconfig kubeconfig get nodes -o - jsonpath={.items[*].status.addresses[?\(@.type==\'ExternalIP\'\)].address} - register: ips - args: - chdir: "{{ playbook_dir }}/../../vars/" - -- name: Query service ports - shell: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} get services - | grep NodePort | awk '{print $1, $5}' - register: ports - args: - chdir: "{{ playbook_dir }}/../../vars/" - -- set_fact: - allips: "{{ ips.stdout.split(' ') }}" - k8sports: [] - sports: {} - -- set_fact: - k8sports: >- - {{ k8sports + - [{ 'name':item.split(' ')[0], 'value':(item.split(' ')[1]|replace('/TCP','')).split(',') }] }} - with_items: "{{ ports.stdout_lines }}" - -- set_fact: - sports: >- - {{ k8sports | subelements('value', skip_missing=True) }} - -- set_fact: - k8sports: {} - k8shosts: {} - -- set_fact: - k8sports: >- - {{ k8sports|combine( {item[0].name+':'+item[1].split(':')[0]:item[1].split(':')[1]} ) }} - k8shosts: >- - {{ k8shosts|combine( {item[0].name:allips|random} ) }} - with_items: "{{ [sports] }}" - -- debug: - var: k8sports -- debug: - var: k8shosts diff --git a/src/agent/ansible/roles/deploy_k8s/README.md b/src/agent/ansible/roles/deploy_k8s/README.md deleted file mode 100644 index 3ce520d54..000000000 --- a/src/agent/ansible/roles/deploy_k8s/README.md +++ /dev/null @@ -1 +0,0 @@ -Use kubernetes API to deploy fabric network onto kubernetes diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/tasks/apply.yml b/src/agent/ansible/roles/deploy_k8s/certsetup/tasks/apply.yml deleted file mode 100755 index f44b20dcc..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/tasks/apply.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -- name: Ensure certificate directory is clean - file: - path: "{{ fabricworkdir }}/keyfiles" - state: "{{ item }}" - with_items: - - "absent" - - "directory" - -- name: Create crypto-config file - template: - src: "{{ playbook_dir }}/certsetup/templates/crypto-config.j2" - dest: "{{ fabricworkdir }}/crypto-config.yml" - -- name: Create the certificate files - command: "{{ fabricpath }}/bin/cryptogen generate --config crypto-config.yml --output keyfiles" - args: - chdir: "{{ fabricworkdir }}" - -- name: Combine all orgs into one location - shell: >- - if [ -d '{{ item }}' ]; then mv {{ item }}/* . && rm -rf {{ item }}; fi - args: - chdir: "{{ fabricworkdir }}/keyfiles" - with_items: - - "peerOrganizations" - - "ordererOrganizations" - -- name: Rename admin private key - shell: >- - ls *_sk | cat -n | while read n f; do cp "$f" "admin_private.key"; done - args: - chdir: "{{ fabricworkdir }}/keyfiles/{{ item }}/users/Admin@{{ item }}/msp/keystore" - with_items: "{{ allorgs }}" - -- name: Rename ca private key - shell: >- - ls *_sk|cat -n|while read n f; do mv "$f" "ca_private.key"; done - args: - chdir: "{{ fabricworkdir }}/keyfiles/{{ item }}/ca" - with_items: "{{ allorgs }}" - -- name: Rename ca tls private key - shell: >- - ls *_sk|cat -n|while read n f; do mv "$f" "tlsca_private.key"; done - args: - chdir: "{{ fabricworkdir }}/keyfiles/{{ item }}/tlsca" - with_items: "{{ allorgs }}" - -- name: Add admin cert onto org msp directory - shell: >- - cp users/Admin@{{ item }}/msp/signcerts/* msp/admincerts - args: - chdir: "{{ fabricworkdir }}/keyfiles/{{ item }}" - with_items: "{{ allorgs }}" - -- include_tasks: "{{ playbook_dir }}/pubconn/tasks/apply.yml" - when: fabric.k8s.exposeserviceport == true - -- include_tasks: "{{ playbook_dir }}/priconn/tasks/apply.yml" - when: fabric.k8s.exposeserviceport == false - -- name: Create endorsement policy file - template: - src: "{{ playbook_dir }}/certsetup/templates/policy.j2" - dest: "{{ fabricworkdir }}/keyfiles/policy.json" - -- name: Create core.yml file for every peer - template: - src: "{{ playbook_dir }}/certsetup/templates/core.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item.org }}/peers/{{ item.name }}.{{ item.org }}/core.yaml" - with_items: "{{ allpeers }}" - -- name: Create config tx file - template: - src: "{{ playbook_dir }}/certsetup/templates/configtx.j2" - dest: "{{ fabricworkdir }}/configtx.yml" - -- name: Create the gensis block and channel transaction - shell: >- - export FABRIC_CFG_PATH={{ fabricworkdir }} && - {{ fabricpath }}/bin/configtxgen -profile OrdererGenesis - -outputBlock keyfiles/genesis.block -channelID orderersystemchannel && - {{ fabricpath }}/bin/configtxgen -profile OrgChannel - -outputCreateChannelTx keyfiles/firstchannel.tx -channelID firstchannel - args: - chdir: "{{ fabricworkdir }}" - when: allorderers | length > 0 - -- name: Create org join request json file - shell: >- - export FABRIC_CFG_PATH={{ fabricworkdir }} && - {{ fabricpath }}/bin/configtxgen -printOrg {{ item }} > keyfiles/{{item}}/JoinRequest_{{item}}.json - args: - chdir: "{{ fabricworkdir }}" - when: peerorgs | length > 0 - with_items: "{{ peerorgs }}" - -- name: Create ca config file - template: - src: "{{ playbook_dir }}/certsetup/templates/fabric-ca-server-config.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item.org }}/ca/fabric-ca-server-config.yaml" - with_items: "{{ cas }}" - -- name: Create a zip file of all certificates - archive: - path: "{{ fabricworkdir }}/keyfiles" - dest: "{{ fabricworkdir }}/certs.tgz" diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/tasks/destroy.yml b/src/agent/ansible/roles/deploy_k8s/certsetup/tasks/destroy.yml deleted file mode 100755 index ed97d539c..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/tasks/destroy.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/configtx.j2 b/src/agent/ansible/roles/deploy_k8s/certsetup/templates/configtx.j2 deleted file mode 100755 index 76656fe41..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/configtx.j2 +++ /dev/null @@ -1,215 +0,0 @@ ---- -{% if allorgs | length > 0 %} -Organizations: -{% for org in allorgs %} - - &{{ org }} - Name: {{ org }} - ID: {{ org }} - MSPDir: keyfiles/{{ org }}/msp -{% if org in peerorgs %} -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Policies: - Readers: - Type: Signature - Rule: "OR('{{ org }}.admin', '{{ org }}.peer')" - Writers: - Type: Signature - Rule: "OR('{{ org }}.admin', '{{ org }}.client')" - Admins: - Type: Signature - Rule: "OR('{{ org }}.admin')" -{% endif %} - - AnchorPeers: -{% for peer in allpeers %} -{% if peer.org == org and fabric.k8s.exposeserviceport == true %} - - Host: {{ k8shosts[peer.name] }} - Port: {{ k8sports[peer.name+':7051'] }} -{% elif peer.org == org %} - - Host: {{ peer.name }} - Port: 7051 -{% endif %} -{% endfor %} -{% elif org in ordererorgs %} -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Policies: - Readers: - Type: Signature - Rule: "OR('{{ org }}.member')" - Writers: - Type: Signature - Rule: "OR('{{ org }}.member')" - Admins: - Type: Signature - Rule: "OR('{{ org }}.admin')" -{% endif %} -{% endif %} -{% endfor %} -{% endif %} - -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} -Capabilities: - Global: &ChannelCapabilities -{% if project_version is version_compare('1.4.3','>=') %} - V1_4_3: true -{% elif project_version is version_compare('1.4.2','>=') and project_version is version_compare('1.4.3','<') %} - V1_4_2: true -{% elif project_version is version_compare('1.3.0','>=') and project_version is version_compare('1.4.2','<') %} - V1_3: true -{% elif project_version is version_compare('1.1.0','>=') and project_version is version_compare('1.3.0','<') %} - V1_1: true -{% endif %} - - Orderer: &OrdererCapabilities -{% if project_version is version_compare('1.4.2','>=') %} - V1_4_2: true -{% else %} - V1_1: true -{% endif %} - - Application: &ApplicationCapabilities -{% if project_version is version_compare('1.4.2','>=') %} - V1_4_2: true -{% elif project_version is version_compare('1.3.0','>=') and project_version is version_compare('1.4.1','<=') %} - V1_3: true -{% elif project_version is version_compare('1.2.0','>=') and project_version is version_compare('1.3.0','<') %} - V1_2: true -{% elif project_version is version_compare('1.1.0','>=') and project_version is version_compare('1.2.0','<') %} - V1_1: true -{% endif %} -{% endif %} - -{% if allorderers is defined and ( allorderers|length > 0) %} -Orderer: &OrdererDefaults - OrdererType: {{ fabric.consensus_type | default('kafka') }} - Addresses: -{% if fabric.k8s.exposeserviceport == true %} -{% for orderer in allorderers %} - - {{ k8shosts[orderer.name] }}:{{ k8sports[orderer.name+':7050'] }} -{% endfor %} -{% else %} -{% for orderer in allorderers %} - - {{ orderer.name }}:7050 -{% endfor %} -{% endif %} - -{% if fabric.orderersettings is defined and fabric.orderersettings.config is defined %} - {{ fabric.orderersettings.config | to_nice_yaml | indent(2, False) -}} -{% endif %} - -{% if kafkals | length > 0 %} - Kafka: - Brokers: -{% for item in kafkals %} - - {{ item }}:9092 -{% endfor %} -{% endif %} - -{% if (project_version is version_compare('1.4.1','>=') or ('stable' in project_version or 'latest' in project_version)) and fabric.consensus_type is defined and fabric.consensus_type == 'etcdraft' %} - EtcdRaft: - Consenters: -{% for orderer in allorderers %} - - Host: {{ orderer.name }} - Port: 7050 - ClientTLSCert: keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/tls/server.crt - ServerTLSCert: keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/tls/server.crt -{% endfor %} -{% if fabric.raftsettings is defined and fabric.consensus_type == 'etcdraft' %} - {{ fabric.raftsettings | to_nice_yaml | indent(2, False) -}} -{% endif %} -{% endif %} - - Organizations: -{% for org in ordererorgs %} - - *{{ org }} -{% endfor %} - -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Policies: - Readers: - Type: ImplicitMeta - Rule: "ANY Readers" - Writers: - Type: ImplicitMeta - Rule: "ANY Writers" - Admins: - Type: ImplicitMeta - Rule: "MAJORITY Admins" - BlockValidation: - Type: ImplicitMeta - Rule: "ANY Writers" -{% endif %} - -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Capabilities: - <<: *OrdererCapabilities -{% endif %} -{% endif %} - -Application: &ApplicationDefaults - Organizations: -{% for org in peerorgs %} - - *{{ org }} -{% endfor %} -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Policies: - Readers: - Type: ImplicitMeta - Rule: "ANY Readers" - Writers: - Type: ImplicitMeta - Rule: "ANY Writers" - Admins: - Type: ImplicitMeta - Rule: "MAJORITY Admins" -{% endif %} - -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Capabilities: - <<: *ApplicationCapabilities -{% endif %} - -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} -Channel: &ChannelDefaults - Policies: - Readers: - Type: ImplicitMeta - Rule: "ANY Readers" - Writers: - Type: ImplicitMeta - Rule: "ANY Writers" - Admins: - Type: ImplicitMeta - Rule: "MAJORITY Admins" - Capabilities: - <<: *ChannelCapabilities -{% endif %} - -Profiles: - OrgChannel: - Consortium: FabricConsortium - Application: - <<: *ApplicationDefaults -{% if (project_version is version_compare('1.4.1','>=') or ('stable' in project_version or 'latest' in project_version)) and fabric.consensus_type is defined and fabric.consensus_type == 'etcdraft' %} - <<: *ChannelDefaults - Orderer: - <<: *OrdererDefaults -{% endif %} - OrdererGenesis: -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - <<: *ChannelDefaults -{% endif %} -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - Capabilities: - <<: *ChannelCapabilities -{% endif %} -{% if allorderers is defined and ( allorderers|length > 0) %} - Orderer: - <<: *OrdererDefaults -{% endif %} - Consortiums: - FabricConsortium: - Organizations: -{% for org in peerorgs %} - - *{{ org }} -{% endfor %} diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/core.j2 b/src/agent/ansible/roles/deploy_k8s/certsetup/templates/core.j2 deleted file mode 100755 index d347a9af1..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/core.j2 +++ /dev/null @@ -1,326 +0,0 @@ ---- -logging: -{% if project_version is version_compare('1.4.0','<') %} -{% if project_version is version_compare('1.1.0','>=') %} - level: info -{% else %} - peer: info -{% endif %} - cauthdsl: warning - gossip: warning - ledger: info - msp: warning - policies: warning - grpc: error -{% if project_version is version_compare('1.1.0','>=') %} - peer: - gossip: warning -{% endif %} - - format: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}' -{% endif %} - -peer: -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - id: jdoe - address: 0.0.0.0:7051 -{% endif %} - networkId: dev - listenAddress: 0.0.0.0:7051 - addressAutoDetect: false - gomaxprocs: -1 -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - keepalive: - minInterval: 60s - client: - interval: 60s - timeout: 20s - deliveryClient: - interval: 60s - timeout: 20s -{% endif %} - gossip: - bootstrap: 127.0.0.1:7051 - - endpoint: - maxBlockCountToStore: 100 - maxPropagationBurstLatency: 10ms - maxPropagationBurstSize: 10 - propagateIterations: 1 - propagatePeerNum: 3 - pullInterval: 4s - pullPeerNum: 3 - requestStateInfoInterval: 4s - publishStateInfoInterval: 4s - stateInfoRetentionInterval: - publishCertPeriod: 10s - skipBlockVerification: false - dialTimeout: 3s - connTimeout: 2s - recvBuffSize: 20 -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - sendBuffSize: 200 -{% else %} - sendBuffSize: 20 -{% endif %} - digestWaitTime: 1s - requestWaitTime: 1500ms - responseWaitTime: 2s - aliveTimeInterval: 5s - aliveExpirationTimeout: 25s - reconnectInterval: 25s - externalEndpoint: - election: - startupGracePeriod: 15s - membershipSampleInterval: 1s - leaderAliveThreshold: 10s - leaderElectionDuration: 5s - -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - pvtData: - pullRetryThreshold: 60s - transientstoreMaxBlockRetention: 1000 - pushAckTimeout: 3s -{% if project_version is version_compare('1.4.0','>=') or 'stable' in project_version or project_version == 'latest' %} - btlPullMargin: 10 - reconcileBatchSize: 10 - reconcileSleepInterval: 1m - reconciliationEnabled: true -{% endif %} -{% endif %} - - events: - address: 0.0.0.0:7053 - buffersize: 100 - timeout: 10ms -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - timewindow: 15m - keepalive: - minInterval: 60s -{% endif %} - - tls: - enabled: false - cert: - file: tls/server.crt - key: - file: tls/server.key - rootcert: - file: tls/ca.crt -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - clientAuthRequired: false - clientRootCAs: - files: - - tls/ca.crt - clientKey: - file: - clientCert: - file: -{% else %} - serverhostoverride: -{% endif %} - fileSystemPath: /var/hyperledger/production - - BCCSP: - Default: SW - SW: - Hash: SHA2 - Security: 256 - FileKeyStore: - KeyStore: - - mspConfigPath: msp - -{% if project_version is version_compare('1.1.0','>=') and project_version is version_compare('1.2.0','<') %} - localMspId: DEFAULT -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - localMspId: {{ item.org }} - client: - connTimeout: 3s -{% endif %} - - deliveryclient: -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - connTimeout: 3s - reConnectBackoffThreshold: 3600s -{% endif %} - reconnectTotalTimeThreshold: 3600s - - localMspType: bccsp -{% endif %} -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - adminService: - #listenAddress: 0.0.0.0:7055 -{% endif %} - profile: - enabled: false - listenAddress: 0.0.0.0:6060 - -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - handlers: - authFilters: - - - name: DefaultAuth - - - name: ExpirationCheck - decorators: - - - name: DefaultDecorator -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} - endorsers: - escc: - name: DefaultEndorsement - library: - validators: - vscc: - name: DefaultValidation - library: - discovery: - enabled: true - authCacheEnabled: true - authCacheMaxSize: 1000 - authCachePurgeRetentionRatio: 0.75 - orgMembersAllowedAccess: false -{% endif %} - validatorPoolSize: -{% endif %} - -vm: - endpoint: unix:///var/run/docker.sock - docker: - tls: - enabled: false - ca: - file: docker/ca.crt - cert: - file: docker/tls.crt - key: - file: docker/tls.key - - attachStdout: false - - hostConfig: -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - NetworkMode: host -{% else %} - NetworkMode: bridge -{% endif %} - Dns: - LogConfig: - Type: json-file - Config: - max-size: "50m" - max-file: "5" - Memory: 2147483648 - -chaincode: -{% if project_version is version_compare('1.1.0','<') %} - peerAddress: -{% endif %} - - id: - path: - name: - - builder: {{ fabric.repo.url }}fabric-ccenv:{{ fabric.baseimage_tag }} -{% if (project_version is version_compare('1.1.0','>=') and project_version is version_compare('2.0.0','<')) or 'latest' in project_version %} - pull: false - golang: - runtime: $(BASE_DOCKER_NS)/fabric-baseos:$(ARCH)-$(BASE_VERSION) - dynamicLink: false - node: - runtime: $(BASE_DOCKER_NS)/fabric-baseimage:$(ARCH)-$(BASE_VERSION) - car: - runtime: $(BASE_DOCKER_NS)/fabric-baseos:$(ARCH)-$(BASE_VERSION) - java: - Dockerfile: | - from $(DOCKER_NS)/fabric-javaenv:$(ARCH)-$(PROJECT_VERSION) -{% elif project_version is version_compare('2.0.0','>=') or 'stable' in project_version %} - pull: false - - golang: - runtime: {{ fabric.repo.url }}fabric-baseos:{{ fabric.baseimage_tag }} - dynamicLink: false - - car: - runtime: {{ fabric.repo.url }}fabric-baseos:{{ fabric.baseimage_tag }} - - java: - runtime: {{ fabric.repo.url }}fabric-javaenv:{{ fabric.baseimage_tag }} - - node: - runtime: {{ fabric.repo.url }}fabric-nodeenv:{{ fabric.baseimage_tag }} -{% endif %} - startuptimeout: 300s - executetimeout: 30s - mode: net - keepalive: 0 - - system: - cscc: enable - lscc: enable - escc: enable - vscc: enable - qscc: enable - -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - systemPlugins: -{% endif %} - logging: - level: info - shim: warning - format: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}' - -ledger: - - blockchain: - - state: - stateDatabase: goleveldb - totalQueryLimit: 100000 - couchDBConfig: - couchDBAddress: 127.0.0.1:5984 - username: - password: - maxRetries: 3 - maxRetriesOnStartup: 10 - requestTimeout: 35s -{% if project_version is version_compare('1.3.0','<') %} - queryLimit: 10000 -{% endif %} -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - maxBatchUpdateSize: 1000 - warmIndexesAfterNBlocks: 1 -{% if project_version is version_compare('1.3.0','>=') or 'stable' in project_version or project_version == 'latest' %} - createGlobalChangesDB: false - internalQueryLimit: 1000 -{% endif %} -{% endif %} - - history: - enableHistoryDatabase: true - -{% if project_version is version_compare('1.4.0','>=') or 'stable' in project_version or project_version == 'latest' %} -operations: - listenAddress: 127.0.0.1:9443 - tls: - enabled: false - cert: - file: - key: - file: - clientAuthRequired: false - clientRootCAs: - files: [] -metrics: -{% if fabric.metrics is defined and fabric.metrics%} - provider: prometheus -{% else %} - provider: disabled -{% endif %} - statsd: - network: udp - address: 127.0.0.1:8125 - writeInterval: 10s - prefix: -{% endif %} diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/crypto-config.j2 b/src/agent/ansible/roles/deploy_k8s/certsetup/templates/crypto-config.j2 deleted file mode 100755 index 5bcf48840..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/crypto-config.j2 +++ /dev/null @@ -1,50 +0,0 @@ ---- -{% if allorderers is defined and (allorderers | length > 0 ) %} -OrdererOrgs: -{% for org in ordererorgs %} - - Name: {{ org }} - Domain: {{ org }} - Specs: -{% for item in allorderers %} -{% if item.org == org %} - - Hostname: {{ item.name }} -{% if fabric.k8s.exposeserviceport == true%} - SANS: -{% for anip in allips %} - - {{ anip }} -{% endfor%} -{% for anode in k8snodes %} - - {{ anode }} -{% endfor %} -{% endif %} -{% endif %} -{% endfor %} -{% endfor %} -{% endif %} - -{% if allpeers is defined and (allpeers | length > 0) %} - -PeerOrgs: -{% for org in peerorgs %} - - Name: {{ org }} - Domain: {{ org }} -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - EnableNodeOUs: true -{% endif %} - Specs: -{% for item in allpeers %} -{% if item.org == org %} - - Hostname: {{ item.name }} -{% if fabric.k8s.exposeserviceport == true%} - SANS: -{% for anip in allips %} - - {{ anip }} -{% endfor%} -{% for anode in k8snodes %} - - {{ anode }} -{% endfor %} -{% endif %} -{% endif %} -{% endfor %} -{% endfor %} -{% endif %} diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/fabric-ca-server-config.j2 b/src/agent/ansible/roles/deploy_k8s/certsetup/templates/fabric-ca-server-config.j2 deleted file mode 100755 index a6864dbfd..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/fabric-ca-server-config.j2 +++ /dev/null @@ -1,29 +0,0 @@ -registry: - # Maximum number of times a password/secret can be reused for enrollment - # (default: -1, which means there is no limit) - maxenrollments: -1 - - # Contains identity information which is used when LDAP is disabled - identities: - - name: {{ fabric.ca.admin }} - pass: {{ fabric.ca.adminpw }} - type: client - affiliation: "" - maxenrollments: -1 - attrs: - hf.Registrar.Roles: "*" - hf.Registrar.DelegateRoles: "*" - hf.Revoker: true - hf.IntermediateCA: true -{% if project_version is version_compare('1.1.0','>=') or 'stable' in project_version or project_version == 'latest' %} - hf.GenCRL: true - hf.Registrar.Attributes: "*" - hf.AffiliationMgr: true -{% endif %} -ldap: - enabled: false - -affiliations: - {{ item.org }}: - - department1 - - department2 diff --git a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/policy.j2 b/src/agent/ansible/roles/deploy_k8s/certsetup/templates/policy.j2 deleted file mode 100755 index 4ed6c6244..000000000 --- a/src/agent/ansible/roles/deploy_k8s/certsetup/templates/policy.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{ - "identities": [ -{% for org in peerorgs %} - {"role": { "name": "member", "mspId": "{{ org }}" } }{{ '' if loop.last else ',' }} -{% endfor %} - ], - "policy": { - "{{ peerorgs | length }}-of": [ -{% for org in peerorgs %} - {"signed-by": {{ loop.index0 }} }{{ '' if loop.last else ',' }} -{% endfor %} - ] - } -} \ No newline at end of file diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/apply.yml b/src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/apply.yml deleted file mode 100755 index 803568dbd..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/apply.yml +++ /dev/null @@ -1,357 +0,0 @@ ---- -- name: Reuse common code - include_tasks: "{{ playbook_dir }}/../common/config_apply.yml" - -- name: Create deployment files for certssetup and pvc - template: - src: "{{ playbook_dir }}/fabricsetup/templates/{{ item }}.j2" - dest: "{{ pjrun }}/{{ item }}.yaml" - with_items: - - pvc - - certssetup - - cli-k8s - - namespace - -# Create the k8s services so that node addresses become available -- name: Create k8s service deployment files - template: - src: "{{ playbook_dir }}/../deploy_k8s/fabricsetup/templates/fabric-services.j2" - dest: "{{ pjrun }}/fabric-services.yml" - -- name: Create namespace - command: >- - kubectl --kubeconfig kubeconfig apply -f {{ pjrun }}/namespace.yaml - args: - chdir: "{{ playbook_dir }}/../../vars/" - when: namespace != 'default' - tags: "fabricup" - -- name: Start fabric services - command: >- - kubectl --kubeconfig kubeconfig apply -f {{ pjrun }}/fabric-services.yml - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "fabricup" - -# Wait for metrics daemon set to be ready -- name: Wait for metric daemon set to be ready - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - get ds nodemetricds -o - jsonpath='{ .status.desiredNumberScheduled }{"="}{ .status.numberReady}' - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: dsstatus - until: dsstatus.stdout.split('=')[0] == dsstatus.stdout.split('=')[1] - when: fabric.metrics is defined and fabric.metrics - retries: 50 - delay: 5 - -- name: Get metric daemon pod names - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - get pods -l name=nodemetricds -o - jsonpath='{range .items[*]}["{.metadata.name}","{.spec.nodeName}"],{end}' - args: - chdir: "{{ playbook_dir }}/../../vars/" - when: fabric.metrics is defined and fabric.metrics - register: dsstatus - -- set_fact: - dsnodes: >- - {{ '[' + dsstatus.stdout[0:(dsstatus.stdout|length|int-1)] + ']' }} - when: fabric.metrics is defined and fabric.metrics - -- name: Label daemon set pod - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - label pods {{ item[0] }} nodeName={{ item[1]|replace('.', '-') }} - --overwrite - args: - chdir: "{{ playbook_dir }}/../../vars/" - when: fabric.metrics is defined and fabric.metrics - with_list: "{{ dsnodes }}" - -- include_tasks: "{{ playbook_dir }}/../common/publicports.yml" - when: fabric.k8s.exposeserviceport == True - -- name: Initialize profileNode - set_fact: - profilenodes: [] - -- name: Add orderer profile nodes - set_fact: - profilenodes: "{{ allorderers|map(attribute='name')|list }}" - when: >- - fabric.orderersettings is defined and - fabric.orderersettings.ordererenv is defined and - fabric.orderersettings.ordererenv.ORDERER_GENERAL_PROFILE_ENABLED is defined and - fabric.orderersettings.ordererenv.ORDERER_GENERAL_PROFILE_ENABLED - -- name: Add peer profile nodes - set_fact: - profilenodes: "{{ profilenodes + (allpeers|map(attribute='name')|list) }}" - when: >- - fabric.peersettings is defined and - fabric.peersettings.CORE_PEER_PROFILE_ENABLED is defined and - fabric.peersettings.CORE_PEER_PROFILE_ENABLED - -- name: Create profile configuration file - template: - src: "{{ playbook_dir }}/../deploy_k8s/fabricsetup/templates/bndsamplerconfig.j2" - dest: "{{ fabricworkdir }}/keyfiles/bndsamplerconfig.json" - when: profilenodes | length > 0 - -- include_tasks: "{{ playbook_dir }}/../common/publicports.yml" - when: fabric.k8s.exposeserviceport == True - -- name: Create peer org member string - set_fact: - orgmembers: >- - {{ peerorgs|map('regex_replace','(.*)',"'\g<1>.member'")|list|join(',') }} - -- include_tasks: "{{ playbook_dir }}/certsetup/tasks/apply.yml" - when: fabric.generate_certs|default(true) == true - -- name: Create peer channel command script - template: - src: "{{ playbook_dir }}/../deploy_k8s/fabricsetup/templates/dochannel.j2" - dest: "{{ fabricworkdir }}/keyfiles/dochannel.sh" - mode: "u=rx,g=rx" - when: (allorderers | length > 0) and (allpeers | length > 0) - -- name: Create persistent volume - command: >- - kubectl --kubeconfig kubeconfig apply -f {{ pjrun }}/pvc.yaml - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "createpvc" - -- name: Query PVC status - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - get -o=custom-columns=STATUS:.status.phase - pvc fabriccerts - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: pvcstatus - until: pvcstatus.stdout.find("Bound") >= 0 - retries: 50 - delay: 10 - tags: "querypvc" - -- name: Create certs volume initialization pod - command: >- - kubectl --kubeconfig kubeconfig apply -f {{ pjrun }}/certssetup.yaml - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "createcertspod" - when: fabric.generate_certs|default(true) == true - -- name: Query initialization container status - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - get -o=custom-columns=STATUS:.status.phase - pod fabriccertspod - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: pvcstatus - until: pvcstatus.stdout.find("Running") >= 0 - retries: 5 - delay: 10 - tags: "querypvc" - when: fabric.generate_certs|default(true) == true - -- name: Check the status of secret for pulling images - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - get secrets -o=custom-columns=NAME:.metadata.name - regcred - args: - chdir: "{{ playbook_dir }}/../../vars/" - ignore_errors: yes - no_log: True - register: "secretstatus" - when: > - fabric.baseimage_tag | length > 0 and - fabric.repo.username | default("") | length > 0 and - fabric.repo.password | default("") | length > 0 - -- name: Create secret for image - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - create secret docker-registry regcred --docker-server={{ fabric.repo.url }} - --docker-username={{ fabric.repo.username }} --docker-password={{ fabric.repo.password }} - --docker-email=email@email.com - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: "secretcreate" - when: > - fabric.baseimage_tag | length > 0 and - fabric.repo.username | default("") | length > 0 and - fabric.repo.password | default("") | length > 0 and - secretstatus.rc != 0 - -- name: Clean up the Persistent volume - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - exec fabriccertspod -c task-pv-container - -- rm -rf /fabriccerts/* - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "cleancerts" - when: fabric.generate_certs|default(true) == true - -- name: Copy certs onto the persistent volume - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - cp {{ item }} fabriccertspod:/fabriccerts - args: - chdir: "{{ playbook_dir }}/../../vars/" - with_items: - - "{{ fabricworkdir }}/certs.tgz" - - "{{ playbook_dir }}/../deploy_k8s/fabricsetup/templates/firstcode.go" - tags: "placecerts" - when: fabric.generate_certs|default(true) == true - -- name: Copy channel operation script onto the persistent volume - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - cp {{ item }} fabriccertspod:/fabriccerts - args: - chdir: "{{ playbook_dir }}/../../vars/" - with_items: - - "{{ fabricworkdir }}/keyfiles/dochannel.sh" - when: (allorderers | length > 0) and (allpeers | length > 0) and fabric.generate_certs|default(true) == true - tags: "placecerts" - -- name: Create directory for profiling configuration file on persistent volume - command: >- - kubectl --kubeconfig kubeconfig exec fabriccertspod -c task-pv-container - -- mkdir -p /fabriccerts/bndprofiles/config - args: - chdir: "{{ playbook_dir }}/../../vars/" - when: profilenodes | length > 0 - tags: "profiling" - -- name: Copy profiling configuration file onto persistent volume - command: >- - kubectl --kubeconfig kubeconfig cp {{ item }} - fabriccertspod:/fabriccerts/bndprofiles/config/config.json - args: - chdir: "{{ playbook_dir }}/../../vars/" - with_items: - - "{{ fabricworkdir }}/keyfiles/bndsamplerconfig.json" - when: profilenodes | length > 0 - tags: "profiling" - -- name: Untar certs.tgz in the Persistent volume - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - exec fabriccertspod -c task-pv-container - -- tar -C /fabriccerts -xzvf /fabriccerts/certs.tgz - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "untarcerts" - when: fabric.generate_certs|default(true) == true - -- name: Change certs permissions - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - exec fabriccertspod -c task-pv-container - -- chmod -R o+rw /fabriccerts - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "changecertspermission" - when: fabric.generate_certs|default(true) == true - -- name: Removing the certs pod - command: >- - kubectl --kubeconfig kubeconfig delete -f {{ pjrun }}/certssetup.yaml - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "deletecertspod" - when: fabric.generate_certs|default(true) == true - -- name: Set orderer profile flag - set_fact: - ordererprofile: True - when: >- - fabric.orderersettings is defined and - fabric.orderersettings.ordererenv is defined and - fabric.orderersettings.ordererenv.ORDERER_GENERAL_PROFILE_ENABLED is defined and - fabric.orderersettings.ordererenv.ORDERER_GENERAL_PROFILE_ENABLED == True - -- name: Set peer profile flag - set_fact: - peerprofile: True - when: >- - fabric.peersettings is defined and - fabric.peersettings.CORE_PEER_PROFILE_ENABLED is defined and - fabric.peersettings.CORE_PEER_PROFILE_ENABLED is defined and - fabric.peersettings.CORE_PEER_PROFILE_ENABLED == True - -- name: Create k8s deployment files - template: - src: "{{ playbook_dir }}/../deploy_k8s/fabricsetup/templates/fabric-pod.j2" - dest: "{{ pjrun }}/fabric-pod.yml" - -- name: Start fabric pods - command: "kubectl --kubeconfig kubeconfig apply -f {{ pjrun }}/fabric-pod.yml" - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "fabricup" - -- name: Wait for all peer pods to be ready - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - -o=custom-columns=STATUS:.status.phase - get pods -l type=peer --no-headers --field-selector=status.phase=Running - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: podstatus - until: podstatus.stdout_lines | length == allpeers | length - retries: 50 - delay: 5 - -- name: Get peer pod names - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - -o=custom-columns=STATUS:.metadata.name - get pods -l type=peer --no-headers --field-selector=status.phase=Running - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: peerpodnames - tags: "downloadccenv" - -- name: Download chaincode container image - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - exec {{ item }} -c dind -- - docker pull {{ fabric.repo.url }}fabric-ccenv:{{ fabric.baseimage_tag }} - args: - chdir: "{{ playbook_dir }}/../../vars/" - with_items: "{{ peerpodnames.stdout_lines }}" - when: allpeers | length > 0 - tags: "downloadccenv" - -- name: Start channel operations - command: "kubectl --kubeconfig kubeconfig apply -f {{ pjrun }}/cli-k8s.yaml" - args: - chdir: "{{ playbook_dir }}/../../vars/" - tags: "channeloperation" - when: (allorderers | length > 0) and (allpeers | length > 0) - -- name: Wait for channel operation pod to complete - command: >- - kubectl --kubeconfig kubeconfig --namespace {{ namespace }} - -o=custom-columns=STATUS:.status.phase - get pods -l k8s-app=fabriccli --no-headers --field-selector=status.phase=Succeeded - args: - chdir: "{{ playbook_dir }}/../../vars/" - register: podstatus - until: podstatus.stdout_lines | length == 1 - when: (allorderers | length > 0) and (allpeers | length > 0) - retries: 50 - delay: 5 - tags: "channeloperation" diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/destroy.yml b/src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/destroy.yml deleted file mode 100755 index d77c68ae8..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/tasks/destroy.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- name: Reuse common code - include_tasks: "{{ playbook_dir }}/../common/config_apply.yml" - -- name: Remove fabric client pod - command: >- - kubectl --kubeconfig kubeconfig delete -f {{ pjrun }}/cli-k8s.yaml - args: - chdir: "{{ playbook_dir }}/../../vars/" - when: (allorderers | length > 0) and (allpeers | length > 0) - ignore_errors: yes - tags: "clientdown" - -- name: Stop fabric pod and chaincode endpoint daemon set - command: >- - kubectl --kubeconfig kubeconfig delete -f {{ pjrun }}/{{ item }} - args: - chdir: "{{ playbook_dir }}/../../vars/" - with_items: - - "fabric-services.yml" - - "fabric-pod.yml" - ignore_errors: yes - tags: "fabricdown" - -- name: Remove the namespace - command: >- - kubectl --kubeconfig kubeconfig delete -f {{ pjrun }}/namespace.yaml - args: - chdir: "{{ playbook_dir }}/../../vars/" - when: (fabric.namespace|default('default')|lower) == 'generate' - ignore_errors: yes - tags: "fabricdown,namespace" - -- name: Remove run directory - include_tasks: "{{ playbook_dir }}/../common/config_destroy.yml" - diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/bndsamplerconfig.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/bndsamplerconfig.j2 deleted file mode 100755 index 1503ea3e1..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/bndsamplerconfig.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "addresses": [ -{% for anode in profilenodes %} - "{{ anode }}-profile:6060"{{ '' if loop.last else ',' }} -{% endfor %} - ], - "paths": { - "pprof": "/debug/pprof/goroutine?debug=2", - "wakeup": "/debug/pprof/wakeup?debug=2&rate=1000", - "block": "/debug/pprof/block?debug=1" - } -} diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/certssetup.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/certssetup.j2 deleted file mode 100755 index dfc3d1db7..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/certssetup.j2 +++ /dev/null @@ -1,20 +0,0 @@ ---- -kind: Pod -apiVersion: v1 -metadata: - name: fabriccertspod - namespace: "{{ namespace }}" -spec: - volumes: - - name: task-pv-storage - persistentVolumeClaim: - claimName: fabriccerts - containers: - - name: task-pv-container - image: busybox - args: - - sleep - - "3000" - volumeMounts: - - mountPath: "/fabriccerts" - name: task-pv-storage diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/cli-k8s.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/cli-k8s.j2 deleted file mode 100755 index d671d173b..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/cli-k8s.j2 +++ /dev/null @@ -1,38 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: fabriccli - namespace: "{{ namespace }}" - labels: - k8s-app: fabriccli -spec: -{% if fabric.repo.username | default('') | length > 0 and fabric.repo.password | default('')| length > 0 %} - imagePullSecrets: - - name: regcred -{% endif %} - restartPolicy: Never - volumes: - - name: task-pv-storage - persistentVolumeClaim: - claimName: fabriccerts - containers: - - name: fabriccli - image: {{ fabric.repo.url }}fabric-tools:{{ fabric.baseimage_tag }} -{% if fabric.baseimage_tag == 'latest' or 'stable' in fabric.baseimage_tag %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} - env: -{% if project_version is version('1.3.0','<') %} - - name: "CORE_LOGGING_LEVEL" - value: "DEBUG" -{% elif project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version %} - - name: "FABRIC_LOGGING_SPEC" - value: "DEBUG" -{% endif %} - volumeMounts: - - mountPath: /etc/hyperledger/fabric/artifacts - name: task-pv-storage - command: ["/etc/hyperledger/fabric/artifacts/dochannel.sh"] diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/dochannel.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/dochannel.j2 deleted file mode 100755 index dcf7bc14e..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/dochannel.j2 +++ /dev/null @@ -1,149 +0,0 @@ -#! /bin/bash - -# Set up environment varilables first -{% if tls %} -export CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/peers/{{ clipeer.name }}.{{ clipeer.org }}/tls/server.key -export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/peers/{{ clipeer.name }}.{{ clipeer.org }}/tls/ca.crt -export CORE_PEER_ID={{ clipeer.name }} -export CORE_PEER_ADDRESS={{ clipeer.name }}:7051 -export CORE_PEER_LISTENADDRESS={{ clipeer.name }}:7051 -export CORE_PEER_CHAINCODELISTENADDRESS={{ clipeer.name }}:7052 -export CORE_PEER_LOCALMSPID={{ clipeer.org }} -export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/users/Admin@{{ clipeer.org }}/msp -{% if mutualtls %} -export CORE_PEER_TLS_CLIENTAUTHREQUIRED=true -export CORE_PEER_TLS_CLIENTKEY_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/users/Admin@{{ clipeer.org }}/tls/client.key -export CORE_PEER_TLS_CLIENTCERT_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/users/Admin@{{ clipeer.org }}/tls/client.crt -{% endif %} - -# Run the peer channel create command -cd /etc/hyperledger/fabric/artifacts/keyfiles -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} -TIMEOUT=240s -{% else %} -TIMEOUT=240 -{% endif %} - -peer channel create -o {{ cliorderer.name }}:7050 -c firstchannel \ - -f /etc/hyperledger/fabric/artifacts/keyfiles/firstchannel.tx --tls true --timeout $TIMEOUT \ -{% if mutualtls %} - --clientauth \ - --certfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/users/Admin@{{ clipeer.org }}/tls/client.crt \ - --keyfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/users/Admin@{{ clipeer.org }}/tls/client.key \ -{% endif %} - --cafile /etc/hyperledger/fabric/artifacts/keyfiles/{{ cliorderer.org }}/orderers/{{ cliorderer.name }}.{{ cliorderer.org }}/msp/tlscacerts/tlsca.{{ cliorderer.org }}-cert.pem - -export CORE_PEER_TLS_ENABLED=true -export GOPATH=/opt/gopath -mkdir -p $GOPATH/src/chaincode -cp ../firstcode.go $GOPATH/src/chaincode - -{% for peer in allpeers %} - -export CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/peers/{{ peer.name }}.{{ peer.org }}/tls/server.key -export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/peers/{{ peer.name }}.{{ peer.org }}/tls/ca.crt -export CORE_PEER_ID={{ peer.name }} -export CORE_PEER_ADDRESS={{ peer.name }}:7051 -export CORE_PEER_LISTENADDRESS={{ peer.name }}:7051 -export CORE_PEER_CHAINCODELISTENADDRESS={{ peer.name }}:7052 -export CORE_PEER_LOCALMSPID={{ peer.org }} -export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/msp -{% if mutualtls %} -export CORE_PEER_TLS_CLIENTAUTHREQUIRED=true -export CORE_PEER_TLS_CLIENTKEY_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.key -export CORE_PEER_TLS_CLIENTCERT_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.crt -{% endif %} - -peer channel join -b firstchannel.block {% if mutualtls %} --clientauth --certfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.crt --keyfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.key {% endif %} - -peer chaincode install --tls {% if mutualtls %} --clientauth --certfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.crt --keyfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.key {% endif %} -n firstchaincode -v 1.0 -p chaincode - -{% endfor %} - -# Instantiate the chaincode -echo '-------------- Instantiate chaincode' - -{% set chainpeer = allpeers[0] %} -export CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/peers/{{ chainpeer.name }}.{{ chainpeer.org }}/tls/server.key -export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/peers/{{ chainpeer.name }}.{{ chainpeer.org }}/tls/ca.crt -export CORE_PEER_ID={{ chainpeer.name }} -export CORE_PEER_ADDRESS={{ chainpeer.name }}:7051 -export CORE_PEER_LISTENADDRESS={{ chainpeer.name }}:7051 -export CORE_PEER_CHAINCODELISTENADDRESS={{ chainpeer.name }}:7052 -export CORE_PEER_LOCALMSPID={{ chainpeer.org }} -export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/users/Admin@{{ chainpeer.org }}/msp -{% if mutualtls %} -export CORE_PEER_TLS_CLIENTAUTHREQUIRED=true -export CORE_PEER_TLS_CLIENTKEY_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/users/Admin@{{ chainpeer.org }}/tls/client.key -export CORE_PEER_TLS_CLIENTCERT_FILE=/etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/users/Admin@{{ chainpeer.org }}/tls/client.crt -{% endif %} - -peer chaincode instantiate -o {{ cliorderer.name }}:7050 --tls true \ -{% if mutualtls %} - --clientauth \ - --certfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/users/Admin@{{ chainpeer.org }}/tls/client.crt \ - --keyfile /etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/users/Admin@{{ chainpeer.org }}/tls/client.key \ -{% endif %} - --cafile /etc/hyperledger/fabric/artifacts/keyfiles/{{ cliorderer.org }}/orderers/{{ cliorderer.name }}.{{ cliorderer.org }}/msp/tlscacerts/tlsca.{{ cliorderer.org }}-cert.pem \ - -C firstchannel -n firstchaincode -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "AND ({{ orgmembers }})" - -# Query the chaincode -echo '-------------- Query chaincode' - -# skip the query for now since it most likely will fail due to the timeout issue. -# peer chaincode query -C firstchannel -n firstchaincode -c '{"Args":["query","a"]}' -{% else %} -export CORE_PEER_ID={{ clipeer.name }} -export CORE_PEER_ADDRESS={{ clipeer.name }}:7051 -export CORE_PEER_LISTENADDRESS={{ clipeer.name }}:7051 -export CORE_PEER_CHAINCODELISTENADDRESS={{ clipeer.name }}:7052 -export CORE_PEER_LOCALMSPID={{ clipeer.org }} -export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/artifacts/keyfiles/{{ clipeer.org }}/users/Admin@{{ clipeer.org }}/msp - -# Run the peer channel create command -cd /etc/hyperledger/fabric/artifacts/keyfiles -{% if project_version is version_compare('1.2.0','>=') or 'stable' in project_version or project_version == 'latest' %} -TIMEOUT=240s -{% else %} -TIMEOUT=240 -{% endif %} - -peer channel create -o {{ cliorderer.name }}:7050 -c firstchannel \ - -f /etc/hyperledger/fabric/artifacts/keyfiles/firstchannel.tx --timeout $TIMEOUT - -export CORE_PEER_TLS_ENABLED=false -export GOPATH=/opt/gopath -mkdir -p $GOPATH/src/chaincode -cp ../firstcode.go $GOPATH/src/chaincode - -{% for peer in allpeers %} - -export CORE_PEER_ID={{ peer.name }} -export CORE_PEER_ADDRESS={{ peer.name }}:7051 -export CORE_PEER_LISTENADDRESS={{ peer.name }}:7051 -export CORE_PEER_CHAINCODELISTENADDRESS={{ peer.name }}:7052 - -export CORE_PEER_LOCALMSPID={{ peer.org }} -export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/msp - -peer channel join -b firstchannel.block - -peer chaincode install -n firstchaincode -v 1.0 -p chaincode - -{% endfor %} - -# Instantiate the chaincode -echo '-------------- Instantiate chaincode' - -{% set chainpeer = allpeers[0] %} -export CORE_PEER_ID={{ chainpeer.name }} -export CORE_PEER_ADDRESS={{ chainpeer.name }}:7051 -export CORE_PEER_LISTENADDRESS={{ chainpeer.name }}:7051 -export CORE_PEER_CHAINCODELISTENADDRESS={{ chainpeer.name }}:7052 -export CORE_PEER_LOCALMSPID={{ chainpeer.org }} -export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/artifacts/keyfiles/{{ chainpeer.org }}/users/Admin@{{ chainpeer.org }}/msp - -peer chaincode instantiate -o {{ cliorderer.name }}:7050 \ - -C firstchannel -n firstchaincode -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "OR ({{ orgmembers }})" - -{% endif %} diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-pod.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-pod.j2 deleted file mode 100755 index 764913aef..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-pod.j2 +++ /dev/null @@ -1,439 +0,0 @@ -# Hyperledger fabric deployment file. -# -# Example usage: kubectl create -f - -{% if fabric.repo.username | default('') | length > 0 and fabric.repo.password | default('') | length > 0 %} -{% set creds = True %} -{% else %} -{% set creds = False %} -{% endif %} -{% if fabric.consensus_type | default('kafka') =='kafka' %} -{% for zookeeper in zookeeperls %} ---- -apiVersion: v1 -kind: Pod -metadata: - name: {{ zookeeper }} - namespace: "{{ namespace }}" - labels: - k8s-app: {{ zookeeper }} - type: zookeeper -spec: -{% if creds %} - imagePullSecrets: - - name: regcred -{% endif %} - restartPolicy: OnFailure - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: type - operator: In - values: - - zookeeper - topologyKey: kubernetes.io/hostname - containers: - - name: {{ zookeeper }} - image: {{ fabric.repo.url }}fabric-zookeeper:{{ fabric.helper_tag }} -{% if 'latest' in fabric.helper_tag or 'stable' in fabric.helper_tag %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} - env: - - { name: "ZOO_MY_ID", value: "{{ zoo_ids[zookeeper] }}" } - - { name: "ZOO_SERVERS", value: "{{ znodes | trim }}" } - - { name: "ZOO_TICK_TIME", value: "2000" } - - { name: "ZOO_INIT_LIMIT", value: "10" } - - { name: "ZOO_SYNC_LIMIT", value: "2" } -{% if resourceQuota.zookeeper is defined %} - resources: -{{ resourceQuota.zookeeper | to_nice_yaml | indent(8, True) }} -{% endif %} -{% endfor %} - -{% for kafka in kafkals %} ---- -apiVersion: v1 -kind: Pod -metadata: - name: {{ kafka }} - namespace: "{{ namespace }}" - labels: - k8s-app: {{ kafka }} - type: kafka -spec: -{% if creds %} - imagePullSecrets: - - name: regcred -{% endif %} - restartPolicy: OnFailure - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: type - operator: In - values: - - kafka - topologyKey: kubernetes.io/hostname - containers: - - name: {{ kafka }} - image: {{ fabric.repo.url }}fabric-kafka:{{ fabric.helper_tag }} -{% if 'latest' in fabric.helper_tag or 'stable' in fabric.helper_tag %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} - env: - - { name: "KAFKA_BROKER_ID", value: "{{ kafka_ids[kafka] }}" } - - { name: "KAFKA_ZOOKEEPER_CONNECT", value: "{{ zkparam | trim | replace(' ', ',') }}" } - - { name: "KAFKA_DEFAULT_REPLICATION_FACTOR", value: "{{ kafka_ids | length }}" } -{% if fabric.kafkasettings is defined %} -{% for pkey, pvalue in fabric.kafkasettings.items() %} - - { name: "KAFKA_{{ pkey | upper }}", value: "{{ pvalue }}" } -{% endfor %} -{% endif %} -{% if resourceQuota.kafka is defined %} - resources: -{{ resourceQuota.kafka | to_nice_yaml | indent(8, True) }} -{% endif %} -{% endfor %} -{% endif %} -{% if allcas is defined and (allcas | length > 0) %} -{% for ca in allcas %} ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ ca.name }} - namespace: "{{ namespace }}" -spec: - selector: - matchLabels: - k8s-app: {{ ca.name }} - type: ca - serviceName: {{ ca.name }} - replicas: 1 - template: - metadata: - labels: - k8s-app: {{ ca.name }} - type: ca - spec: -{% if creds %} - imagePullSecrets: - - name: regcred -{% endif %} - volumes: - - name: task-pv-storage - persistentVolumeClaim: - claimName: fabriccerts - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: type - operator: In - values: - - peer - topologyKey: kubernetes.io/hostname - containers: - - name: {{ ca.name }} - image: {{ fabric.repo.url }}fabric-ca:{{ fabric.ca.image_tag }} -{% if 'latest' in fabric.ca.image_tag or 'stable' in fabric.ca.image_tag %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} - env: - - { name: "FABRIC_CA_HOME", value: "/etc/hyperledger/fabric-ca-server-config/keyfiles/{{ ca.org }}/ca" } - - { name: "FABRIC_CA_SERVER_CA_NAME", value: "{{ ca.name}}" } - - { name: "FABRIC_CA_SERVER_CA_KEYFILE", value: "/etc/hyperledger/fabric-ca-server-config/keyfiles/{{ ca.org }}/ca/ca_private.key" } - - { name: "FABRIC_CA_SERVER_CA_CERTFILE", value: "/etc/hyperledger/fabric-ca-server-config/keyfiles/{{ ca.org }}/ca/ca.{{ ca.org }}-cert.pem" } -{% if tls %} - - { name: "FABRIC_CA_SERVER_TLS_ENABLED", value: "true" } - - { name: "FABRIC_CA_SERVER_TLS_KEYFILE", value: "/etc/hyperledger/fabric-ca-server-config/keyfiles/{{ ca.org }}/tlsca/tlsca_private.key" } - - { name: "FABRIC_CA_SERVER_TLS_CERTFILE", value: "/etc/hyperledger/fabric-ca-server-config/keyfiles/{{ ca.org }}/tlsca/tlsca.{{ ca.org }}-cert.pem" } -{% endif %} -{% if resourceQuota.ca is defined %} - resources: -{{ resourceQuota.ca | to_nice_yaml | indent(12, True) }} -{% endif %} - volumeMounts: - - { mountPath: "/etc/hyperledger/fabric-ca-server-config", name: "task-pv-storage" } - command: ["fabric-ca-server"] - args: ["start", "-b", "{{ fabric.ca.admin }}:{{ fabric.ca.adminpw }}", "-d"] -{% endfor %} -{% endif %} -{% if allpeers is defined and (allpeers | length > 0) %} -{% for peer in allpeers %} ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ peer.name }} - namespace: "{{ namespace }}" -spec: - selector: - matchLabels: - k8s-app: {{ peer.name }} - type: peer - serviceName: {{ peer.name }} - replicas: 1 - template: - metadata: - labels: - k8s-app: {{ peer.name }} - type: peer -{% if (project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version) and fabric.metrics is defined and fabric.metrics %} - annotations: - prometheus.io/scrape: 'true' - prometheus.io/path: /metrics - prometheus.io/port: '9443' - prometheus.io/scheme: 'http' -{% endif %} - spec: -{% if creds %} - imagePullSecrets: - - name: regcred -{% endif %} - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: type - operator: In - values: - - peer - topologyKey: kubernetes.io/hostname - volumes: - - name: task-pv-storage - persistentVolumeClaim: - claimName: fabriccerts - - name: varlibdocker - emptyDir: {} - - name: rundind - emptyDir: - medium: Memory - containers: - - name: dind - image: docker:dind - securityContext: - privileged: true - args: - - dockerd - - -H unix:///var/run/docker.sock - volumeMounts: - - name: varlibdocker - mountPath: /var/lib/docker - - name: rundind - mountPath: /var/run -{% if fabric.peer_db == 'CouchDB' %} - - name: couchdb-{{ peer.name }} - image: {{ fabric.repo.url }}fabric-couchdb:{{ fabric.helper_tag }} -{% if 'latest' in fabric.helper_tag or 'stable' in fabric.helper_tag %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} -{% if resourceQuota.couchdb is defined %} - resources: -{{ resourceQuota.couchdb | to_nice_yaml | indent(12, True) }} -{% endif %} -{% endif %} - - name: {{ peer.name }} - image: {{ fabric.repo.url }}fabric-peer:{{ fabric.baseimage_tag }} -{% if 'latest' in project_version or 'stable' in project_version %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} - securityContext: - privileged: true - env: - - { name: "CORE_VM_ENDPOINT", value: "unix:///var/run/docker.sock" } - - { name: "FABRIC_CFG_PATH", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/peers/{{ peer.name }}.{{ peer.org }}" } -{% if project_version is version('1.3.0','<') %} - - { name: "CORE_LOGGING_LEVEL", value: "{{ fabric.logging_level | default('ERROR') }}" } -{% elif project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version %} - - { name: "FABRIC_LOGGING_SPEC", value: "{{ fabric.logging_level | default('ERROR') | lower }}" } -{% endif %} - - { name: "CORE_PEER_GOSSIP_USELEADERELECTION", - value: "{{ allpeers|selectattr('org','equalto',peer.org)|list|selectattr('role','equalto','leader')|list|length|int==0 }}" } - - { name: "CORE_PEER_GOSSIP_ORGLEADER", value: "{{ (peer.role == "leader") | ternary('true','false') }}" } - - { name: "CORE_PEER_TLS_ENABLED", value: "{{ tls | lower }}" } -{% if tls %} - - { name: "CORE_PEER_TLS_CERT_FILE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/peers/{{ peer.name }}.{{ peer.org }}/tls/server.crt" } - - { name: "CORE_PEER_TLS_KEY_FILE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/peers/{{ peer.name }}.{{ peer.org }}/tls/server.key" } - - { name: "CORE_PEER_TLS_ROOTCERT_FILE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/tlsca/tlsca.{{ peer.org }}-cert.pem" } -{% endif %} - - { name: "CORE_PEER_ID", value: "{{ peer.name }}" } -{% if fabric.k8s.exposeserviceport %} - - { name: "CORE_PEER_GOSSIP_EXTERNALENDPOINT", value: "{{ k8shosts[peer.name] }}:{{ k8sports[peer.name+':7051'] }}" } -{% else %} - - { name: "CORE_PEER_GOSSIP_EXTERNALENDPOINT", value: "{{ peer.name }}:7051" } -{% endif %} - - { name: "CORE_PEER_ADDRESS", value: "{{ peer.name }}:7051" } - - { name: "CORE_PEER_LISTENADDRESS", value: "0.0.0.0:7051" } -{% if project_version is version('1.1.0','>=') or 'stable' in project_version or 'latest' in project_version %} - - { name: "CORE_PEER_CHAINCODEADDRESS", value: "{{ peer.name }}:7052" } - - { name: "CORE_PEER_CHAINCODELISTENADDRESS", value: "0.0.0.0:7052" } -{% if mutualtls %} - - { name: "CORE_PEER_TLS_CLIENTAUTHREQUIRED", value: "true" } - - { name: "CORE_PEER_TLS_CLIENTROOTCAS_FILES", value: "{{ rootca | list | join (" ") }}" } - - { name: "CORE_PEER_TLS_CLIENTKEY_FILE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.key" } - - { name: "CORE_PEER_TLS_CLIENTCERT_FILE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/users/Admin@{{ peer.org }}/tls/client.crt" } -{% endif %} -{% else %} - - { name: "CORE_PEER_CHAINCODELISTENADDRESS", value: "{{ peer.name }}:7052" } -{% endif %} - - { name: "CORE_PEER_LOCALMSPID", value: "{{ peer.org }}" } - - { name: "CORE_PEER_MSPCONFIGPATH", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ peer.org }}/peers/{{ peer.name }}.{{ peer.org }}/msp" } -{% if fabric.peer_db == 'CouchDB' %} - - { name: "CORE_LEDGER_STATE_STATEDATABASE", value: "CouchDB" } - - { name: "CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS", value: "localhost:5984" } -{% endif %} -{% if (project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version) and fabric.metrics is defined and fabric.metrics %} - - { name: "CORE_OPERATIONS_LISTENADDRESS", value: ":9443" } - - { name: "CORE_OPERATIONS_TLS_ENABLED", value: "false" } - - { name: "CORE_METRICS_PROVIDER", value: "prometheus" } -{% endif %} -{% if fabric.peersettings is defined %} -{% for pkey, pvalue in fabric.peersettings.items() %} - - { name: "{{ pkey }}", value: "{{ pvalue }}" } -{% endfor %} -{% endif %} - volumeMounts: - - { mountPath: "/etc/hyperledger/fabric/artifacts", name: "task-pv-storage" } - - { mountPath: "/var/run", name: "rundind" } - command: ["peer"] - args: ["node", "start"] -{% if resourceQuota.peer is defined %} - resources: -{{ resourceQuota.peer | to_nice_yaml | indent(12, True) }} -{% endif %} -{% endfor %} -{% endif %} -{% if allorderers is defined and (allorderers | length > 0) %} -{% for orderer in allorderers %} ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ orderer.name }} - namespace: "{{ namespace }}" -spec: - selector: - matchLabels: - k8s-app: {{ orderer.name }} - type: orderer - serviceName: {{ orderer.name }} - replicas: 1 - template: - metadata: - labels: - k8s-app: {{ orderer.name }} - type: orderer -{% if (project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version) and fabric.metrics is defined and fabric.metrics %} - annotations: - prometheus.io/scrape: 'true' - prometheus.io/path: /metrics - prometheus.io/port: '8443' - prometheus.io/scheme: 'http' -{% endif %} - spec: -{% if creds %} - imagePullSecrets: - - name: regcred -{% endif %} - volumes: - - name: task-pv-storage - persistentVolumeClaim: - claimName: fabriccerts - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: type - operator: In - values: - - orderer - topologyKey: kubernetes.io/hostname - containers: - - name: {{ orderer.name }} - image: {{ fabric.repo.url }}fabric-orderer:{{ fabric.baseimage_tag }} -{% if 'latest' in project_version or 'stable' in project_version %} - imagePullPolicy: Always -{% else %} - imagePullPolicy: IfNotPresent -{% endif %} - env: -{% if project_version is version('1.3.0','<') %} - - { name: "ORDERER_GENERAL_LOGLEVEL", value: "{{ fabric.logging_level | default('ERROR') | lower }}" } -{% elif project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version %} - - { name: "FABRIC_LOGGING_SPEC", value: "{{ fabric.logging_level | default('ERROR') | lower }}" } -{% endif %} - - { name: "ORDERER_GENERAL_LISTENADDRESS", value: "0.0.0.0" } - - { name: "ORDERER_GENERAL_GENESISMETHOD", value: "file" } - - { name: "ORDERER_GENERAL_GENESISFILE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/genesis.block" } - - { name: "ORDERER_GENERAL_LOCALMSPID", value: "{{ orderer.org }}" } - - { name: "ORDERER_GENERAL_LOCALMSPDIR", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/msp" } - - { name: "ORDERER_GENERAL_TLS_ENABLED", value: "{{ tls | lower }}" } -{% if tls %} - - { name: "ORDERER_GENERAL_TLS_SERVERHOSTOVERRIDE", value: "{{ orderer.name }}" } - - { name: "ORDERER_GENERAL_TLS_PRIVATEKEY", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/tls/server.key" } - - { name: "ORDERER_GENERAL_TLS_CERTIFICATE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/tls/server.crt" } - - { name: "ORDERER_GENERAL_TLS_ROOTCAS", value: "[/etc/hyperledger/fabric/artifacts/keyfiles/{{ orderer.org }}/tlsca/tlsca.{{ orderer.org }}-cert.pem]" } -{% endif %} -{% if (project_version is version_compare('1.4.1','>=') or ('stable' in project_version or 'latest' in project_version)) and fabric.consensus_type is defined and fabric.consensus_type == 'etcdraft' %} - - { name: "ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/tls/server.key" } - - { name: "ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE", value: "/etc/hyperledger/fabric/artifacts/keyfiles/{{ orderer.org }}/orderers/{{ orderer.name }}.{{ orderer.org }}/tls/server.crt" } -{% elif fabric.consensus_type | default('kafka') == 'kafka' %} - - { name: "ORDERER_KAFKA_RETRY_SHORTINTERVAL", value: "1s" } - - { name: "ORDERER_KAFKA_RETRY_SHORTTOTAL", value: "30s" } - - { name: "ORDERER_KAFKA_VERBOSE", value: "true" } -{% endif %} -{% if mutualtls %} -{% if project_version is version('1.1.0','>=') or 'stable' in project_version or 'latest' in project_version %} - - { name: "ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED", value: "true" } -{% else %} - - { name: "ORDERER_GENERAL_TLS_CLIENTAUTHENABLED", value: "true" } -{% endif %} - - { name: "ORDERER_GENERAL_TLS_CLIENTROOTCAS", value: "[{{ rootca | list | join (", ")}}]" } -{% endif %} -{% if (project_version is version('1.4.0','>=') or 'stable' in project_version or 'latest' in project_version) and fabric.metrics is defined and fabric.metrics %} - - { name: "ORDERER_OPERATIONS_LISTENADDRESS", value: ":8443" } - - { name: "ORDERER_OPERATIONS_TLS_ENABLED", value: "false" } - - { name: "ORDERER_METRICS_PROVIDER", value: "prometheus" } -{% endif %} -{% if fabric.orderersettings is defined and fabric.orderersettings.ordererenv is defined %} -{% for pkey, pvalue in fabric.orderersettings.ordererenv.items() %} - - { name: "{{ pkey }}", value: "{{ pvalue }}" } -{% endfor %} -{% endif %} - volumeMounts: - - { mountPath: "/etc/hyperledger/fabric/artifacts", name: "task-pv-storage" } - command: ["orderer"] -{% if resourceQuota.orderer is defined %} - resources: -{{ resourceQuota.orderer | to_nice_yaml | indent(12, True) }} -{% endif %} -{% endfor %} -{% endif %} diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-services.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-services.j2 deleted file mode 100755 index 9757f2ce4..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/fabric-services.j2 +++ /dev/null @@ -1,197 +0,0 @@ -# Hyperledger fabric services deployment file. -# -# Example usage: kubectl create -f - -{% if fabric.consensus_type | default('kafka') =='kafka' %} -{% for zookeeper in zookeeperls %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ zookeeper }} - name: {{ zookeeper }} - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ zookeeper }} - ports: - - { name: "port1", port: 2888 } - - { name: "port2", port: 3888 } - - { name: "port3", port: 2181 } -{% endfor %} - -{% for kafka in kafkals %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ kafka }} - name: {{ kafka }} - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ kafka }} - ports: - - { name: "port1", port: 9092 } - - { name: "port2", port: 9093 } -{% endfor %} -{% endif %} - -{% if allcas is defined and (allcas | length > 0) %} -{% for ca in allcas %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ ca.name }} - name: {{ ca.name }} - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ ca.name }} -{% if fabric.k8s.exposeserviceport %} - type: NodePort -{% endif %} - ports: - - name: port1 - port: 7054 - -{% endfor %} -{% endif %} - -{% if allpeers is defined and (allpeers | length > 0) %} -{% for peer in allpeers %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ peer.name }} - name: {{ peer.name }} - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ peer.name }} -{% if fabric.k8s.exposeserviceport %} - type: NodePort -{% endif %} - ports: - - name: port1 - port: 7051 - - name: port2 - port: 7052 - - name: port3 - port: 7053 -{% if fabric.metrics is defined and fabric.metrics %} - - name: scrapeport - port: 9443 -{% endif %} -{% if peerprofile is defined and peerprofile %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ peer.name }}-profile - name: {{ peer.name }}-profile - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ peer.name }} - ports: - - name: profileport - port: 6060 -{% endif %} -{% endfor %} -{% endif %} - -{% if allorderers is defined and (allorderers | length > 0) %} -{% for orderer in allorderers %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ orderer.name }} - name: {{ orderer.name }} - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ orderer.name }} -{% if fabric.k8s.exposeserviceport %} - type: NodePort -{% endif %} - ports: - - name: port1 - port: 7050 -{% if fabric.metrics is defined and fabric.metrics %} - - name: scrapeport - port: 8443 -{% endif %} -{% if ordererprofile is defined and ordererprofile %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: {{ orderer.name }}-profile - name: {{ orderer.name }}-profile - namespace: "{{ namespace }}" -spec: - selector: - k8s-app: {{ orderer.name }} - ports: - - name: profileport - port: 6060 -{% endif %} -{% endfor %} -{% endif %} - -{% if fabric.metrics is defined and fabric.metrics %} ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: nodemetricds - namespace: "{{ namespace }}" -spec: - updateStrategy: - type: RollingUpdate - selector: - matchLabels: - name: nodemetricds - template: - metadata: - labels: - name: nodemetricds - spec: - containers: - - name: nodemetric - image: prom/node-exporter:latest - securityContext: - privileged: true - terminationGracePeriodSeconds: 3 - -{% for anode in k8snodes %} ---- -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: metricep-{{anode|replace('.','-')}} - name: metricep-{{anode|replace('.','-')}} - namespace: "{{ namespace }}" -spec: - selector: - nodeName: "{{ anode|replace('.','-') }}" -{% if fabric.k8s.exposeserviceport %} - type: NodePort -{% endif %} - ports: - - name: metricport - port: 9100 -{% endfor %} -{% endif %} diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/firstcode.go b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/firstcode.go deleted file mode 100755 index 534380664..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/firstcode.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -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. -*/ - -package main - -//WARNING - this chaincode's ID is hard-coded in chaincode_example04 to illustrate one way of -//calling chaincode from a chaincode. If this example is modified, chaincode_example04.go has -//to be modified as well with the new ID of chaincode_example02. -//chaincode_example05 show's how chaincode ID can be passed in as a parameter instead of -//hard-coding. - -import ( - "fmt" - "strconv" - - "github.com/hyperledger/fabric/core/chaincode/shim" - pb "github.com/hyperledger/fabric/protos/peer" -) - -// SimpleChaincode example simple Chaincode implementation -type SimpleChaincode struct { -} - -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { - fmt.Println("ex02 Init") - _, args := stub.GetFunctionAndParameters() - var A, B string // Entities - var Aval, Bval int // Asset holdings - var err error - - if len(args) != 4 { - return shim.Error("Incorrect number of arguments. Expecting 4") - } - - // Initialize the chaincode - A = args[0] - Aval, err = strconv.Atoi(args[1]) - if err != nil { - return shim.Error("Expecting integer value for asset holding") - } - B = args[2] - Bval, err = strconv.Atoi(args[3]) - if err != nil { - return shim.Error("Expecting integer value for asset holding") - } - fmt.Printf("Aval = %d, Bval = %d\n", Aval, Bval) - - // Write the state to the ledger - err = stub.PutState(A, []byte(strconv.Itoa(Aval))) - if err != nil { - return shim.Error(err.Error()) - } - - err = stub.PutState(B, []byte(strconv.Itoa(Bval))) - if err != nil { - return shim.Error(err.Error()) - } - - return shim.Success(nil) -} - -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { - fmt.Println("ex02 Invoke") - function, args := stub.GetFunctionAndParameters() - if function == "invoke" { - // Make payment of X units from A to B - return t.invoke(stub, args) - } else if function == "delete" { - // Deletes an entity from its state - return t.delete(stub, args) - } else if function == "query" { - // the old "Query" is now implemtned in invoke - return t.query(stub, args) - } - - return shim.Error("Invalid invoke function name. Expecting \"invoke\" \"delete\" \"query\"") -} - -// Transaction makes payment of X units from A to B -func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response { - var A, B string // Entities - var Aval, Bval int // Asset holdings - var X int // Transaction value - var err error - - if len(args) != 3 { - return shim.Error("Incorrect number of arguments. Expecting 3") - } - - A = args[0] - B = args[1] - - // Get the state from the ledger - // TODO: will be nice to have a GetAllState call to ledger - Avalbytes, err := stub.GetState(A) - if err != nil { - return shim.Error("Failed to get state") - } - if Avalbytes == nil { - return shim.Error("Entity not found") - } - Aval, _ = strconv.Atoi(string(Avalbytes)) - - Bvalbytes, err := stub.GetState(B) - if err != nil { - return shim.Error("Failed to get state") - } - if Bvalbytes == nil { - return shim.Error("Entity not found") - } - Bval, _ = strconv.Atoi(string(Bvalbytes)) - - // Perform the execution - X, err = strconv.Atoi(args[2]) - if err != nil { - return shim.Error("Invalid transaction amount, expecting a integer value") - } - Aval = Aval - X - Bval = Bval + X - fmt.Printf("Aval = %d, Bval = %d\n", Aval, Bval) - - // Write the state back to the ledger - err = stub.PutState(A, []byte(strconv.Itoa(Aval))) - if err != nil { - return shim.Error(err.Error()) - } - - err = stub.PutState(B, []byte(strconv.Itoa(Bval))) - if err != nil { - return shim.Error(err.Error()) - } - - return shim.Success(nil) -} - -// Deletes an entity from state -func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) pb.Response { - if len(args) != 1 { - return shim.Error("Incorrect number of arguments. Expecting 1") - } - - A := args[0] - - // Delete the key from the state in ledger - err := stub.DelState(A) - if err != nil { - return shim.Error("Failed to delete state") - } - - return shim.Success(nil) -} - -// query callback representing the query of a chaincode -func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response { - var A string // Entities - var err error - - if len(args) != 1 { - return shim.Error("Incorrect number of arguments. Expecting name of the person to query") - } - - A = args[0] - - // Get the state from the ledger - Avalbytes, err := stub.GetState(A) - if err != nil { - jsonResp := "{\"Error\":\"Failed to get state for " + A + "\"}" - return shim.Error(jsonResp) - } - - if Avalbytes == nil { - jsonResp := "{\"Error\":\"Nil amount for " + A + "\"}" - return shim.Error(jsonResp) - } - - jsonResp := "{\"Name\":\"" + A + "\",\"Amount\":\"" + string(Avalbytes) + "\"}" - fmt.Printf("Query Response:%s\n", jsonResp) - return shim.Success(Avalbytes) -} - -func main() { - err := shim.Start(new(SimpleChaincode)) - if err != nil { - fmt.Printf("Error starting Simple chaincode: %s", err) - } -} diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/namespace.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/namespace.j2 deleted file mode 100755 index 5ae900eba..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/namespace.j2 +++ /dev/null @@ -1,11 +0,0 @@ ---- -{ - "kind": "Namespace", - "apiVersion": "v1", - "metadata": { - "name": "{{ namespace }}", - "labels": { - "name": "{{ namespace }}" - } - } -} diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/pvc.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/pvc.j2 deleted file mode 100755 index ec0442290..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/pvc.j2 +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: fabriccerts - namespace: "{{ namespace }}" -spec: - storageClassName: "{{ fabric.k8s.storageclass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: "{{ fabric.k8s.storagecapacity }}" diff --git a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/secrets.j2 b/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/secrets.j2 deleted file mode 100755 index 8537c86ed..000000000 --- a/src/agent/ansible/roles/deploy_k8s/fabricsetup/templates/secrets.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{% for peer in allpeers %} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ peer.name }}.{{ peer.org}} -type: Opaque -data: - tls.ca.crt: YWRtaW4= - tls.server.crt: whatever - tls.server.key: whatever -{% endfor %} diff --git a/src/agent/ansible/roles/deploy_k8s/getbin/tasks/apply.yml b/src/agent/ansible/roles/deploy_k8s/getbin/tasks/apply.yml deleted file mode 100755 index 6f812c99e..000000000 --- a/src/agent/ansible/roles/deploy_k8s/getbin/tasks/apply.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: Setup variables - set_fact: - fabricpath: "{{ pjroot }}/vars/{{ env }}" - -- name: Make sure that working directory exists - file: - path: "{{ pjroot }}/vars/{{ env }}/run" - state: "directory" - mode: 0775 - -- stat: - path: "{{ fabricpath }}/bin/cryptogen" - register: binexists - -- name: Download fabric binaries - unarchive: - src: "{{ fabric.repo.bin }}" - dest: "{{ fabricpath }}" - exclude: ["config"] - remote_src: yes - when: fabric.repo.bin|length > 0 and binexists.stat.exists == false - tags: "downloadbin" diff --git a/src/agent/ansible/roles/deploy_k8s/getbin/tasks/destroy.yml b/src/agent/ansible/roles/deploy_k8s/getbin/tasks/destroy.yml deleted file mode 100755 index ed97d539c..000000000 --- a/src/agent/ansible/roles/deploy_k8s/getbin/tasks/destroy.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/src/agent/ansible/roles/deploy_k8s/plays.yml b/src/agent/ansible/roles/deploy_k8s/plays.yml deleted file mode 100755 index d4dd2bc4f..000000000 --- a/src/agent/ansible/roles/deploy_k8s/plays.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: get fabric crypto tool - hosts: cloud - connection: local - vars_files: - - "./../../vars/{{ env }}.yml" - tasks: - - include_tasks: "getbin/tasks/{{ mode }}.yml" - tags: "getbin" - -- name: setup fabric network - hosts: cloud - connection: local - vars_files: - - "./../../vars/{{ env }}.yml" - - "./../../vars/resource.yml" - tasks: - - include_tasks: "fabricsetup/tasks/{{ mode }}.yml" - tags: "fabricsetup" diff --git a/src/agent/ansible/roles/deploy_k8s/priconn/tasks/apply.yml b/src/agent/ansible/roles/deploy_k8s/priconn/tasks/apply.yml deleted file mode 100755 index e3ef812fc..000000000 --- a/src/agent/ansible/roles/deploy_k8s/priconn/tasks/apply.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Create connection profiles - template: - src: "{{ playbook_dir }}/priconn/templates/connection.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/connection.json" - with_items: "{{ allorgs }}" - -- name: Create yaml connection profiles - template: - src: "{{ playbook_dir }}/priconn/templates/connyaml.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/connection.yml" - with_items: "{{ allorgs }}" - -- name: Create metric config file - template: - src: "{{ playbook_dir }}/priconn/templates/metriccfg.j2" - dest: "{{ fabricworkdir }}/keyfiles/metriccfg.yml" - when: (fabric.metrics|default(False)) == True diff --git a/src/agent/ansible/roles/deploy_k8s/priconn/tasks/destroy.yml b/src/agent/ansible/roles/deploy_k8s/priconn/tasks/destroy.yml deleted file mode 100755 index ed97d539c..000000000 --- a/src/agent/ansible/roles/deploy_k8s/priconn/tasks/destroy.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/src/agent/ansible/roles/deploy_k8s/priconn/templates/connection.j2 b/src/agent/ansible/roles/deploy_k8s/priconn/templates/connection.j2 deleted file mode 100755 index e8cbf79ad..000000000 --- a/src/agent/ansible/roles/deploy_k8s/priconn/templates/connection.j2 +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "{{ item }}-network", - "x-type": "hlfv1", - "version": "1.0.0", - "client": { - "organization": "{{ item }}", - "connection": { - "timeout": { - "peer": { "endorser": "300", "eventHub": "300", "eventReg": "300"}, - "orderer": "300" - } - } - }, - "channels": { - "firstchannel": { - "orderers": [ -{% for orderer in allorderers %} - "{{ orderer.name }}"{{ '' if loop.last else ',' }} -{% endfor %} - ], - "peers": { -{% for peer in allpeers %} - "{{ peer.name }}": { - "endorsingPeer": true, "chaincodeQuery": true, "eventSource": true - }{{ '' if loop.last else ',' }} -{% endfor %} - } - } - }, - "organizations": { -{% for org in allorgs %} - "{{ org }}": { - "mspid": "{{ org }}", - "peers": [ -{% for peer in allpeers|selectattr('org', 'equalto', org)|list %} - "{{ peer.name }}"{{ '' if loop.last else ',' }} -{% endfor %} - ], - "certificateAuthorities": [ -{% for ca in allcas|selectattr('org', 'equalto', org)|list %} - "{{ ca.name }}"{{ '' if loop.last else ',' }} -{% endfor %} - ] - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "orderers": { -{% for orderer in allorderers %} - "{{ orderer.name }}": { - "url": "{{ orderer.name }}:7050", - "grpcOptions": { - "ssl-target-name-override": "{{ orderer.name }}" - }, - "tlsCACerts": { - "pem": "{{ '/fabric/keyfiles/'+orderer.org+'/orderers/'+orderer.name+'.'+orderer.org+'/tls/ca.crt' }}" - } - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "peers": { -{% for peer in allpeers %} - "{{ peer.name }}": { - "url": "{{ peer.name }}:7051", - "eventUrl": "{{ peer.name }}:7053", - "grpcOptions": { - "ssl-target-name-override": "{{ peer.name }}" - }, - "tlsCACerts": { - "pem": "{{ '/fabric/keyfiles/'+peer.org+'/tlsca/tlsca.'+peer.org+'-cert.pem' }}" - } - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "certificateAuthorities": { -{% for ca in allcas|selectattr('org', 'equalto', item)|list %} - "{{ ca.name }}": { - "url": "{{ca.name}}:7054", - "caName": "{{ ca.name }}", - "httpOptions": {"verify": false}, - "tlsCACerts": { - "path": "{{ '/fabric/keyfiles/'+ca.org+'/tlsca/tlsca.'+ca.org+'-cert.pem' }}" - } - }{{ '' if loop.last else ',' }} -{% endfor %} - } -} diff --git a/src/agent/ansible/roles/deploy_k8s/priconn/templates/connyaml.j2 b/src/agent/ansible/roles/deploy_k8s/priconn/templates/connyaml.j2 deleted file mode 100755 index 117928d1e..000000000 --- a/src/agent/ansible/roles/deploy_k8s/priconn/templates/connyaml.j2 +++ /dev/null @@ -1,71 +0,0 @@ ---- -name: "{{ item }}-network" -x-type: "hlfv1" -version: "1.0.0" -client: - organization: "{{ item }}" - cryptoconfig: - path: "/fabric/keyfiles" - connection: - timeout: - peer: - endorser: 300 - eventHub: 300 - eventReg: 300 - orderer: 300 -channels: - firstchannel: - orderers: -{% for orderer in allorderers %} - - {{ orderer.name }} -{% endfor %} - peers: -{% for peer in allpeers %} - {{ peer.name }}: - endorsingPeer: true - chaincodeQuery: true - eventSource: true -{% endfor %} -organizations: -{% for org in allorgs %} - {{ org }}: - mspid: "{{ org }}" - cryptoPath: "{{ org }}/users/{username}@{{ org}}/msp" - peers: -{% for peer in allpeers|selectattr('org', 'equalto', org)|list %} - - {{ peer.name }} -{% endfor %} - certificateAuthorities: -{% for ca in allcas|selectattr('org', 'equalto', org)|list %} - - {{ ca.name }} -{% endfor %} -{% endfor %} -orderers: -{% for orderer in allorderers %} - {{ orderer.name }}: - url: "{{ orderer.name }}:7050" - grpcOptions: - ssl-target-name-override: "{{ orderer.name }}" - tlsCACerts: - path: "{{ '/fabric/keyfiles/'+orderer.org+'/orderers/'+orderer.name+'.'+orderer.org+'/tls/ca.crt' }}" -{% endfor %} -peers: -{% for peer in allpeers %} - {{ peer.name }}: - url: "{{ peer.name }}:7051" - eventUrl: "{{ peer.name }}:7053" - grpcOptions: - ssl-target-name-override: "{{ peer.name }}" - tlsCACerts: - path: "{{ '/fabric/keyfiles/'+peer.org+'/tlsca/tlsca.'+peer.org+'-cert.pem' }}" -{% endfor %} -certificateAuthorities: -{% for ca in allcas|selectattr('org', 'equalto', item)|list %} - {{ ca.name }}: - url: "{{ tls|ternary('https','http') }}://{{ca.name}}:7054" - caName: "{{ ca.name }}" - httpOptions: - verify: false - tlsCACerts: - path: "{{ '/fabric/keyfiles/'+ca.org+'/tlsca/tlsca.'+ca.org+'-cert.pem' }}" -{% endfor %} diff --git a/src/agent/ansible/roles/deploy_k8s/priconn/templates/metriccfg.j2 b/src/agent/ansible/roles/deploy_k8s/priconn/templates/metriccfg.j2 deleted file mode 100755 index 5ef21b26d..000000000 --- a/src/agent/ansible/roles/deploy_k8s/priconn/templates/metriccfg.j2 +++ /dev/null @@ -1,21 +0,0 @@ ---- -{% for orderer in allorderers %} -- targets: - - {{ orderer.name }}:8443 - labels: - hostname: "{{ orderer.name }}" -{% endfor %} -{% for peer in allpeers %} -- targets: - - {{ peer.name }}:9443 - labels: - hostname: "{{ peer.name }}" -{% endfor %} -{% for dsnode in dsnodes %} -{% set key='metricep-'+(dsnode[1]|replace('.','-')) %} -- targets: - - {{ key }}:9100 }} - labels: - hostname: "{{ dsnode[1] }}" -{% endfor %} - diff --git a/src/agent/ansible/roles/deploy_k8s/pubconn/tasks/apply.yml b/src/agent/ansible/roles/deploy_k8s/pubconn/tasks/apply.yml deleted file mode 100755 index 6020b4c87..000000000 --- a/src/agent/ansible/roles/deploy_k8s/pubconn/tasks/apply.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: Ensure certificate directory exist - file: - path: "{{ fabricworkdir }}/keyfiles" - state: "{{ item }}" - with_items: - - "directory" - -- name: Create connection profiles - template: - src: "{{ playbook_dir }}/../deploy_k8s/pubconn/templates/connection.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/connection.json" - with_items: "{{ allorgs }}" - -- name: Create metric config file - template: - src: "{{ playbook_dir }}/../deploy_k8s/pubconn/templates/metriccfg.j2" - dest: "{{ fabricworkdir }}/keyfiles/metriccfg.yml" - when: (fabric.metrics|default(False)) == True - -- name: Create yaml connection profiles - template: - src: "{{ playbook_dir }}/../deploy_k8s/pubconn/templates/connyaml.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/connection.yml" - with_items: "{{ allorgs }}" - -- name: Create orderer endpoint file - template: - src: "{{ playbook_dir }}/../deploy_k8s/pubconn/templates/ordererendpoints.j2" - dest: "{{ fabricworkdir }}/keyfiles/{{ item }}/{{ item }}_orderendpoints.json" - with_items: "{{ ordererorgs }}" diff --git a/src/agent/ansible/roles/deploy_k8s/pubconn/tasks/destroy.yml b/src/agent/ansible/roles/deploy_k8s/pubconn/tasks/destroy.yml deleted file mode 100755 index ed97d539c..000000000 --- a/src/agent/ansible/roles/deploy_k8s/pubconn/tasks/destroy.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/connection.j2 b/src/agent/ansible/roles/deploy_k8s/pubconn/templates/connection.j2 deleted file mode 100644 index 38fea2800..000000000 --- a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/connection.j2 +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "{{ item }}-network", - "x-type": "hlfv1", - "version": "1.0.0", - "client": { - "organization": "{{ item }}", - "connection": { - "timeout": { - "peer": { "endorser": "300", "eventHub": "300", "eventReg": "300"}, - "orderer": "300" - } - } - }, - "channels": { - "firstchannel": { - "orderers": [ -{% for orderer in allorderers %} - "{{ orderer.name }}"{{ '' if loop.last else ',' }} -{% endfor %} - ], - "peers": { -{% for peer in allpeers %} - "{{ peer.name }}": { - "endorsingPeer": true, "chaincodeQuery": true, "eventSource": true - }{{ '' if loop.last else ',' }} -{% endfor %} - } - } - }, - "organizations": { -{% for org in allorgs %} - "{{ org }}": { - "mspid": "{{ org }}", - "peers": [ -{% for peer in allpeers|selectattr('org', 'equalto', org)|list %} - "{{ peer.name }}"{{ '' if loop.last else ',' }} -{% endfor %} - ], - "certificateAuthorities": [ -{% for ca in allcas|selectattr('org', 'equalto', org)|list %} - "{{ ca.name }}"{{ '' if loop.last else ',' }} -{% endfor %} - ] - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "orderers": { -{% for orderer in allorderers %} - "{{ orderer.name }}": { - "url": "{{ orderer.name }}:7050", - "grpcOptions": { - "ssl-target-name-override": "{{ orderer.name }}" - }, - "tlsCACerts": { - "pem": "{{ '/fabric/keyfiles/'+orderer.org+'/orderers/'+orderer.name+'.'+orderer.org+'/tls/ca.crt' }}" - } - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "peers": { -{% for peer in allpeers %} - "{{ peer.name }}": { - "url": "{{ peer.name }}:7051", - "eventUrl": "{{ peer.name }}:7053", - "grpcOptions": { - "ssl-target-name-override": "{{ peer.name }}" - }, - "tlsCACerts": { - "pem": "{{ '/fabric/keyfiles/'+peer.org+'/tlsca/tlsca.'+peer.org+'-cert.pem' }}" - } - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "certificateAuthorities": { -{% for ca in allcas|selectattr('org', 'equalto', item)|list %} - "{{ ca.name }}": { - "url": "{{ tls|ternary('https','http') }}://{{ k8shosts[ca.name] }}:{{ k8sports[ca.name+':7054'] }}", - "caName": "{{ ca.name }}", - "httpOptions": {"verify": false}, - "tlsCACerts": { - "path": "{{ '/fabric/keyfiles/'+ca.org+'/tlsca/tlsca.'+ca.org+'-cert.pem' }}" - } - }{{ '' if loop.last else ',' }} -{% endfor %} - }, - "entityMatchers": { - "orderer": [ -{% for orderer in allorderers %} - { "mappedHost": "{{ orderer.name }}", - "pattern": "(\\w*){{ orderer.name }}(\\w*)", - "sslTargetOverrideUrlSubstitutionExp": "{{ orderer.name }}", - "urlSubstitutionExp": "{{ k8shosts[orderer.name] }}:{{ k8sports[orderer.name+':7050'] }}" - }{{ '' if loop.last else ',' }} -{% endfor %} - ], - "peer": [ -{% for peer in allpeers %} - { "mappedHost": "{{ peer.name }}", - "pattern": "(\\w*){{ peer.name }}(\\w*)", - "sslTargetOverrideUrlSubstitutionExp": "{{ peer.name }}", - "urlSubstitutionExp": "{{ k8shosts[peer.name] }}:{{ k8sports[peer.name+':7051'] }}", - "eventUrlSubstitutionExp": "{{ k8shosts[peer.name] }}:{{ k8sports[peer.name+':7053'] }}" - }{{ '' if loop.last else ',' }} -{% endfor %} - ] - } -} diff --git a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/connyaml.j2 b/src/agent/ansible/roles/deploy_k8s/pubconn/templates/connyaml.j2 deleted file mode 100755 index 0b5f3bd77..000000000 --- a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/connyaml.j2 +++ /dev/null @@ -1,87 +0,0 @@ ---- -name: "{{ item }}-network" -x-type: "hlfv1" -version: "1.0.0" -client: - organization: "{{ item }}" - cryptoconfig: - path: "/fabric/keyfiles" - connection: - timeout: - peer: - endorser: 300 - eventHub: 300 - eventReg: 300 - orderer: 300 -channels: - firstchannel: - orderers: -{% for orderer in allorderers %} - - {{ orderer.name }} -{% endfor %} - peers: -{% for peer in allpeers %} - {{ peer.name }}: - endorsingPeer: true - chaincodeQuery: true - eventSource: true -{% endfor %} -organizations: -{% for org in allorgs %} - {{ org }}: - mspid: "{{ org }}" - cryptoPath: "{{ org }}/users/{username}@{{ org}}/msp" - peers: -{% for peer in allpeers|selectattr('org', 'equalto', org)|list %} - - {{ peer.name }} -{% endfor %} - certificateAuthorities: -{% for ca in allcas|selectattr('org', 'equalto', org)|list %} - - {{ ca.name }} -{% endfor %} -{% endfor %} -orderers: -{% for orderer in allorderers %} - {{ orderer.name }}: - url: "{{ orderer.name }}:7050" - grpcOptions: - ssl-target-name-override: "{{ orderer.name }}" - tlsCACerts: - path: "{{ '/fabric/keyfiles/'+orderer.org+'/orderers/'+orderer.name+'.'+orderer.org+'/tls/ca.crt' }}" -{% endfor %} -peers: -{% for peer in allpeers %} - {{ peer.name }}: - url: "{{ peer.name }}:7051" - eventUrl: "{{ peer.name }}:7053" - grpcOptions: - ssl-target-name-override: "{{ peer.name }}" - tlsCACerts: - path: "{{ '/fabric/keyfiles/'+peer.org+'/tlsca/tlsca.'+peer.org+'-cert.pem' }}" -{% endfor %} -certificateAuthorities: -{% for ca in allcas|selectattr('org', 'equalto', item)|list %} - {{ ca.name }}: - url: "{{ tls|ternary('https','http') }}://{{ k8shosts[ca.name] }}:{{ k8sports[ca.name+':7054'] }}" - caName: "{{ ca.name }}" - httpOptions: - verify: false - tlsCACerts: - path: "{{ '/fabric/keyfiles/'+ca.org+'/tlsca/tlsca.'+ca.org+'-cert.pem' }}" -{% endfor %} -entityMatchers: - orderer: -{% for orderer in allorderers %} - - mappedHost: {{ orderer.name }} - pattern: (\w*){{ orderer.name }}(\w*) - sslTargetOverrideUrlSubstitutionExp: {{ orderer.name }} - urlSubstitutionExp: "{{ k8shosts[orderer.name] }}:{{ k8sports[orderer.name+':7050'] }}" -{% endfor %} - peer: -{% for peer in allpeers %} - - mappedHost: {{ peer.name }} - pattern: (\w*){{ peer.name }}(\w*) - sslTargetOverrideUrlSubstitutionExp: {{ peer.name }} - urlSubstitutionExp: "{{ k8shosts[peer.name] }}:{{ k8sports[peer.name+':7051'] }}" - eventUrlSubstitutionExp: "{{ k8shosts[peer.name] }}:{{ k8sports[peer.name+':7053'] }}" -{% endfor %} diff --git a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/metriccfg.j2 b/src/agent/ansible/roles/deploy_k8s/pubconn/templates/metriccfg.j2 deleted file mode 100755 index 52265e6da..000000000 --- a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/metriccfg.j2 +++ /dev/null @@ -1,20 +0,0 @@ ---- -{% for orderer in allorderers %} -- targets: - - {{ allips|random }}:{{ k8sports[orderer.name+':8443'] }} - labels: - hostname: "{{ orderer.name }}" -{% endfor %} -{% for peer in allpeers %} -- targets: - - {{ allips|random }}:{{ k8sports[peer.name+':9443'] }} - labels: - hostname: "{{ peer.name }}" -{% endfor %} -{% for dsnode in dsnodes %} -{% set key='metricep-'+(dsnode[1]|replace('.','-')) %} -- targets: - - {{ k8shosts[key] }}:{{ k8sports[key+':9100'] }} - labels: - hostname: "{{ dsnode[1] }}" -{% endfor %} diff --git a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/ordererendpoints.j2 b/src/agent/ansible/roles/deploy_k8s/pubconn/templates/ordererendpoints.j2 deleted file mode 100755 index a21d548ca..000000000 --- a/src/agent/ansible/roles/deploy_k8s/pubconn/templates/ordererendpoints.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{ -"channelID": "<>", -"ordererEndpoints": [ -{% for orderer in allorderers %} - "{{ k8shosts[orderer.name] }}:{{ k8sports[orderer.name+':7050'] }}"{{ '' if loop.last else ',' }} -{% endfor %} -], -"ordererTlsCertificates": [ -{% for orderer in allorderers %} - "{{lookup('file', fabricworkdir+'/keyfiles/'+orderer.org+'/orderers/'+orderer.name+'.'+orderer.org+'/tls/server.crt')|b64encode}}"{{ '' if loop.last else ',' }} -{% endfor %} -] -} diff --git a/src/agent/ansible/setupfabric.yml b/src/agent/ansible/setupfabric.yml deleted file mode 100755 index cbaade231..000000000 --- a/src/agent/ansible/setupfabric.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Get start timestamp - hosts: cloud - connection: local - tasks: - - set_fact: - starttime: "{{ ansible_date_time }}" - -- name: Run the plays - vars: - pjroot: "{{ playbook_dir }}/../.." - import_playbook: "roles/deploy_k8s/plays.yml" - -- name: inform the installer - hosts: cloud - connection: local - tasks: - - debug: - msg: >- - The work load started at {{ hostvars.cloud.starttime.time }}, - ended at {{ ansible_date_time.time }} diff --git a/src/agent/ansible/vars/bc1st.yml b/src/agent/ansible/vars/bc1st.yml deleted file mode 100755 index 2fea0fae2..000000000 --- a/src/agent/ansible/vars/bc1st.yml +++ /dev/null @@ -1,123 +0,0 @@ ---- -fabric: { - - # options are "solo", "kafka", "etcdraft" (etcdraft support from 2.0.0) - # for consensus_type, default is kafka - consensus_type: "kafka", - # options are "goleveldb", "CouchDB", default is goleveldb - peer_db: "CouchDB", - # options are "true", "false", "client" default is true - tls: false, - generate_certs: true, - logging_level: "ERROR", - metrics: false, - k8s: { - exposeserviceport: False, - storageclass: "default", - storagecapacity: "2Gi", - shared_storage: false - }, - # Peer environment variables to override core.yaml values - # variables should be in the peer readable format like shown below - peersettings: { - CORE_LEDGER_STATE_COUCHDBCONFIG_WARMINDEXESAFTERNBLOCKS: "10" - }, - # Orderer configuration and environment variables to override - # configtx.yaml and orderer.yaml values. ordererenv will take the - # environment variables in the orderer readable format for example: - # ORDERER_GENERAL_TLS_ENABLED=true - orderersettings: { - config: { - BatchTimeout: 2s, - BatchSize: { - MaxMessageCount: 500, - AbsoluteMaxBytes: "98 MB", - PreferredMaxBytes: "512 KB" - } - }, - ordererenv: { - } - }, - kafkasettings: { - MESSAGE_MAX_BYTES: "103809024", - MAX_REQUEST_SIZE: "104857600", - REPLICA_FETCH_MAX_BYTES: "103809024", - UNCLEAN_LEADER_ELECTION_ENABLE: "true", - MIN_INSYNC_REPLICAS: "2", - DEFAULT_REPLICATION_FACTOR: "3" - }, - raftsettings: { - Options: { - TickInterval: "500ms", - ElectionTick: 10, - HeartbeatTick: 1, - MaxInflightBlocks: 5, - SnapshotIntervalSize: "100 MB" - } - }, - - # The following section defines how the fabric network is going to be made up - # cas indicates certificate authority containers - # peers indicates peer containers - # orderers indicates orderer containers - # kafka indicates kafka containers - # all names must be in lower case. Numeric characters cannot be used to start - # or end a name. Character dot (.) can only be used in names of peers and orderers. - network: { - fabric001: { - cas: ["ca1st.orga"], - peers: ["anchor@peer1st.orga", "anchor@peer1st.orgb"], - orderers: ["orderer1st.orgc", "orderer1st.orgd"], - zookeepers: ["zookeeper1st"], - kafkas: ["kafka1st"] - }, - fabric002: { - cas: ["ca1st.orgb"], - peers: ["worker@peer2nd.orga", "worker@peer2nd.orgb"], - orderers: ["orderer2nd.orgc", "orderer2nd.orgd"], - zookeepers: ["zookeeper2nd"], - kafkas: ["kafka2nd"] - }, - fabric003: { - cas: ["ca1st.orgc", "ca1st.orgd"], - peers: ["worker@peer3rd.orga", "worker@peer3rd.orgb"], - orderers: [], - zookeepers: ["zookeeper3rd"], - kafkas: ["kafka3rd"] - } - }, - - # the container tag for main fabric components such as orderer, peer, - # tools and chaincode. If left blank, then fabric components will be built - # from the latest fabric source code with the combination of the refspec - # specified above. If it is not empty, then its values must be the full - # container tag like the following: - # x86_64-1.1.0-alpha # alpha release - # DAILY_STABLE # daily stable - # DEV_STABLE # dev stable - # s390x-0.4.2 # release 0.4.2 for s390x - # 048c91eb47812582f36665fbea3d7e0e68e396bf # commit build - # x86_64-1.0.0-snapshot-8d3275f # snapshot build - baseimage_tag: "amd64-1.1.0", - - # The container tag for accessory fabric components such as ca, kafka, - # zookeeper and couchdb. It has to be the full tag just like the - # baseimage_tag - helper_tag: "amd64-0.4.8", - ca: { admin: "admin", adminpw: "adminpw", image_tag: "amd64-1.1.0" }, - - # Only use this field when you have a docker repository. - repo: { - # the url defines docker hub project access point - # official hub - url: "hyperledger/", - # fabric build hub - url: "nexus3.hyperledger.org:10001/hyperledger/", - url: "hyperledger/", - username: "", - password: "", - - # locations to download fabric binaries. This url should point to a - # compressed such as tar or zip file which contains necessary binaries - # such as configtxgen, configtxlator, cryptogen etc. - bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.1.0/hyperledger-fabric-linux-amd64-1.1.0.tar.gz" - } -} diff --git a/src/agent/ansible/vars/bc2nd.yml b/src/agent/ansible/vars/bc2nd.yml deleted file mode 100755 index a1ba8f35a..000000000 --- a/src/agent/ansible/vars/bc2nd.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -# The following defines a fabric network with 2 peers, 1 orderer, 1 zookeeper and 1 kafka -# It also defines that the peers will be using goleveldb. -fabric: { - consensus_type: "kafka", - peer_db: "goleveldb", - tls: true, - generate_certs: true, - logging_level: "ERROR", - metrics: false, - k8s: { - exposeserviceport: False, - storageclass: "default", - storagecapacity: "2Gi", - shared_storage: false - }, - orderersettings: { - BatchTimeout: 2s, - BatchSize: { - MaxMessageCount: 500, - AbsoluteMaxBytes: "98 MB", - PreferredMaxBytes: "512 KB" - } - }, - kafkasettings: { - MESSAGE_MAX_BYTES: "103809024", - MAX_REQUEST_SIZE: "104857600", - REPLICA_FETCH_MAX_BYTES: "103809024", - UNCLEAN_LEADER_ELECTION_ENABLE: "true", - MIN_INSYNC_REPLICAS: "2", - DEFAULT_REPLICATION_FACTOR: "3" - }, - raftsettings: { - Options: { - TickInterval: "500ms", - ElectionTick: 10, - HeartbeatTick: 1, - MaxInflightBlocks: 5, - SnapshotIntervalSize: "100 MB" - } - }, - - network: { - fabric001: { - cas: ["ca1st.sin"], - peers: ["anchor@peer1st.sin", "worker@peer2nd.sin"], - orderers: [], - zookeepers: [], - kafkas: [] - } - }, - - # the container tag for main fabric components such as orderer, peer, - # tools and chaincode. If left blank, then fabric components will be built - # from the latest fabric source code with the combination of the refspec - # specified above. If it is not empty, then its values must be the full - # container tag like the following: - # x86_64-1.1.0-alpha # alpha release - # DAILY_STABLE # daily stable - # DEV_STABLE # dev stable - # s390x-0.4.2 # release 0.4.2 for s390x - # 048c91eb47812582f36665fbea3d7e0e68e396bf # commit build - # x86_64-1.0.0-snapshot-8d3275f # snapshot build - baseimage_tag: "amd64-1.1.0", - - # The container tag for accessory fabric components such as ca, kafka, - # zookeeper and couchdb. It has to be the full tag just like the - # baseimage_tag - helper_tag: "amd64-0.4.8", - ca: { admin: "admin", adminpw: "adminpw", image_tag: "amd64-1.1.0" }, - - # Only use this field when you have a docker repository. - repo: { - # the url defines docker hub project access point - # official hub - url: "hyperledger/", - # fabric build hub - url: "nexus3.hyperledger.org:10001/hyperledger/", - url: "hyperledger/", - - # locations to download fabric binaries. This url should point to a - # compressed such as tar or zip file which contains necessary binaries - # such as configtxgen, configtxlator, cryptogen etc. - bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.1.0/hyperledger-fabric-linux-amd64-1.1.0.tar.gz" - } -} diff --git a/src/agent/ansible/vars/ordereronly.yml b/src/agent/ansible/vars/ordereronly.yml deleted file mode 100755 index 43d4b077b..000000000 --- a/src/agent/ansible/vars/ordereronly.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# This variable defines fabric network attributes -fabric: - peer_db: "goleveldb" - tls: true - consensus_type: "kafka" - logging_level: "ERROR" - k8s: - exposeserviceport: True - storageclass: "ibmc-file-gold" - storagecapacity: "20Gi" - shared_storage: false - mem_req: "512Mi" - mem_limit: "1024Mi" - cpu_req: "0.1" - cpu_limit: "0.2" - - network: - fabric001: - cas: ["ca1st.orgc"] - peers: [] - orderers: ["orderer1st.orgc","orderer2nd.orgc","orderer3rd.orgc"] - zookeepers: ["zookeeper1st","zookeeper2nd","zookeeper3rd"] - kafkas: ["kafka1st","kafka2nd","kafka3rd"] - - baseimage_tag: "1.4.1" - helper_tag: "0.4.15" - ca: - admin: "admin" - adminpw: "adminpw" - image_tag: "1.4.1" - - repo: - url: "hyperledger/" - username: "" - password: "" - bin: "https://nexus.hyperledger.org/content/repositories/snapshots/org/hyperledger/fabric/hyperledger-fabric-1.4.1-stable/linux-amd64.1.4.1-stable-SNAPSHOT/hyperledger-fabric-1.4.1-stable-linux-amd64.1.4.1-stable-20190418.020851-42.tar.gz" \ No newline at end of file diff --git a/src/agent/ansible/vars/peeronly.yml b/src/agent/ansible/vars/peeronly.yml deleted file mode 100755 index 21c650cef..000000000 --- a/src/agent/ansible/vars/peeronly.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -# This variable defines fabric network attributes -fabric: - - # options are "goleveldb", "CouchDB", default is goleveldb - peer_db: "goleveldb" - tls: true - logging_level: "ERROR" - k8s: - exposeserviceport: True - storageclass: "ibmc-file-gold" - storagecapacity: "20Gi" - shared_storage: false - mem_req: "512Mi" - mem_limit: "1024Mi" - cpu_req: "0.1" - cpu_limit: "0.2" - - orderersettings: - config: - BatchTimeout: 10s - ordererenv: - ORDERER_GENERAL_PROFILE_ENABLED: false - - network: - fabric001: - cas: ["ca1st.orgt"] - peers: ["worker@peer1st.orgt","worker@peer2nd.orgt","worker@peer3rd.orgt"] - orderers: [] - zookeepers: [] - kafkas: [] - - baseimage_tag: "1.4.1" - helper_tag: "1.4.1" - ca: - admin: "admin" - adminpw: "adminpw" - image_tag: "1.4.1" - - repo: - url: "hyperledger/" - username: "" - password: "" - bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.4.1/hyperledger-fabric-linux-amd64-1.4.1.tar.gz" - diff --git a/src/agent/ansible/vars/resource.yml b/src/agent/ansible/vars/resource.yml deleted file mode 100644 index 85bd71dbe..000000000 --- a/src/agent/ansible/vars/resource.yml +++ /dev/null @@ -1,43 +0,0 @@ -resourceQuota: - ca: - requests: - memory: "0.5Gi" - cpu: "0.2" - limits: - memory: "0.5Gi" - cpu: "0.2" - kafka: - requests: - memory: "1Gi" - cpu: "0.5" - limits: - memory: "1Gi" - cpu: "0.5" - zookeeper: - requests: - memory: "0.5Gi" - cpu: "0.2" - limits: - memory: "0.5Gi" - cpu: "0.2" - peer: - requests: - memory: "1Gi" - cpu: "1" - limits: - memory: "1Gi" - cpu: "1" - couchdb: - requests: - memory: "1Gi" - cpu: "0.1" - limits: - memory: "1Gi" - cpu: "0.1" - orderer: - requests: - memory: "1Gi" - cpu: "1" - limits: - memory: "1Gi" - cpu: "1" diff --git a/src/agent/ansible/vars/vb1st.yml b/src/agent/ansible/vars/vb1st.yml deleted file mode 100755 index f8982e477..000000000 --- a/src/agent/ansible/vars/vb1st.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -# This variable defines fabric network attributes -fabric: { - - # options are "goleveldb", "CouchDB", default is goleveldb - peer_db: "goleveldb", - # options are "true", "false", "client" default is true - tls: false, - generate_certs: true, - logging_level: "ERROR", - k8s: { - exposeserviceport: True, - storageclass: "default", - storagecapacity: "2Gi", - shared_storage: false, - mem_req: "512Mi", - mem_limit: "1024Mi", - cpu_req: "0.1", - cpu_limit: "0.2" - }, - orderersettings: { - BatchTimeout: 2s, - BatchSize: { - MaxMessageCount: 500, - AbsoluteMaxBytes: "98 MB", - PreferredMaxBytes: "512 KB" - } - }, - kafkasettings: { - MESSAGE_MAX_BYTES: "103809024", - MAX_REQUEST_SIZE: "104857600", - REPLICA_FETCH_MAX_BYTES: "103809024", - UNCLEAN_LEADER_ELECTION_ENABLE: "true", - MIN_INSYNC_REPLICAS: "2", - DEFAULT_REPLICATION_FACTOR: "3" - }, - - # The following section defines how the fabric network is going to be made up - # cas indicates certificate authority containers - # peers indicates peer containers - # orderers indicates orderer containers - # kafka indicates kafka containers - # all names must be in lower case. Numeric characters cannot be used to start - # or end a name. Character dot (.) can only be used in names of peers and orderers. - network: { - fabric001: { - cas: [], - peers: ["anchor@peer1st.orga", "anchor@peer1st.orgb"], - orderers: ["orderer1st.orgc"], - zookeepers: ["zookeeper1st"], - kafkas: ["kafka1st"] - }, - fabric002: { - cas: ["ca1st.orga", "ca1st.orgb", "ca1st.orgc"], - peers: ["worker@peer2nd.orga", "worker@peer2nd.orgb"], - orderers: ["orderer2nd.orgc"], - zookeepers: [], - kafkas: [] - } - }, - - # the container tag for main fabric components such as orderer, peer, - # tools and chaincode. If left blank, then fabric components will be built - # from the latest fabric source code with the combination of the refspec - # specified above. If it is not empty, then its values must be the full - # container tag like the following: - # x86_64-1.1.0-alpha # alpha release - # DAILY_STABLE # daily stable - # DEV_STABLE # dev stable - # s390x-0.4.2 # release 0.4.2 for s390x - # 048c91eb47812582f36665fbea3d7e0e68e396bf # commit build - # x86_64-1.0.0-snapshot-8d3275f # snapshot build - baseimage_tag: "amd64-1.1.0", - - # The container tag for accessory fabric components such as ca, kafka, - # zookeeper and couchdb. It has to be the full tag just like the - # baseimage_tag - helper_tag: "amd64-0.4.8", - ca: { admin: "admin", adminpw: "adminpw", image_tag: "amd64-1.1.0" }, - - # Only use this field when you have a docker repository. - repo: { - # the url defines docker hub project access point - # official hub - url: "hyperledger/", - # fabric build hub - url: "nexus3.hyperledger.org:10001/hyperledger/", - url: "hyperledger/", - - # locations to download fabric binaries. This url should point to a - # compressed such as tar or zip file which contains necessary binaries - # such as configtxgen, configtxlator, cryptogen etc. - bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.1.0/hyperledger-fabric-linux-amd64-1.1.0.tar.gz" - } -} diff --git a/src/agent/fabric-operator/.gitignore b/src/agent/fabric-operator/.gitignore deleted file mode 100644 index a8765b01b..000000000 --- a/src/agent/fabric-operator/.gitignore +++ /dev/null @@ -1,78 +0,0 @@ -# Temporary Build Files -build/_output -build/_test -# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode -### Emacs ### -# -*- mode: gitignore; -*- -*~ -\#*\# -/.emacs.desktop -/.emacs.desktop.lock -*.elc -auto-save-list -tramp -.\#* -# Org-mode -.org-id-locations -*_archive -# flymake-mode -*_flymake.* -# eshell files -/eshell/history -/eshell/lastdir -# elpa packages -/elpa/ -# reftex files -*.rel -# AUCTeX auto folder -/auto/ -# cask packages -.cask/ -dist/ -# Flycheck -flycheck_*.el -# server auth directory -/server/ -# projectiles files -.projectile -projectile-bookmarks.eld -# directory configuration -.dir-locals.el -# saveplace -places -# url cache -url/cache/ -# cedet -ede-projects.el -# smex -smex-items -# company-statistics -company-statistics-cache.el -# anaconda-mode -anaconda-mode/ -### Go ### -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -# Test binary, build with 'go test -c' -*.test -# Output of the go coverage tool, specifically when used with LiteIDE -*.out -### Vim ### -# swap -.sw[a-p] -.*.sw[a-p] -# session -Session.vim -# temporary -.netrwhist -# auto-generated tag files -tags -### VisualStudioCode ### -.vscode/* -.history -# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode -!build/bin diff --git a/src/agent/fabric-operator/Dockerfile b/src/agent/fabric-operator/Dockerfile deleted file mode 100644 index 0b6e81f2b..000000000 --- a/src/agent/fabric-operator/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# Dockerfile for hyperledger fabirc kubernetes operator -# -# @see https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/README.md -# - -# Use the golang docker image to build the operator binary -FROM golang AS builder -RUN mkdir -p /go/src/github.com/hyperledger/cello/src/agent/fabric-operator -COPY src/agent/fabric-operator /go/src/github.com/hyperledger/cello/src/agent -RUN cd /go/src/github.com/hyperledger/cello/src/agent/fabric-operator && \ - go build -o fabric-operator \ - -gcflags all=-trimpath=/go/src/github.com/hyperledger/cello/src/agent \ - -asmflags all=-trimpath=/go/src/github.com/hyperledger/cello/src/agent \ - github.com/hyperledger/cello/src/agent/fabric-operator/cmd/manager - -# Build the fabric kubernetes operator docker image -FROM registry.access.redhat.com/ubi7/ubi-minimal:latest -ENV OPERATOR=/usr/local/bin/fabric-operator \ - USER_UID=1001 \ - USER_NAME=fabric-operator - -# Place the operator binary in /usr/local/bin directory -COPY --from=builder /go/src/github.com/hyperledger/cello/src/agent/fabric-operator/fabric-operator ${OPERATOR} -COPY src/agent/fabric-operator/build/bin /usr/local/bin -RUN /usr/local/bin/user_setup - -ENTRYPOINT ["/usr/local/bin/entrypoint"] - -USER ${USER_UID} diff --git a/src/agent/fabric-operator/README.md b/src/agent/fabric-operator/README.md deleted file mode 100755 index 372c08051..000000000 --- a/src/agent/fabric-operator/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# Hyperledger Fabric Operator - -## Overview - -Fabric operator is the kubernetes operator to allow a user to stand up -fabric CA, Orderer and Peer node using kubectl - -## Prerequisites - -- [kubectl][kubectl_tool] v1.11.3+ -- Access to a Kubernetes v1.11.3+ cluster -- A PersistentVolume storage location with AccessMode of ReadWriteOnce for each ca, peer, and orderer. - -## Getting Started - -### [Start up fabric operator](#startup) - -``` -$ kubectl apply \ - -f https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_crd.yaml?raw=true -``` - -The command should finish successfully if you see messages like the below: - -``` -customresourcedefinition.apiextensions.k8s.io/cas.fabric.hyperledger.org created -customresourcedefinition.apiextensions.k8s.io/orderers.fabric.hyperledger.org created -customresourcedefinition.apiextensions.k8s.io/peers.fabric.hyperledger.org created -``` -Once the operator crds get created, start up the controller using the following command -``` -kubectl apply \ - -f https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/fabric-operator.yaml?raw=true -``` -The above command starts up the fabric operator controller in your default namespace of your k8s cluster. If you try to use -a different namespace, you should download the fabric-operator.yaml file and change the namespace from default to whatever -the namespace that you want to use. - -### [Stand up a Fabric CA node](#startupca) - -1. Download the [example fabric ca spec file][ca_spec] -``` -wget https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml?raw=true -O myca.yaml -``` -2. Make changes to the example ca spec file according to your needs. Here are the list of things that you can change in the example ca spec file. - *. Node name - *. CA admin user name and password - *. CA certificates - *. CA node release, resource allocation, configuration parameters -3. Run the following command to stand up the CA node:: -``` -kubectl apply -f myca.yaml -``` -after few minutes, your CA node should be up running, you can see it status by using the following command: - -``` -kubectl describe ca -``` - -To delete the CA node, you can simply do the following command, assume you name your CA ca1st -``` -kubectl delete ca ca1st -``` - -### [Stand up a Fabric Peer node](#standuppeer) - -1. Download the [example fabric peer spec file][peer_spec] -``` -wget https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml?raw=true -O mypeer.yaml -``` -2. Make changes to the example peer spec file according to your needs. Here are the list of things that you can change in the example peer spec file. - *. Node name - *. MSP and TLS certs - *. Peer node release, resource allocation, configuration parameters -3. Run the following command to stand up the Peer node -``` -kubectl apply -f mypeer.yaml -``` -after few minutes, your Peer node should be up running, you can see it status by using the following command: - -``` -kubectl describe peer -``` -To delete the peer node, you can simply do the following command, assume you named your peer peer1st: -``` -kubectl delete peer peer1st -``` - - -### [Stand up a Fabric Orderer node](#standuporderer) - -1. Download the [example fabric orderer spec file][orderer_spec] -``` -wget https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml?raw=true -O myorderer.yaml -``` -2. Make changes to the example orderer spec file according to your needs. Here are the list of things that you can change in the example orderer spec file. - *. Node name - *. MSP and TLS certs - *. Orderer node release, resource allocation, configuration parameters -3. Run the following command to stand up the Peer node:: -``` -kubectl apply -f myorderer.yaml -``` -after few minutes, your orderer node should be up running, you can see it status by using the following command: - -``` -kubectl describe orderer -``` -To delete the orderer node, you can simply do the following command, assume you name your orderer orderer1st -``` -kubectl delete orderer orderer1st -``` - -[kubectl_tool]:https://kubernetes.io/docs/tasks/tools/install-kubectl/ -[operator_spec]:https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/operator.yaml?raw=true -[ca_spec]:https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml?raw=true -[peer_spec]:https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml?raw=true -[orderer_spec]:https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml?raw=true - -## Fabric Operator from the API / Dashboard - -To run the operator using the cello API or dashboard follow the instructions here :- [Fabric Operator Agent README](https://github.com/hyperledger/cello/blob/master/src/agent/fabric-operator/README.md) - -Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/src/agent/fabric-operator/agent/Dockerfile b/src/agent/fabric-operator/agent/Dockerfile deleted file mode 100644 index 2a9bd0ec0..000000000 --- a/src/agent/fabric-operator/agent/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Dockerfile for hyperledger cello fabirc operator agent -# -# @see https://github.com/hyperledger/cello/tree/master/docs/agents/fabric-operator.md -# -FROM alpine/git AS BUILD - -RUN release=$(wget -O - https://storage.googleapis.com/kubernetes-release/release/stable.txt) && \ - wget https://storage.googleapis.com/kubernetes-release/release/${release}/bin/linux/amd64/kubectl -O /kubectl - -FROM alpine -RUN apk update && apk add jq gettext curl bash && mkdir /home/app -COPY src/agent/fabric-operator/deploy /home/app -COPY src/agent/fabric-operator/agent /home/app -COPY --from=build /kubectl /usr/local/bin/kubectl -RUN chmod +x /usr/local/bin/kubectl - - -ENV HOME /home -WORKDIR /home/app -ENV KUBECONFIG /home/.kube/config - -CMD bash /home/app/agent_operation.sh diff --git a/src/agent/fabric-operator/agent/agent_operation.sh b/src/agent/fabric-operator/agent/agent_operation.sh deleted file mode 100644 index d1f696395..000000000 --- a/src/agent/fabric-operator/agent/agent_operation.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -#Download kubernetes config -echo "Downloading Necessary Files..." -source download_files.sh - -#Check if the namespace exists -NAMESPACE_EXISTS=`kubectl get namespaces | grep $AGENT_ID` - -#Create a namespace if it doesn't exists -if [ -z "$NAMESPACE_EXISTS" ] -then - kubectl create namespace $AGENT_ID -fi - -CURRENT_NAMESPACE=$AGENT_ID - -#Set namespace as default for current context -kubectl config set-context --current --namespace=$CURRENT_NAMESPACE - -if [ "$OPERATION" = "create" ] -then - bash create.sh -elif [ "$OPERATION" = "delete" ] -then - bash delete.sh -else - echo "Not supported OPERATION" - exit -fi diff --git a/src/agent/fabric-operator/agent/create.sh b/src/agent/fabric-operator/agent/create.sh deleted file mode 100755 index 1018a63ea..000000000 --- a/src/agent/fabric-operator/agent/create.sh +++ /dev/null @@ -1,155 +0,0 @@ -function __wait-until-pods-created() { - local period interval i pod - - period="$1" - interval="$2" - pod="$3" - - for ((i=0; i<$period; i+=$interval)); do - STATUS=$(kubectl get pods $pod -o json | jq .status.phase ) - if [[ $STATUS ]]; then - return 0 - fi - - echo "Waiting for pods to be created..." - sleep "$interval" - done - - echo "Waited for $period seconds, but pods are not created yet." - return 1 -} - -echo "Creating Node..." - -if [ "$NODE_TYPE" = "ca" ] -then - CR_NAME="deploy-"${NODE_ID} - kubectl apply -f deploy/crds/fabric_v1alpha1_ca_crd.yaml - cat > cr_config.yaml << EOL -apiVersion: fabric.hyperledger.org/v1alpha1 -kind: CA -metadata: - name: $CR_NAME -spec: - admin: `jq '.admin_name' <<< "$FABRIC_CA_CONFIG"` - adminPassword: `jq '.admin_password' <<< "$FABRIC_CA_CONFIG"` - certs: - cert: `jq '.spec.certs.cert' <<< cat config.json` - key: `jq '.spec.certs.key' <<< cat config.json` - tlsCert: `jq '.spec.certs.tlsCert' <<< cat config.json` - TLSKey: `jq '.spec.certs.tlsKey' <<< cat config.json` - nodeSpec: - storageSize: `jq '.spec.nodeSpec.storageSize' <<< cat config.json` - storageClass: `jq '.spec.nodeSpec.storageClass' <<< cat config.json` - image: `jq '.spec.nodeSpec.image' <<< cat config.json` - hosts: [`jq '.hosts' <<< "$FABRIC_CA_CONFIG"`] - resources: - requests: - memory: `jq '.spec.nodeSpec.resources.requests.memory' <<< cat config.json` - cpu: `jq '.spec.nodeSpec.resources.requests.cpu' <<< cat config.json` - limits: - memory: `jq '.spec.nodeSpec.resources.limits.memory' <<< cat config.json` - cpu: `jq '.spec.nodeSpec.resources.limits.cpu' <<< cat config.json` - configParams: -`jq -r '.spec.nodeSpec.configParams[] | " - name: \(.name)\n value: \"\(.value)\""' config.json` -EOL - -elif [ "$NODE_TYPE" = "peer" ] -then - CR_NAME="deploy-"${NODE_ID} - kubectl apply -f deploy/crds/fabric_v1alpha1_peer_crd.yaml - cat > cr_config.yaml << EOL -apiVersion: fabric.hyperledger.org/v1alpha1 -kind: Peer -metadata: - name: $CR_NAME -spec: - msp: - adminCerts: `jq -c '.spec.msp.adminCerts' <<< cat config.json` - caCerts: `jq -c '.spec.msp.caCerts' <<< cat config.json` - keyStore: `jq -c '.spec.msp.keyStore' <<< cat config.json` - signCerts: `jq -c '.spec.msp.signCerts' <<< cat config.json` - tlsCacerts: `jq -c '.spec.msp.tlsCacerts' <<< cat config.json` - tls: - tlsCert: `jq -c '.spec.tls.tlsCert' <<< cat config.json` - tlsKey: `jq -c '.spec.tls.tlsKey' <<< cat config.json` - nodeSpec: - storageSize: `jq '.spec.nodeSpec.storageSize' <<< cat config.json` - storageClass: `jq '.spec.nodeSpec.storageClass' <<< cat config.json` - image: `jq '.spec.nodeSpec.image' <<< cat config.json ` - hosts: [`jq '.hosts' <<< "$FABRIC_CA_CONFIG"`] - resources: - requests: - memory: `jq '.spec.nodeSpec.resources.requests.memory' <<< cat config.json` - cpu: `jq '.spec.nodeSpec.resources.requests.cpu' <<< cat config.json` - limits: - memory: `jq '.spec.nodeSpec.resources.limits.memory' <<< cat config.json` - cpu: `jq '.spec.nodeSpec.resources.limits.cpu' <<< cat config.json` - configParams: -`jq -r '.spec.nodeSpec.configParams[] | " - name: \(.name)\n value: \"\(.value)\""' config.json` -EOL - -elif [ "$NODE_TYPE" = "orderer" ] -then - CR_NAME="deploy-"${NODE_ID} - kubectl apply -f deploy/crds/fabric_v1alpha1_orderer_crd.yaml - cat > cr_config.yaml << EOL -apiVersion: fabric.hyperledger.org/v1alpha1 -kind: Orderer -metadata: - name: $CR_NAME - spec: - msp: - adminCerts: `jq '.spec.msp.adminCerts' <<< cat config.json` - caCerts: `jq '.spec.msp.caCerts' <<< cat config.json` - keyStore: `jq '.spec.msp.keyStore' <<< cat config.json` - signCerts: `jq '.spec.msp.signCerts' <<< cat config.json` - tlsCacerts: `jq '.spec.msp.tlsCacerts' <<< cat config.json` - tls: - tlsCert: `jq '.spec.tls.tlsCert' <<< cat config.json` - tlsKey: `jq '.spec.tls.tlsKey' <<< cat config.json` - nodeSpec: - storageSize: `jq '.spec.nodeSpec.storageSize' <<< cat config.json` - storageClass: `jq '.spec.nodeSpec.storageClass' <<< cat config.json` - image: `jq '.spec.nodeSpec.image' <<< cat config.json ` - hosts: [`jq '.hosts' <<< "$FABRIC_CA_CONFIG"`] - resources: - requests: - memory: `jq '.spec.nodeSpec.resources.requests.memory' <<< cat config.json` - cpu: `jq '.spec.nodeSpec.resources.requests.cpu' <<< cat config.json` - limits: - memory: `jq '.spec.nodeSpec.resources.limits.memory' <<< cat config.json` - cpu: `jq '.spec.nodeSpec.resources.limits.cpu' <<< cat config.json` - configParams: - `jq -r '.spec.nodeSpec.configParams[] | " - name: \(.name)\n value: \"\(.value)\""' config.json` -EOL -else - echo "Node Type Sent is Invalid/Not Supported" - exit 1 -fi - -#Deploying Operator image -kubectl apply -f deploy/operator.yaml -kubectl apply -f deploy/fabric-operator.yaml - -#Creating the Custom Resource -kubectl apply -f cr_config.yaml - -STATUS="Pending" -NODE_STATUS="deploying" - -# Waiting for the Pods to be created -__wait-until-pods-created 20 3 "$CR_NAME-0" - -if [ "$STATUS" = "\"Pending\"" ]; then - NODE_STATUS="deploying" -elif [ "$STATUS" = "\"Running\"" ]; then - NODE_STATUS="running" -fi - -#Get ports of the service created -PORTS=$(kubectl get svc $CR_NAME -o json | jq -r '[.spec.ports[] | { external: .nodePort, internal: .port }]') - -#Update node api -echo "Updating the Node Status in the API Backend" -curl $NODE_DETAIL_URL -X "PUT" -H "Authorization: JWT ${TOKEN}" -H 'Content-Type: application/json' -H "accept: application/json" -d "{ \"status\": \"$NODE_STATUS\", \"ports\": ${PORTS} }" diff --git a/src/agent/fabric-operator/agent/delete.sh b/src/agent/fabric-operator/agent/delete.sh deleted file mode 100644 index 877f39586..000000000 --- a/src/agent/fabric-operator/agent/delete.sh +++ /dev/null @@ -1,32 +0,0 @@ -echo "Deleting Node" - -TYPE_OF_NODE=$NODE_TYPE - -if [ $TYPE_OF_NODE = "ca" ] -then - CR_NAME="deploy-"${NODE_ID} - kubectl delete ca $CR_NAME -elif [ $TYPE_OF_NODE = "peer" ] -then - CR_NAME="deploy-"${NODE_ID} - kubectl delete peer $CR_NAME -elif [ $TYPE_OF_NODE = "orderer" ] -then - CR_NAME="deploy-"${NODE_ID} - kubectl delete orderer $CR_NAME -else - echo "Invalid node type" - exit 1 -fi - -STATUS="deleting" - -#Get Status of pod -STATUS=$(kubectl get pods "$CR_NAME-0" -o json | jq .status.phase ) - -if [ $STATUS = "deleting" ]; then - NODE_STATUS="deleted" - #Update node api - echo "Updating the Node Status in the API Backend" - curl $NODE_DETAIL_URL -X "PUT" -H "Authorization: JWT ${TOKEN}" -H 'Content-Type: application/json' -H "accept: application/json" -d "{ \"status\": \"$NODE_STATUS\"}" -fi diff --git a/src/agent/fabric-operator/agent/download_files.sh b/src/agent/fabric-operator/agent/download_files.sh deleted file mode 100755 index b0d2a8bc7..000000000 --- a/src/agent/fabric-operator/agent/download_files.sh +++ /dev/null @@ -1,20 +0,0 @@ -echo "Getting Kubernetes Agent Config..." - -#Get kubernetes config file -wget $AGENT_CONFIG_FILE -CONFIG_FILE=$(basename $AGENT_CONFIG_FILE) -mkdir $HOME/.kube/ - -if [ ${CONFIG_FILE#*.} = "zip" ] -then - echo "Extracting the Kubernetes Config File..." - unzip $CONFIG_FILE -d $HOME/ -else - mv $CONFIG_FILE $HOME/.kube/config -fi - -echo "Getting Node Files..." -wget $NODE_FILE_URL -NODE_FILE=$(basename $NODE_FILE_URL) -echo "Extracting Node Files" -tar -xvzf $NODE_FILE diff --git a/src/agent/fabric-operator/agent/samples/peer_config.json b/src/agent/fabric-operator/agent/samples/peer_config.json deleted file mode 100644 index b8f3c363c..000000000 --- a/src/agent/fabric-operator/agent/samples/peer_config.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "spec": { - "msp": { - "adminCerts": [ - "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNCVENDQWF5Z0F3SUJBZ0lRU2E4RmZ0RkpHOXFtd0diNmMrVWtyREFLQmdncWhrak9QUVFEQWpCYk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RU5NQXNHQTFVRUNoTUViM0puTURFUU1BNEdBMVVFQXhNSFkyRXViM0puTURBZUZ3MHhPVEV3Ck1ESXhOak0xTURCYUZ3MHlPVEE1TWpreE5qTTFNREJhTUdBeEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUkKRXdwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSEV3MVRZVzRnUm5KaGJtTnBjMk52TVE4d0RRWURWUVFMRXdaagpiR2xsYm5ReEV6QVJCZ05WQkFNTUNrRmtiV2x1UUc5eVp6QXdXVEFUQmdjcWhrak9QUUlCQmdncWhrak9QUU1CCkJ3TkNBQVJBNUNvUlhvRmFHZEEwM3JXL2xWVm95eFRHMzltM0lSYnl6Z0xGOGpYWGlSYTFWZHloQXNqMmRScy8KTjh2YWZyVmJHRmdVVFd5SnB2Y3VPS2FxVGV5L28wMHdTekFPQmdOVkhROEJBZjhFQkFNQ0I0QXdEQVlEVlIwVApBUUgvQkFJd0FEQXJCZ05WSFNNRUpEQWlnQ0RGVXR1QUpYYVlQSTRsQlNJeWhmOS9TUmdYeklpTGdha2wzdGlyCk1zT0szVEFLQmdncWhrak9QUVFEQWdOSEFEQkVBaUFrQXBtTXUzR1JIL1dVdXoxZEFZQ3E4MU0vaTlSQk16S1EKUXhrNVRvWm55Z0lnSDhRNkorTG5IUWE0ckJPelQ4SkMvODQxT3AzSy9UcXB3UHQ2ZEs1YU1nMD0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=" - ], - "caCerts": [ - "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNJRENDQWNlZ0F3SUJBZ0lRRGJUWUpiUmJrYnErQ3NQTFQ2b0VzekFLQmdncWhrak9QUVFEQWpCYk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RU5NQXNHQTFVRUNoTUViM0puTURFUU1BNEdBMVVFQXhNSFkyRXViM0puTURBZUZ3MHhPVEV3Ck1ESXhOak0xTURCYUZ3MHlPVEE1TWpreE5qTTFNREJhTUZzeEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUkKRXdwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSEV3MVRZVzRnUm5KaGJtTnBjMk52TVEwd0N3WURWUVFLRXdSdgpjbWN3TVJBd0RnWURWUVFERXdkallTNXZjbWN3TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFClFRR2FsN3VmMkt3c3Bxa1NHd0NkVVd1emc3MnV6NXNRZS9LNE9lNUlaSVVDM2hwQWduRlpwQnlvTHNFTE1GNTgKNnY4NG1aK1dCVnFNa2Nra0xIcHdIcU50TUdzd0RnWURWUjBQQVFIL0JBUURBZ0dtTUIwR0ExVWRKUVFXTUJRRwpDQ3NHQVFVRkJ3TUNCZ2dyQmdFRkJRY0RBVEFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQ2tHQTFVZERnUWlCQ0RGClV0dUFKWGFZUEk0bEJTSXloZjkvU1JnWHpJaUxnYWtsM3Rpck1zT0szVEFLQmdncWhrak9QUVFEQWdOSEFEQkUKQWlFQXBNMUQ0eVhEdXFBZ1ZzeW5KU1p3Q2hQa0JJZGJKNjNybiswQnloOHV4QlVDSHpIVUh0dkJMZ2RTOHdZTAp5UnRmakZtd25JaEVUODd5U2ZOS3JuejVURVE9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" - ], - "keyStore": "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR0hBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJHMHdhd0lCQVFRZ1dtM3l3OUx6Z3FDREllekwKRU1MeUVxcldyQU1TWHhESmZMM2t2d3ZiWHBlaFJBTkNBQVF1Y3FVS2dldnc2ek9OVERrajdVMWplOXkyQzd2awpjdkRnWDh1Ujh1WkQ2NmxxcjI3UmRDbU5IcEJrU3JpWVlsU0o2QWQ4Q2VCTUJZSDlsbm9QdVNCMgotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCg==", - "signCerts": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNDVENDQWJDZ0F3SUJBZ0lSQUo5MFY0VFBGYVJmOExIUXVFbnR4Rll3Q2dZSUtvWkl6ajBFQXdJd1d6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhEVEFMQmdOVkJBb1RCRzl5WnpBeEVEQU9CZ05WQkFNVEIyTmhMbTl5WnpBd0hoY05NVGt4Ck1EQXlNVFl6TlRBd1doY05Namt3T1RJNU1UWXpOVEF3V2pCak1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUUKQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeVlXNWphWE5qYnpFTk1Bc0dBMVVFQ3hNRQpjR1ZsY2pFWU1CWUdBMVVFQXhNUGNHVmxjakV0YjNKbk1DNXZjbWN3TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJCnpqMERBUWNEUWdBRUxuS2xDb0hyOE9zempVdzVJKzFOWTN2Y3RndTc1SEx3NEYvTGtmTG1RK3VwYXE5dTBYUXAKalI2UVpFcTRtR0pVaWVnSGZBbmdUQVdCL1paNkQ3a2dkcU5OTUVzd0RnWURWUjBQQVFIL0JBUURBZ2VBTUF3RwpBMVVkRXdFQi93UUNNQUF3S3dZRFZSMGpCQ1F3SW9BZ3hWTGJnQ1YybUR5T0pRVWlNb1gvZjBrWUY4eUlpNEdwCkpkN1lxekxEaXQwd0NnWUlLb1pJemowRUF3SURSd0F3UkFJZ1piZ1JqZE52dHJXRnlpUStqVU5KVTRKQURMYXEKTVRXbEdXbUkxeVBheUZjQ0lGN2xscHJsa1pZMXB4RW16QWptMm1ueWxrNGl2cys0ZnNKRys4d2htOU4zCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", - "tlsCacerts": [ - "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNLRENDQWM2Z0F3SUJBZ0lSQU1acmVFeVJaaUhhQTJYYUtVbTUrcXN3Q2dZSUtvWkl6ajBFQXdJd1hqRUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhEVEFMQmdOVkJBb1RCRzl5WnpBeEV6QVJCZ05WQkFNVENuUnNjMk5oTG05eVp6QXdIaGNOCk1Ua3hNREF5TVRZek5UQXdXaGNOTWprd09USTVNVFl6TlRBd1dqQmVNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUcKQTFVRUNCTUtRMkZzYVdadmNtNXBZVEVXTUJRR0ExVUVCeE1OVTJGdUlFWnlZVzVqYVhOamJ6RU5NQXNHQTFVRQpDaE1FYjNKbk1ERVRNQkVHQTFVRUF4TUtkR3h6WTJFdWIzSm5NREJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5CkF3RUhBMElBQkhuWjV4Vng2b1YwaGVYQ0FqRnVnSFVLcDVZdFlmb0ZvOGk4Y2JhcEZKYmJYcnNsdkxTamdMRTYKTld4a21GNXkzRzNHMzJQcWEvTk4wVTZGdUVjNm1oNmpiVEJyTUE0R0ExVWREd0VCL3dRRUF3SUJwakFkQmdOVgpIU1VFRmpBVUJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WCkhRNEVJZ1FnTWZBc3BjTjFaTTlLRlFpOTcwWVQwRHJmZ2RLVm1IQUhVUlpuSVRNMHg0VXdDZ1lJS29aSXpqMEUKQXdJRFNBQXdSUUloQUpobTZnVC9WNXJ1c3k5Y0pMSGt3aGpxaUhBN04yRGtVUUNhQ01nUFE5UjZBaUFROE1zdQpFRWF1SXk3ZlhvUVZTQjV2c1VFZXlCd3N5KytndWp0NVR6WlprZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" - ] - }, - "tls": { - "tlsCert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNnakNDQWlpZ0F3SUJBZ0lRQUlEN1FncCtGMzBHR2I1THhzVmdqekFLQmdncWhrak9QUVFEQWpCZU1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RU5NQXNHQTFVRUNoTUViM0puTURFVE1CRUdBMVVFQXhNS2RHeHpZMkV1YjNKbk1EQWVGdzB4Ck9URXdNREl4TmpNMU1EQmFGdzB5T1RBNU1qa3hOak0xTURCYU1GUXhDekFKQmdOVkJBWVRBbFZUTVJNd0VRWUQKVlFRSUV3cERZV3hwWm05eWJtbGhNUll3RkFZRFZRUUhFdzFUWVc0Z1JuSmhibU5wYzJOdk1SZ3dGZ1lEVlFRRApFdzl3WldWeU1TMXZjbWN3TG05eVp6QXdXVEFUQmdjcWhrak9QUUlCQmdncWhrak9QUU1CQndOQ0FBUnROVDRkClFMTnRuS013WjJnRjF3RHIrRmpodXkyOW9lekJuVjREOXNiSHJpRWhFdWluYWxERlpYaVA2UmN4Q1kyTHFocDcKLzZTVGdFdXZsSkZvVU1JMG80SFJNSUhPTUE0R0ExVWREd0VCL3dRRUF3SUZvREFkQmdOVkhTVUVGakFVQmdncgpCZ0VGQlFjREFRWUlLd1lCQlFVSEF3SXdEQVlEVlIwVEFRSC9CQUl3QURBckJnTlZIU01FSkRBaWdDQXg4Q3lsCnczVmt6MG9WQ0wzdlJoUFFPdCtCMHBXWWNBZFJGbWNoTXpUSGhUQmlCZ05WSFJFRVd6QlpnZzl3WldWeU1TMXYKY21jd0xtOXlaekNDQ25CbFpYSXhMVzl5WnpDSEJLazh4M1dIQktrOHgzMkhCS2s4eDNTSEJLazh4M2lIQktrOAp4M3VIQkFxeGE4aUhCQXF4YSsySEJBcXhhKytIQkFxeGEveUhCQXF4YS80d0NnWUlLb1pJemowRUF3SURTQUF3ClJRSWhBSUxkLzhQQ0NnVGFFbWw2RW5tZUM3OTlVR3dpb0tHcUlqVmZxdlhGekF6N0FpQk50OEoxVjJKZUY3MjQKekhCR3hEc2pIc3BNekt0M3VjRnIxRStRUHcvNjJ3PT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", - "tlsKey": "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR0hBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJHMHdhd0lCQVFRZ2FqNlNud0pUZjRkclYyMzcKZFBEc2tDcDI4QnlXcXE4R0IrSXNBODZQWUFDaFJBTkNBQVJ0TlQ0ZFFMTnRuS013WjJnRjF3RHIrRmpodXkyOQpvZXpCblY0RDlzYkhyaUVoRXVpbmFsREZaWGlQNlJjeENZMkxxaHA3LzZTVGdFdXZsSkZvVU1JMAotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCg==" - }, - "nodeSpec": { - "storageSize": "1Gi", - "storageClass": "default", - "image": "hyperledger/fabric-peer:1.4.3", - "configParams": [ - { - "name": "CORE_PEER_ADDRESSAUTODETECT", - "value": "7054" - }, - { - "name": "CORE_PEER_TLS_ENABLED", - "value": "true" - } - ] - } - } -} diff --git a/src/agent/fabric-operator/build/Dockerfile b/src/agent/fabric-operator/build/Dockerfile deleted file mode 100644 index 66735eb5a..000000000 --- a/src/agent/fabric-operator/build/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM registry.access.redhat.com/ubi7/ubi-minimal:latest - -ENV OPERATOR=/usr/local/bin/fabric-operator \ - USER_UID=1001 \ - USER_NAME=fabric-operator - -# install operator binary -COPY build/_output/bin/fabric-operator ${OPERATOR} - -COPY build/bin /usr/local/bin -RUN /usr/local/bin/user_setup - -ENTRYPOINT ["/usr/local/bin/entrypoint"] - -USER ${USER_UID} diff --git a/src/agent/fabric-operator/build/bin/entrypoint b/src/agent/fabric-operator/build/bin/entrypoint deleted file mode 100755 index 37abc9c8e..000000000 --- a/src/agent/fabric-operator/build/bin/entrypoint +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -e - -# This is documented here: -# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines - -if ! whoami &>/dev/null; then - if [ -w /etc/passwd ]; then - echo "${USER_NAME:-fabric-operator}:x:$(id -u):$(id -g):${USER_NAME:-fabric-operator} user:${HOME}:/sbin/nologin" >> /etc/passwd - fi -fi - -exec ${OPERATOR} $@ diff --git a/src/agent/fabric-operator/build/bin/scripts/ca_config.sh b/src/agent/fabric-operator/build/bin/scripts/ca_config.sh deleted file mode 100755 index 41db484cd..000000000 --- a/src/agent/fabric-operator/build/bin/scripts/ca_config.sh +++ /dev/null @@ -1 +0,0 @@ -envsubst < /toolset/ca_config.yaml > /etc/hyperledger/fabric-ca-server-config/fabric-ca-server-config.yaml \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/scripts/ca_config.yaml b/src/agent/fabric-operator/build/bin/scripts/ca_config.yaml deleted file mode 100755 index 73a6e602e..000000000 --- a/src/agent/fabric-operator/build/bin/scripts/ca_config.yaml +++ /dev/null @@ -1,26 +0,0 @@ -registry: - maxenrollments: -1 - - identities: - - name: $FCO_CA_ADMIN_NAME - pass: $FCO_CA_ADMIN_PASSWORD - type: client - affiliation: "" - maxenrollments: -1 - attrs: - hf.Registrar.Roles: "*" - hf.Registrar.DelegateRoles: "*" - hf.Revoker: true - hf.IntermediateCA: true - hf.GenCRL: true - hf.Registrar.Attributes: "*" - hf.AffiliationMgr: true -ldap: - enabled: false - -csr: - keyrequest: - algo: ecdsa - size: 256 - serialnumber: - hosts: $FCO_HOSTS diff --git a/src/agent/fabric-operator/build/bin/scripts/orderer_config.sh b/src/agent/fabric-operator/build/bin/scripts/orderer_config.sh deleted file mode 100644 index e1bca756d..000000000 --- a/src/agent/fabric-operator/build/bin/scripts/orderer_config.sh +++ /dev/null @@ -1,14 +0,0 @@ - -envsubst < /toolset/orderer_configtx.yaml > /var/orderer/configtx.yaml -cd /var/orderer -mkdir -p msp/admincerts msp/cacerts msp/keystore msp/signcerts msp/tlscacerts /var/orderer/tls -cd /certs -cp admincert* /var/orderer/msp/admincerts -cp cacert* /var/orderer/msp/cacerts -cp keystore /var/orderer/msp/keystore/private.key -cp signcert /var/orderer/msp/signcerts/node.pem -cp tlscacert* /var/orderer/msp/tlscacerts -cp cacert0 /var/orderer/tls/ca.crt -cp tlscert /var/orderer/tls/server.crt -cp tlskey /var/orderer/tls/server.key -mkdir -p /var/orderer/production \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/scripts/orderer_configtx.yaml b/src/agent/fabric-operator/build/bin/scripts/orderer_configtx.yaml deleted file mode 100644 index 614191dd1..000000000 --- a/src/agent/fabric-operator/build/bin/scripts/orderer_configtx.yaml +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: Apache-2.0 -# ---- -Organizations: -- &$REAL_ORG - Name: $REAL_ORG - ID: $REAL_ORG - MSPDir: msp - Policies: &OrgPolicies - Readers: - Type: Signature - Rule: "OR('$REAL_ORG.member')" - Writers: - Type: Signature - Rule: "OR('$REAL_ORG.member')" - Admins: - Type: Signature - Rule: "OR('$REAL_ORG.admin')" - OrdererEndpoints: - - "127.0.0.1:7050" - AnchorPeers: - - Host: 127.0.0.1 - Port: 7051 -Capabilities: - Channel: &ChannelCapabilities - V1_4_3: true - V1_3: false - V1_1: false - Orderer: &OrdererCapabilities - V1_4_2: true - V1_1: false - Application: &ApplicationCapabilities - V1_4_2: true - V1_3: false - V1_2: false - V1_1: false -Application: &ApplicationDefaults - ACLs: &ACLsDefault - lscc/ChaincodeExists: /Channel/Application/Readers - lscc/GetDeploymentSpec: /Channel/Application/Readers - lscc/GetChaincodeData: /Channel/Application/Readers - lscc/GetInstantiatedChaincodes: /Channel/Application/Readers - qscc/GetChainInfo: /Channel/Application/Readers - qscc/GetBlockByNumber: /Channel/Application/Readers - qscc/GetBlockByHash: /Channel/Application/Readers - qscc/GetTransactionByID: /Channel/Application/Readers - qscc/GetBlockByTxID: /Channel/Application/Readers - cscc/GetConfigBlock: /Channel/Application/Readers - cscc/GetConfigTree: /Channel/Application/Readers - cscc/SimulateConfigTreeUpdate: /Channel/Application/Readers - peer/Propose: /Channel/Application/Writers - peer/ChaincodeToChaincode: /Channel/Application/Readers - event/Block: /Channel/Application/Readers - event/FilteredBlock: /Channel/Application/Readers - Organizations: - Policies: &ApplicationDefaultPolicies - Readers: - Type: ImplicitMeta - Rule: "ANY Readers" - Writers: - Type: ImplicitMeta - Rule: "ANY Writers" - Admins: - Type: ImplicitMeta - Rule: "MAJORITY Admins" - Capabilities: - <<: *ApplicationCapabilities -Orderer: &OrdererDefaults - Addresses: - BatchTimeout: 2s - BatchSize: - MaxMessageCount: 500 - AbsoluteMaxBytes: 10 MB - PreferredMaxBytes: 2 MB - MaxChannels: 0 - EtcdRaft: - Consenters: - - Host: raft0.example.com - Port: 7050 - ClientTLSCert: /etc/hyperledger/fabric/tls/server.crt - ServerTLSCert: /etc/hyperledger/fabric/tls/server.crt - Options: - TickInterval: 500ms - ElectionTick: 10 - HeartbeatTick: 1 - MaxInflightBlocks: 5 - SnapshotIntervalSize: 20 MB - Organizations: - Policies: - Readers: - Type: ImplicitMeta - Rule: "ANY Readers" - Writers: - Type: ImplicitMeta - Rule: "ANY Writers" - Admins: - Type: ImplicitMeta - Rule: "MAJORITY Admins" - BlockValidation: - Type: ImplicitMeta - Rule: "ANY Writers" - Capabilities: - <<: *OrdererCapabilities -Channel: &ChannelDefaults - Policies: - Readers: - Type: ImplicitMeta - Rule: "ANY Readers" - Writers: - Type: ImplicitMeta - Rule: "ANY Writers" - Admins: - Type: ImplicitMeta - Rule: "MAJORITY Admins" - Capabilities: - <<: *ChannelCapabilities -Profiles: - EtcdRaft: - <<: *ChannelDefaults - Orderer: - <<: *OrdererDefaults - OrdererType: etcdraft - Organizations: - - <<: *$REAL_ORG - Policies: - <<: *OrgPolicies - Admins: - Type: Signature - Rule: "OR('$REAL_ORG.member')" - Application: - <<: *ApplicationDefaults - Organizations: - - <<: *$REAL_ORG - Policies: - <<: *OrgPolicies - Admins: - Type: Signature - Rule: "OR('$REAL_ORG.member')" - Consortiums: - SampleConsortium: - Organizations: - - <<: *$REAL_ORG - Policies: - <<: *OrgPolicies - Admins: - Type: Signature - Rule: "OR('$REAL_ORG.member')" \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/scripts/peer_config.sh b/src/agent/fabric-operator/build/bin/scripts/peer_config.sh deleted file mode 100644 index 8ddb1ece2..000000000 --- a/src/agent/fabric-operator/build/bin/scripts/peer_config.sh +++ /dev/null @@ -1,13 +0,0 @@ - -cd /var/peer -mkdir -p msp/admincerts msp/cacerts msp/keystore msp/signcerts msp/tlscacerts /var/peer/tls -cd /certs -cp admincert* /var/peer/msp/admincerts -cp cacert* /var/peer/msp/cacerts -cp keystore /var/peer/msp/keystore/private.key -cp signcert /var/peer/msp/signcerts/node.pem -cp tlscacert* /var/peer/msp/tlscacerts -cp cacert0 /var/peer/tls/ca.crt -cp tlscert /var/peer/tls/server.crt -cp tlskey /var/peer/tls/server.key -mkdir -p /var/peer/production \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/templates/ca/ca_secret.yaml b/src/agent/fabric-operator/build/bin/templates/ca/ca_secret.yaml deleted file mode 100644 index 9b17ea2d2..000000000 --- a/src/agent/fabric-operator/build/bin/templates/ca/ca_secret.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: "" -type: Opaque -data: - key: "YWRtaW4=" \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/templates/ca/ca_service.yaml b/src/agent/fabric-operator/build/bin/templates/ca/ca_service.yaml deleted file mode 100755 index 02d7d1bac..000000000 --- a/src/agent/fabric-operator/build/bin/templates/ca/ca_service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: "" - name: "" -spec: - selector: - k8s-app: "" - type: NodePort - ports: - - name: caport - port: 7054 diff --git a/src/agent/fabric-operator/build/bin/templates/ca/ca_statefulset.yaml b/src/agent/fabric-operator/build/bin/templates/ca/ca_statefulset.yaml deleted file mode 100755 index 67f2535fc..000000000 --- a/src/agent/fabric-operator/build/bin/templates/ca/ca_statefulset.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "" -spec: - serviceName: "" - selector: - matchLabels: - k8s-app: "" - type: ca - replicas: 1 - volumeClaimTemplates: - - metadata: - name: castorage - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: "default" - resources: - requests: - storage: "1Gi" - template: - metadata: - labels: - k8s-app: "" - type: "ca" - component: "ca" - spec: - volumes: - - name: cacerts - secret: - secretName: cacerts - - name: toolset - configMap: - name: fabric-toolset - initContainers: - - name: init - image: "hfrd/envsubst:latest" - env: - - name: "FABRIC_CA_HOME" - value: "/etc/hyperledger/fabric-ca-server" - - name: "PERMISSIONS_UID" - value: "1000" - - name: "PERMISSIONS_GID" - value: "0" - - name: "PERMISSIONS_FOLDERS" - value: "/etc/hyperledger/fabric-ca-server" - - name: "FCO_CA_ADMIN_NAME" - value: "" - - name: "FCO_CA_ADMIN_PASSWORD" - value: "" - volumeMounts: - - mountPath: "/etc/hyperledger/fabric-ca-server-config" - name: castorage - - mountPath: "/toolset" - name: toolset - command: ["/bin/sh"] - args: ["/toolset/ca_config.sh"] - containers: - - name: ca - image: "" - imagePullPolicy: Always - env: - - { name: "FABRIC_CA_HOME", value: "/etc/hyperledger/fabric-ca-server-config" } - - { name: "FABRIC_CA_SERVER_CA_NAME", value: "name" } - - { name: "FABRIC_CA_SERVER_TLS_ENABLED", value: "true" } - - { name: "FABRIC_LOGGING_SPEC", value: "ERROR" } - volumeMounts: - - mountPath: "/etc/hyperledger/fabric-ca-server-config" - name: castorage - - mountPath: "/certs" - name: cacerts diff --git a/src/agent/fabric-operator/build/bin/templates/orderer/orderer_secret.yaml b/src/agent/fabric-operator/build/bin/templates/orderer/orderer_secret.yaml deleted file mode 100644 index 32bf1b2f4..000000000 --- a/src/agent/fabric-operator/build/bin/templates/orderer/orderer_secret.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: "" -type: Opaque \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/templates/orderer/orderer_service.yaml b/src/agent/fabric-operator/build/bin/templates/orderer/orderer_service.yaml deleted file mode 100755 index 532da5465..000000000 --- a/src/agent/fabric-operator/build/bin/templates/orderer/orderer_service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: "" - name: "" -spec: - selector: - k8s-app: "" - type: NodePort - ports: - - name: ordererport - port: 7054 diff --git a/src/agent/fabric-operator/build/bin/templates/orderer/orderer_statefulset.yaml b/src/agent/fabric-operator/build/bin/templates/orderer/orderer_statefulset.yaml deleted file mode 100755 index 3d1f10597..000000000 --- a/src/agent/fabric-operator/build/bin/templates/orderer/orderer_statefulset.yaml +++ /dev/null @@ -1,80 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "" -spec: - serviceName: "" - selector: - matchLabels: - k8s-app: "" - type: orderer - volumeClaimTemplates: - - metadata: - name: ordererstorage - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: "default" - resources: - requests: - storage: "1Gi" - template: - metadata: - labels: - k8s-app: "" - type: "orderer" - component: "orderer" - spec: - volumes: - - name: orderercerts - secret: - secretName: - - name: toolset - configMap: - name: fabric-toolset - initContainers: - - name: init - image: "hfrd/envsubst:latest" - env: - - name: "REAL_ORG" - valueFrom: - secretKeyRef: - name: orderercerts - key: mspid - volumeMounts: - - mountPath: "/var/orderer" - name: ordererstorage - - mountPath: "/toolset" - name: toolset - - mountPath: "/certs" - name: orderercerts - command: ["/bin/bash"] - args: ["/toolset/orderer_config.sh"] - containers: - - name: orderer - image: "" - imagePullPolicy: Always - env: - - { name: "ORDERER_GENERAL_LOCALMSPID", valueFrom: { secretKeyRef: { name: "", key: "mspid" }}} - - { name: "ORDERER_GENERAL_LOCALMSPDIR", value: "/etc/hyperledger/fabric/msp" } - - { name: "ORDERER_CFG_PATH", value: "/etc/hyperledger/" } - - { name: "ORDERER_GENERAL_LEDGERTYPE", value: "file" } - - { name: "ORDERER_GENERAL_GENESISMETHOD", value: "provisional" } - - { name: "ORDERER_GENERAL_GENESISPROFILE", value: "EtcdRaft" } - - { name: "ORDERER_GENERAL_FILELEDGER_LOCATION", value: "/var/hyperledger/production/orderer" } - - { name: "ORDERER_GENERAL_SYSTEMCHANNEL", value: "systemchannel" } - - { name: "ORDERER_GENERAL_TLS_ENABLED", value: "true" } - - { name: "FABRIC_LOGGING_SPEC", value: "ERROR" } - volumeMounts: - - mountPath: "/var/hyperledger/production" - name: ordererstorage - subPath: production - - mountPath: "/etc/hyperledger/fabric/msp" - name: ordererstorage - subPath: msp - - mountPath: "/etc/hyperledger/fabric/tls" - name: ordererstorage - subPath: tls - - mountPath: "/etc/hyperledger/fabric/configtx.yaml" - name: ordererstorage - subPath: configtx.yaml - command: ["orderer"] diff --git a/src/agent/fabric-operator/build/bin/templates/peer/peer_secret.yaml b/src/agent/fabric-operator/build/bin/templates/peer/peer_secret.yaml deleted file mode 100644 index 75f69f6b9..000000000 --- a/src/agent/fabric-operator/build/bin/templates/peer/peer_secret.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: "" -type: Opaque diff --git a/src/agent/fabric-operator/build/bin/templates/peer/peer_service.yaml b/src/agent/fabric-operator/build/bin/templates/peer/peer_service.yaml deleted file mode 100755 index be7d0617f..000000000 --- a/src/agent/fabric-operator/build/bin/templates/peer/peer_service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: "" - name: "" -spec: - selector: - k8s-app: "" - type: NodePort - ports: - - name: peerport - port: 7054 diff --git a/src/agent/fabric-operator/build/bin/templates/peer/peer_statefulset.yaml b/src/agent/fabric-operator/build/bin/templates/peer/peer_statefulset.yaml deleted file mode 100755 index 96e67bcd1..000000000 --- a/src/agent/fabric-operator/build/bin/templates/peer/peer_statefulset.yaml +++ /dev/null @@ -1,82 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "" -spec: - serviceName: "" - selector: - matchLabels: - k8s-app: "" - type: peer - replicas: 1 - volumeClaimTemplates: - - metadata: - name: peerstorage - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: "default" - resources: - requests: - storage: "1Gi" - template: - metadata: - labels: - k8s-app: "" - type: "peer" - component: "peer" - spec: - volumes: - - name: peercerts - secret: - secretName: peercerts - - name: toolset - configMap: - name: fabric-toolset - - name: rundind - emptyDir: - medium: Memory - initContainers: - - name: init - image: "hfrd/envsubst:latest" - volumeMounts: - - mountPath: "/var/peer" - name: peerstorage - - mountPath: "/toolset" - name: toolset - - mountPath: "/certs" - name: peercerts - command: ["/bin/bash"] - args: ["/toolset/peer_config.sh"] - containers: - - name: peer - image: "" - imagePullPolicy: Always - env: - - { name: "CORE_PEER_LOCALMSPID", valueFrom: { secretKeyRef: { name: "", key: "mspid" }}} - - { name: "CORE_PEER_MSPCONFIGPATH", value: "/etc/hyperledger/fabric/msp" } - - { name: "CORE_VM_ENDPOINT", value: "unix:///var/run/docker.sock" } - - { name: "FABRIC_LOGGING_SPEC", value: "ERROR" } - volumeMounts: - - mountPath: "/var/hyperledger/production" - name: peerstorage - subPath: production - - mountPath: "/etc/hyperledger/fabric/msp" - name: peerstorage - subPath: msp - - mountPath: "/etc/hyperledger/fabric/tls" - name: peerstorage - subPath: tls - - mountPath: "/var/run" - name: rundind - command: ["peer"] - args: ["node", "start"] - - name: dind - image: docker:dind - securityContext: - privileged: true - args: - - dockerd - - -H unix:///var/run/docker.sock - volumeMounts: - - name: rundind - mountPath: /var/run \ No newline at end of file diff --git a/src/agent/fabric-operator/build/bin/user_setup b/src/agent/fabric-operator/build/bin/user_setup deleted file mode 100755 index 1e36064cb..000000000 --- a/src/agent/fabric-operator/build/bin/user_setup +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -x - -# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be) -mkdir -p ${HOME} -chown ${USER_UID}:0 ${HOME} -chmod ug+rwx ${HOME} - -# runtime user will need to be able to self-insert in /etc/passwd -chmod g+rw /etc/passwd - -# no need for this script to remain in the image after running -rm $0 diff --git a/src/agent/fabric-operator/cmd/manager/main.go b/src/agent/fabric-operator/cmd/manager/main.go deleted file mode 100644 index bf0a90c65..000000000 --- a/src/agent/fabric-operator/cmd/manager/main.go +++ /dev/null @@ -1,162 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "os" - "runtime" - - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - _ "k8s.io/client-go/plugin/pkg/client/auth" - "k8s.io/client-go/rest" - - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis" - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/controller" - - "github.com/operator-framework/operator-sdk/pkg/k8sutil" - kubemetrics "github.com/operator-framework/operator-sdk/pkg/kube-metrics" - "github.com/operator-framework/operator-sdk/pkg/leader" - "github.com/operator-framework/operator-sdk/pkg/log/zap" - "github.com/operator-framework/operator-sdk/pkg/metrics" - "github.com/operator-framework/operator-sdk/pkg/restmapper" - sdkVersion "github.com/operator-framework/operator-sdk/version" - "github.com/spf13/pflag" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/intstr" - "sigs.k8s.io/controller-runtime/pkg/client/config" - "sigs.k8s.io/controller-runtime/pkg/manager" - logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" - "sigs.k8s.io/controller-runtime/pkg/runtime/signals" -) - -// Change below variables to serve metrics on different host or port. -var ( - metricsHost = "0.0.0.0" - metricsPort int32 = 8383 - operatorMetricsPort int32 = 8686 -) -var log = logf.Log.WithName("cmd") - -func printVersion() { - log.Info(fmt.Sprintf("Go Version: %s", runtime.Version())) - log.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH)) - log.Info(fmt.Sprintf("Version of operator-sdk: %v", sdkVersion.Version)) -} - -func main() { - // Add the zap logger flag set to the CLI. The flag set must - // be added before calling pflag.Parse(). - pflag.CommandLine.AddFlagSet(zap.FlagSet()) - - // Add flags registered by imported packages (e.g. glog and - // controller-runtime) - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - - pflag.Parse() - - // Use a zap logr.Logger implementation. If none of the zap - // flags are configured (or if the zap flag set is not being - // used), this defaults to a production zap logger. - // - // The logger instantiated here can be changed to any logger - // implementing the logr.Logger interface. This logger will - // be propagated through the whole operator, generating - // uniform and structured logs. - logf.SetLogger(zap.Logger()) - - printVersion() - - namespace, err := k8sutil.GetWatchNamespace() - if err != nil { - log.Error(err, "Failed to get watch namespace") - os.Exit(1) - } - - // Get a config to talk to the apiserver - cfg, err := config.GetConfig() - if err != nil { - log.Error(err, "") - os.Exit(1) - } - - ctx := context.TODO() - // Become the leader before proceeding - err = leader.Become(ctx, "fabric-operator-lock") - if err != nil { - log.Error(err, "") - os.Exit(1) - } - - // Create a new Cmd to provide shared dependencies and start components - mgr, err := manager.New(cfg, manager.Options{ - Namespace: namespace, - MapperProvider: restmapper.NewDynamicRESTMapper, - MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort), - }) - if err != nil { - log.Error(err, "") - os.Exit(1) - } - - log.Info("Registering Components.") - - // Setup Scheme for all resources - if err := apis.AddToScheme(mgr.GetScheme()); err != nil { - log.Error(err, "") - os.Exit(1) - } - - // Setup all Controllers - if err := controller.AddToManager(mgr); err != nil { - log.Error(err, "") - os.Exit(1) - } - - if err = serveCRMetrics(cfg); err != nil { - log.Info("Could not generate and serve custom resource metrics", "error", err.Error()) - } - - // Add to the below struct any other metrics ports you want to expose. - servicePorts := []v1.ServicePort{ - {Port: metricsPort, Name: metrics.OperatorPortName, Protocol: v1.ProtocolTCP, TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: metricsPort}}, - {Port: operatorMetricsPort, Name: metrics.CRPortName, Protocol: v1.ProtocolTCP, TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: operatorMetricsPort}}, - } - // Create Service object to expose the metrics port(s). - _, err = metrics.CreateMetricsService(ctx, cfg, servicePorts) - if err != nil { - log.Info(err.Error()) - } - - log.Info("Starting the Cmd.") - - // Start the Cmd - if err := mgr.Start(signals.SetupSignalHandler()); err != nil { - log.Error(err, "Manager exited non-zero") - os.Exit(1) - } -} - -// serveCRMetrics gets the Operator/CustomResource GVKs and generates metrics based on those types. -// It serves those metrics on "http://metricsHost:operatorMetricsPort". -func serveCRMetrics(cfg *rest.Config) error { - // Below function returns filtered operator/CustomResource specific GVKs. - // For more control override the below GVK list with your own custom logic. - filteredGVK, err := k8sutil.GetGVKsFromAddToScheme(apis.AddToScheme) - if err != nil { - return err - } - // Get the namespace the operator is currently deployed in. - operatorNs, err := k8sutil.GetOperatorNamespace() - if err != nil { - return err - } - // To generate metrics in other namespaces, add the values below. - ns := []string{operatorNs} - // Generate and serve custom resource specific metrics. - err = kubemetrics.GenerateAndServeCRMetrics(cfg, ns, filteredGVK, metricsHost, operatorMetricsPort) - if err != nil { - return err - } - return nil -} diff --git a/src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_crd.yaml b/src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_crd.yaml deleted file mode 100644 index 4c2eb4d36..000000000 --- a/src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_crd.yaml +++ /dev/null @@ -1,357 +0,0 @@ -apiVersion: v1 -kind: List -items: -- apiVersion: apiextensions.k8s.io/v1beta1 - kind: CustomResourceDefinition - metadata: - name: cas.fabric.hyperledger.org - spec: - group: fabric.hyperledger.org - names: - kind: CA - listKind: CAList - plural: cas - singular: ca - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - admin: - 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' - type: string - adminPassword: - type: string - certs: - properties: - cert: - type: string - key: - type: string - tlsCert: - type: string - tlsKey: - type: string - type: object - nodeSpec: - properties: - configParams: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - hosts: - items: - type: string - type: array - image: - type: string - resources: - type: object - storageClass: - type: string - storageSize: - type: string - required: - - image - - configParams - type: object - required: - - admin - - adminPassword - type: object - status: - properties: - accessPoint: - 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: string - required: - - accessPoint - type: object - versions: - - name: v1alpha1 - served: true - storage: true -- apiVersion: apiextensions.k8s.io/v1beta1 - kind: CustomResourceDefinition - metadata: - name: peers.fabric.hyperledger.org - spec: - group: fabric.hyperledger.org - names: - kind: Peer - listKind: PeerList - plural: peers - singular: peer - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - msp: - 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: - adminCerts: - description: Administrator's certificates - items: - type: string - type: array - caCerts: - description: CA certificates - items: - type: string - type: array - keyStore: - description: node private key - type: string - signCerts: - description: node certificate - type: string - tlsCacerts: - description: ca tls certificates - items: - type: string - type: array - required: - - adminCerts - - caCerts - - keyStore - - signCerts - type: object - nodeSpec: - properties: - configParams: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - hosts: - items: - type: string - type: array - image: - type: string - resources: - type: object - storageClass: - type: string - storageSize: - type: string - required: - - image - - configParams - type: object - tls: - properties: - tlsCert: - description: node certificate - type: string - tlsKey: - description: node private key - type: string - required: - - tlsCert - - tlsKey - type: object - required: - - msp - - tls - type: object - status: - properties: - accessPoint: - 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: string - required: - - accessPoint - type: object - required: - - spec - versions: - - name: v1alpha1 - served: true - storage: true -- apiVersion: apiextensions.k8s.io/v1beta1 - kind: CustomResourceDefinition - metadata: - name: orderers.fabric.hyperledger.org - spec: - group: fabric.hyperledger.org - names: - kind: Orderer - listKind: OrdererList - plural: orderers - singular: orderer - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - msp: - 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: - adminCerts: - description: Administrator's certificates - items: - type: string - type: array - caCerts: - description: CA certificates - items: - type: string - type: array - keyStore: - description: node private key - type: string - signCerts: - description: node certificate - type: string - tlsCacerts: - description: ca tls certificates - items: - type: string - type: array - required: - - adminCerts - - caCerts - - keyStore - - signCerts - type: object - nodeSpec: - properties: - configParams: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - hosts: - items: - type: string - type: array - image: - type: string - resources: - type: object - storageClass: - type: string - storageSize: - type: string - required: - - image - - configParams - type: object - tls: - properties: - tlsCert: - description: node certificate - type: string - tlsKey: - description: node private key - type: string - required: - - tlsCert - - tlsKey - type: object - required: - - msp - - tls - type: object - status: - properties: - accessPoint: - 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: string - required: - - accessPoint - type: object - required: - - spec - versions: - - name: v1alpha1 - served: true - storage: true - \ No newline at end of file diff --git a/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml b/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml deleted file mode 100755 index e16af2695..000000000 --- a/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_ca_cr.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: fabric.hyperledger.org/v1alpha1 -kind: CA -metadata: - name: ca1st -spec: - # The CA admin id and password to start up a CA server - admin: "sampleadmin" - adminPassword: "samplepassword" - - # If you have an set of certs that you like to use instead of - # generating a set by Fabric CA, you can specify as the following. - # Certificates and private keys have all to be base64 encoded as - # the values of the each item below. - # certs: - # cert: - # key: - # tlsCert: - # tlsKey: - nodeSpec: - # Specify Fabric binaries to be used to setup the fabric CA - image: "hyperledger/fabric-ca:1.4" - # Optionally, FQDN can also be specified - # hosts: ["ca.sample.com", "169.45.20.0"] - - # Specify storage being used by this Certificate Authority. - # storageClass: "default" - # storageSize: "1Gi" - - # To specify resource limits for this CA node, - # use kubernetes resource requirements spec - # resources: - # requests: - # memory: "32Mi" - # cpu: "200m" - # limits: - # memory: "1024mi" - # cpu: "250" - - # To specify more environment variables for Fabric CA, use any Fabric CA - # configurable parameters - configParams: - - name: FABRIC_CA_SERVER_PORT - value: "7054" - - name: FABRIC_CA_SERVER_DEBUG - value: "false" diff --git a/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml b/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml deleted file mode 100755 index b107777f5..000000000 --- a/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_orderer_cr.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: fabric.hyperledger.org/v1alpha1 -kind: Orderer -metadata: - name: orderer1st -spec: - # To set up an orderer node, a set of certs must be provided. - # You may choose a set from your company's CA issued certs or - # use Fabric CA to generate a set of certs. All fields of msp - # and tls are required. - # Certificates and private keys have to be base64 encoded - # The values in this file are examples. - msp: - adminCerts: ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNCakNDQWEyZ0F3SUJBZ0lRSlFMZXZHczUyajZWaXdvNml2UFNlVEFLQmdncWhrak9QUVFEQWpCbk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVRNQkVHQTFVRUNoTUtiM0prWlhKbGNtOXlaekVXTUJRR0ExVUVBeE1OWTJFdWIzSmtaWEpsCmNtOXlaekFlRncweE9UQTVNalV4TWpNMU1EQmFGdzB5T1RBNU1qSXhNak0xTURCYU1GVXhDekFKQmdOVkJBWVQKQWxWVE1STXdFUVlEVlFRSUV3cERZV3hwWm05eWJtbGhNUll3RkFZRFZRUUhFdzFUWVc0Z1JuSmhibU5wYzJOdgpNUmt3RndZRFZRUUREQkJCWkcxcGJrQnZjbVJsY21WeWIzSm5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBECkFRY0RRZ0FFSTJvRWZ5akcwakZ5dFRKRHFFc2FoekE4aXlNSng1Vml2TFl1SjAvWGZPMGpDd1hhM0JEN0l2NEgKYjZQWmN5SUFOcjNhK1VnR2x5Zi8wNmR4UC8zdXk2Tk5NRXN3RGdZRFZSMFBBUUgvQkFRREFnZUFNQXdHQTFVZApFd0VCL3dRQ01BQXdLd1lEVlIwakJDUXdJb0FnVmRkSTVCUWlZRW1QMkR3UnlJR1RpaGptTG9ITHBpUk93T21kCkI5eW9kNHN3Q2dZSUtvWkl6ajBFQXdJRFJ3QXdSQUlnTm52SzNhRUJYdWNneDlyYURIc1pUOTJzMFJpNUg1REkKTWJlTTg2Q2NRMnNDSUVuZzVTbzdaNzdKN2xHT0s2WEJ6WjRyYnArWGxMbXZvWnBEQ2hiQUI2aEQKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="] - caCerts: ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNPVENDQWVDZ0F3SUJBZ0lSQU9MSEplb05VR0Vaa1ZUS0ZXb1JiZ3d3Q2dZSUtvWkl6ajBFQXdJd1p6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhFekFSQmdOVkJBb1RDbTl5WkdWeVpYSnZjbWN4RmpBVUJnTlZCQU1URFdOaExtOXlaR1Z5ClpYSnZjbWN3SGhjTk1Ua3dPVEkxTVRJek5UQXdXaGNOTWprd09USXlNVEl6TlRBd1dqQm5NUXN3Q1FZRFZRUUcKRXdKVlV6RVRNQkVHQTFVRUNCTUtRMkZzYVdadmNtNXBZVEVXTUJRR0ExVUVCeE1OVTJGdUlFWnlZVzVqYVhOagpiekVUTUJFR0ExVUVDaE1LYjNKa1pYSmxjbTl5WnpFV01CUUdBMVVFQXhNTlkyRXViM0prWlhKbGNtOXlaekJaCk1CTUdCeXFHU000OUFnRUdDQ3FHU000OUF3RUhBMElBQkxabURySVhkNjNHQXRLWitSTWcwTmExbk9YOGRZZ3MKRzZXUGhvcjM3ZTlJSjBVeUl3bDhlZDdKRWsveFRrVFVtQXBZNStCMEJJRVRPc1dNWGF6M1VpYWpiVEJyTUE0RwpBMVVkRHdFQi93UUVBd0lCcGpBZEJnTlZIU1VFRmpBVUJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEClZSMFRBUUgvQkFVd0F3RUIvekFwQmdOVkhRNEVJZ1FnVmRkSTVCUWlZRW1QMkR3UnlJR1RpaGptTG9ITHBpUk8Kd09tZEI5eW9kNHN3Q2dZSUtvWkl6ajBFQXdJRFJ3QXdSQUlnUmFlOWhNZVp4cGsxVm5KUzRpQ29tMCtCNjVlMApmclJKV1ZtOW5TTFR1ajBDSUNtUDJZMWh4WWt5T2xSbC9kUnhGUmlDM3FRL3J0clE4N3ZZL0hRTWFaNDMKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="] - keyStore: "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR0hBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJHMHdhd0lCQVFRZ0lJVmpPUk5BanViNmhjQjgKclcxM3AzT3krM3FvaXFvekM2Q1hMaitXVndhaFJBTkNBQVN0MkhFTGhla3N4bWpXQmlML20yMFQyWlR4ejdxTApyaFIyVlhjbVcrYy8zQ3RTQ3dTMjBIUWRvUVlra2d0UGNJd2lWTStsazFvZ00rRjZSa3JiYzkwNAotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCg==" - signCerts: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNGVENDQWJ5Z0F3SUJBZ0lSQU1HVDBHTlR2dG5lNC9nZGtPb1EvajR3Q2dZSUtvWkl6ajBFQXdJd1p6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhFekFSQmdOVkJBb1RDbTl5WkdWeVpYSnZjbWN4RmpBVUJnTlZCQU1URFdOaExtOXlaR1Z5ClpYSnZjbWN3SGhjTk1Ua3dPVEkxTVRJek5UQXdXaGNOTWprd09USXlNVEl6TlRBd1dqQmpNUXN3Q1FZRFZRUUcKRXdKVlV6RVRNQkVHQTFVRUNCTUtRMkZzYVdadmNtNXBZVEVXTUJRR0ExVUVCeE1OVTJGdUlFWnlZVzVqYVhOagpiekVuTUNVR0ExVUVBeE1lYjNKa1pYSmxjakF0YjNKa1pYSmxjbTl5Wnk1dmNtUmxjbVZ5YjNKbk1Ga3dFd1lICktvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVyZGh4QzRYcExNWm8xZ1lpLzV0dEU5bVU4Yys2aTY0VWRsVjMKSmx2blA5d3JVZ3NFdHRCMEhhRUdKSklMVDNDTUlsVFBwWk5hSURQaGVrWksyM1BkT0tOTk1Fc3dEZ1lEVlIwUApBUUgvQkFRREFnZUFNQXdHQTFVZEV3RUIvd1FDTUFBd0t3WURWUjBqQkNRd0lvQWdWZGRJNUJRaVlFbVAyRHdSCnlJR1RpaGptTG9ITHBpUk93T21kQjl5b2Q0c3dDZ1lJS29aSXpqMEVBd0lEUndBd1JBSWdhdEJNNVVOSmJRNncKNFlZdTY2WG9JY1ltT243UzdRNWlkVXNWeGhEWHV2NENJRjFMbXpXeFZnQ0luWHdENmdCTi9GdFpVVi8ra0dJMQpQeVd2ZEtwdExFbG4KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=" - tlsCacerts: ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRRENDQWVhZ0F3SUJBZ0lSQU9NajFLR1ZBSkxDNTlXby9BTG95ejh3Q2dZSUtvWkl6ajBFQXdJd2FqRUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhFekFSQmdOVkJBb1RDbTl5WkdWeVpYSnZjbWN4R1RBWEJnTlZCQU1URUhSc2MyTmhMbTl5ClpHVnlaWEp2Y21jd0hoY05NVGt3T1RJMU1USXpOVEF3V2hjTk1qa3dPVEl5TVRJek5UQXdXakJxTVFzd0NRWUQKVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTlUyRnVJRVp5WVc1agphWE5qYnpFVE1CRUdBMVVFQ2hNS2IzSmtaWEpsY205eVp6RVpNQmNHQTFVRUF4TVFkR3h6WTJFdWIzSmtaWEpsCmNtOXlaekJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUFCTmtvTmdtTEw1MDl2UlBuaW9mQ3VGdk4KL3FvN244QlRLNUUwclkwR0Fna0dtUkxPZXVOSzhTWGxZZ2k3RTdoaHhUenhNTFJmTWpYRis2ZnJPejJ5VzR1agpiVEJyTUE0R0ExVWREd0VCL3dRRUF3SUJwakFkQmdOVkhTVUVGakFVQmdnckJnRUZCUWNEQWdZSUt3WUJCUVVICkF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WSFE0RUlnUWdGWjBjR2ZGdnJKbWpTWWV1L2VYVkVkQ3gKWEhJc3VNOXJPdnlSOXNHcDFzQXdDZ1lJS29aSXpqMEVBd0lEU0FBd1JRSWhBTVZCTDhIbTBvNnhrWFdDS2h1cQpMOWxydEdCWk85cDQ3ekhlS3lOd21XaE1BaUFkZzdFcmkwRU1hZHgvMlR6WnB0dWlmRVM2WURmZEpleHhSMnRxCk1UbHVHQT09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"] - tls: - tlsCert: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN0VENDQWx1Z0F3SUJBZ0lRTlBBOGZIK0dHd0xRYUtQZ1VjQmxuVEFLQmdncWhrak9QUVFEQWpCcU1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVRNQkVHQTFVRUNoTUtiM0prWlhKbGNtOXlaekVaTUJjR0ExVUVBeE1RZEd4elkyRXViM0prClpYSmxjbTl5WnpBZUZ3MHhPVEE1TWpVeE1qTTFNREJhRncweU9UQTVNakl4TWpNMU1EQmFNR014Q3pBSkJnTlYKQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVFlXNGdSbkpoYm1OcApjMk52TVNjd0pRWURWUVFERXg1dmNtUmxjbVZ5TUMxdmNtUmxjbVZ5YjNKbkxtOXlaR1Z5WlhKdmNtY3dXVEFUCkJnY3Foa2pPUFFJQkJnZ3Foa2pPUFFNQkJ3TkNBQVNzNUVVRU54YnpZdklTQkhiTDRyKytZSy96ZEhlUVNHbUQKamFVbjJWM21kL3Fza3BXWjRNblEwMlhxaTl1YXlXRWMxZFdLdy9XRklOa2Zad3BXY2ZrSG80SHBNSUhtTUE0RwpBMVVkRHdFQi93UUVBd0lGb0RBZEJnTlZIU1VFRmpBVUJnZ3JCZ0VGQlFjREFRWUlLd1lCQlFVSEF3SXdEQVlEClZSMFRBUUgvQkFJd0FEQXJCZ05WSFNNRUpEQWlnQ0FWblJ3WjhXK3NtYU5KaDY3OTVkVVIwTEZjY2l5NHoyczYKL0pIMndhbld3REI2QmdOVkhSRUVjekJ4Z2g1dmNtUmxjbVZ5TUMxdmNtUmxjbVZ5YjNKbkxtOXlaR1Z5WlhKdgpjbWVDRTI5eVpHVnlaWEl3TFc5eVpHVnlaWEp2Y21lSEJLazh4M1dIQktrOHgzMkhCS2s4eDNTSEJLazh4M2lICkJLazh4M3VIQkFxeGE4aUhCQXF4YSsySEJBcXhhKytIQkFxeGEveUhCQXF4YS80d0NnWUlLb1pJemowRUF3SUQKU0FBd1JRSWhBSTVPRW5ubVdqT29XMHFQWXhJN09VV3pkM0hwWWlWVWZHaStlajBzems2UUFpQW9kOHY0VXhoUwpHRGRKbFRjSE93WGF1YmE5WStxYXFsU1FzTmQ3am9mcyt3PT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=" - tlsKey: "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR0hBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJHMHdhd0lCQVFRZy9IUTVzSVVBMlYwekRuZ1oKaDE4enFSbmRFc0tkb1ZGNVNvQi9ocmZLUHZPaFJBTkNBQVNzNUVVRU54YnpZdklTQkhiTDRyKytZSy96ZEhlUQpTR21EamFVbjJWM21kL3Fza3BXWjRNblEwMlhxaTl1YXlXRWMxZFdLdy9XRklOa2Zad3BXY2ZrSAotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCg==" - nodeSpec: - # To specify resource limits for this orderer node, - # use kubernetes resource requirements spec - # resources: - # requests: - # memory: "32Mi" - # cpu: "200m" - # limits: - # memory: "1024mi" - # cpu: "250" - storageSize: "1Gi" - storageClass: "default" - image: "hyperledger/fabric-orderer:2.1" - # Add any configurable orderer parameters as name-value pairs - configParams: - - name: ORDERER_GENERAL_TLS_ENABLED - value: "true" diff --git a/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml b/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml deleted file mode 100755 index 805959249..000000000 --- a/src/agent/fabric-operator/deploy/crs/fabric_v1alpha1_peer_cr.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: fabric.hyperledger.org/v1alpha1 -kind: Peer -metadata: - name: peer1st -spec: - # To set up a peer node, a set of certs must be provided. - # You may choose a set from your company's CA issued certs or - # use Fabric CA to generate a set of certs. All fields of msp - # and tls are required. - # Certificates and private keys have to be base64 encoded - # The values in this file are examples. - msp: - adminCerts: ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNCVENDQWF5Z0F3SUJBZ0lRU2E4RmZ0RkpHOXFtd0diNmMrVWtyREFLQmdncWhrak9QUVFEQWpCYk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RU5NQXNHQTFVRUNoTUViM0puTURFUU1BNEdBMVVFQXhNSFkyRXViM0puTURBZUZ3MHhPVEV3Ck1ESXhOak0xTURCYUZ3MHlPVEE1TWpreE5qTTFNREJhTUdBeEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUkKRXdwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSEV3MVRZVzRnUm5KaGJtTnBjMk52TVE4d0RRWURWUVFMRXdaagpiR2xsYm5ReEV6QVJCZ05WQkFNTUNrRmtiV2x1UUc5eVp6QXdXVEFUQmdjcWhrak9QUUlCQmdncWhrak9QUU1CCkJ3TkNBQVJBNUNvUlhvRmFHZEEwM3JXL2xWVm95eFRHMzltM0lSYnl6Z0xGOGpYWGlSYTFWZHloQXNqMmRScy8KTjh2YWZyVmJHRmdVVFd5SnB2Y3VPS2FxVGV5L28wMHdTekFPQmdOVkhROEJBZjhFQkFNQ0I0QXdEQVlEVlIwVApBUUgvQkFJd0FEQXJCZ05WSFNNRUpEQWlnQ0RGVXR1QUpYYVlQSTRsQlNJeWhmOS9TUmdYeklpTGdha2wzdGlyCk1zT0szVEFLQmdncWhrak9QUVFEQWdOSEFEQkVBaUFrQXBtTXUzR1JIL1dVdXoxZEFZQ3E4MU0vaTlSQk16S1EKUXhrNVRvWm55Z0lnSDhRNkorTG5IUWE0ckJPelQ4SkMvODQxT3AzSy9UcXB3UHQ2ZEs1YU1nMD0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="] - caCerts: ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNJRENDQWNlZ0F3SUJBZ0lRRGJUWUpiUmJrYnErQ3NQTFQ2b0VzekFLQmdncWhrak9QUVFEQWpCYk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RU5NQXNHQTFVRUNoTUViM0puTURFUU1BNEdBMVVFQXhNSFkyRXViM0puTURBZUZ3MHhPVEV3Ck1ESXhOak0xTURCYUZ3MHlPVEE1TWpreE5qTTFNREJhTUZzeEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUkKRXdwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSEV3MVRZVzRnUm5KaGJtTnBjMk52TVEwd0N3WURWUVFLRXdSdgpjbWN3TVJBd0RnWURWUVFERXdkallTNXZjbWN3TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFClFRR2FsN3VmMkt3c3Bxa1NHd0NkVVd1emc3MnV6NXNRZS9LNE9lNUlaSVVDM2hwQWduRlpwQnlvTHNFTE1GNTgKNnY4NG1aK1dCVnFNa2Nra0xIcHdIcU50TUdzd0RnWURWUjBQQVFIL0JBUURBZ0dtTUIwR0ExVWRKUVFXTUJRRwpDQ3NHQVFVRkJ3TUNCZ2dyQmdFRkJRY0RBVEFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQ2tHQTFVZERnUWlCQ0RGClV0dUFKWGFZUEk0bEJTSXloZjkvU1JnWHpJaUxnYWtsM3Rpck1zT0szVEFLQmdncWhrak9QUVFEQWdOSEFEQkUKQWlFQXBNMUQ0eVhEdXFBZ1ZzeW5KU1p3Q2hQa0JJZGJKNjNybiswQnloOHV4QlVDSHpIVUh0dkJMZ2RTOHdZTAp5UnRmakZtd25JaEVUODd5U2ZOS3JuejVURVE9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"] - keyStore: "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR0hBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJHMHdhd0lCQVFRZ1dtM3l3OUx6Z3FDREllekwKRU1MeUVxcldyQU1TWHhESmZMM2t2d3ZiWHBlaFJBTkNBQVF1Y3FVS2dldnc2ek9OVERrajdVMWplOXkyQzd2awpjdkRnWDh1Ujh1WkQ2NmxxcjI3UmRDbU5IcEJrU3JpWVlsU0o2QWQ4Q2VCTUJZSDlsbm9QdVNCMgotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCg==" - signCerts: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNDVENDQWJDZ0F3SUJBZ0lSQUo5MFY0VFBGYVJmOExIUXVFbnR4Rll3Q2dZSUtvWkl6ajBFQXdJd1d6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhEVEFMQmdOVkJBb1RCRzl5WnpBeEVEQU9CZ05WQkFNVEIyTmhMbTl5WnpBd0hoY05NVGt4Ck1EQXlNVFl6TlRBd1doY05Namt3T1RJNU1UWXpOVEF3V2pCak1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUUKQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeVlXNWphWE5qYnpFTk1Bc0dBMVVFQ3hNRQpjR1ZsY2pFWU1CWUdBMVVFQXhNUGNHVmxjakV0YjNKbk1DNXZjbWN3TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJCnpqMERBUWNEUWdBRUxuS2xDb0hyOE9zempVdzVJKzFOWTN2Y3RndTc1SEx3NEYvTGtmTG1RK3VwYXE5dTBYUXAKalI2UVpFcTRtR0pVaWVnSGZBbmdUQVdCL1paNkQ3a2dkcU5OTUVzd0RnWURWUjBQQVFIL0JBUURBZ2VBTUF3RwpBMVVkRXdFQi93UUNNQUF3S3dZRFZSMGpCQ1F3SW9BZ3hWTGJnQ1YybUR5T0pRVWlNb1gvZjBrWUY4eUlpNEdwCkpkN1lxekxEaXQwd0NnWUlLb1pJemowRUF3SURSd0F3UkFJZ1piZ1JqZE52dHJXRnlpUStqVU5KVTRKQURMYXEKTVRXbEdXbUkxeVBheUZjQ0lGN2xscHJsa1pZMXB4RW16QWptMm1ueWxrNGl2cys0ZnNKRys4d2htOU4zCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" - tlsCacerts: ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNLRENDQWM2Z0F3SUJBZ0lSQU1acmVFeVJaaUhhQTJYYUtVbTUrcXN3Q2dZSUtvWkl6ajBFQXdJd1hqRUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhEVEFMQmdOVkJBb1RCRzl5WnpBeEV6QVJCZ05WQkFNVENuUnNjMk5oTG05eVp6QXdIaGNOCk1Ua3hNREF5TVRZek5UQXdXaGNOTWprd09USTVNVFl6TlRBd1dqQmVNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUcKQTFVRUNCTUtRMkZzYVdadmNtNXBZVEVXTUJRR0ExVUVCeE1OVTJGdUlFWnlZVzVqYVhOamJ6RU5NQXNHQTFVRQpDaE1FYjNKbk1ERVRNQkVHQTFVRUF4TUtkR3h6WTJFdWIzSm5NREJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5CkF3RUhBMElBQkhuWjV4Vng2b1YwaGVYQ0FqRnVnSFVLcDVZdFlmb0ZvOGk4Y2JhcEZKYmJYcnNsdkxTamdMRTYKTld4a21GNXkzRzNHMzJQcWEvTk4wVTZGdUVjNm1oNmpiVEJyTUE0R0ExVWREd0VCL3dRRUF3SUJwakFkQmdOVgpIU1VFRmpBVUJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WCkhRNEVJZ1FnTWZBc3BjTjFaTTlLRlFpOTcwWVQwRHJmZ2RLVm1IQUhVUlpuSVRNMHg0VXdDZ1lJS29aSXpqMEUKQXdJRFNBQXdSUUloQUpobTZnVC9WNXJ1c3k5Y0pMSGt3aGpxaUhBN04yRGtVUUNhQ01nUFE5UjZBaUFROE1zdQpFRWF1SXk3ZlhvUVZTQjV2c1VFZXlCd3N5KytndWp0NVR6WlprZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"] - tls: - tlsCert: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNnakNDQWlpZ0F3SUJBZ0lRQUlEN1FncCtGMzBHR2I1THhzVmdqekFLQmdncWhrak9QUVFEQWpCZU1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RU5NQXNHQTFVRUNoTUViM0puTURFVE1CRUdBMVVFQXhNS2RHeHpZMkV1YjNKbk1EQWVGdzB4Ck9URXdNREl4TmpNMU1EQmFGdzB5T1RBNU1qa3hOak0xTURCYU1GUXhDekFKQmdOVkJBWVRBbFZUTVJNd0VRWUQKVlFRSUV3cERZV3hwWm05eWJtbGhNUll3RkFZRFZRUUhFdzFUWVc0Z1JuSmhibU5wYzJOdk1SZ3dGZ1lEVlFRRApFdzl3WldWeU1TMXZjbWN3TG05eVp6QXdXVEFUQmdjcWhrak9QUUlCQmdncWhrak9QUU1CQndOQ0FBUnROVDRkClFMTnRuS013WjJnRjF3RHIrRmpodXkyOW9lekJuVjREOXNiSHJpRWhFdWluYWxERlpYaVA2UmN4Q1kyTHFocDcKLzZTVGdFdXZsSkZvVU1JMG80SFJNSUhPTUE0R0ExVWREd0VCL3dRRUF3SUZvREFkQmdOVkhTVUVGakFVQmdncgpCZ0VGQlFjREFRWUlLd1lCQlFVSEF3SXdEQVlEVlIwVEFRSC9CQUl3QURBckJnTlZIU01FSkRBaWdDQXg4Q3lsCnczVmt6MG9WQ0wzdlJoUFFPdCtCMHBXWWNBZFJGbWNoTXpUSGhUQmlCZ05WSFJFRVd6QlpnZzl3WldWeU1TMXYKY21jd0xtOXlaekNDQ25CbFpYSXhMVzl5WnpDSEJLazh4M1dIQktrOHgzMkhCS2s4eDNTSEJLazh4M2lIQktrOAp4M3VIQkFxeGE4aUhCQXF4YSsySEJBcXhhKytIQkFxeGEveUhCQXF4YS80d0NnWUlLb1pJemowRUF3SURTQUF3ClJRSWhBSUxkLzhQQ0NnVGFFbWw2RW5tZUM3OTlVR3dpb0tHcUlqVmZxdlhGekF6N0FpQk50OEoxVjJKZUY3MjQKekhCR3hEc2pIc3BNekt0M3VjRnIxRStRUHcvNjJ3PT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=" - tlsKey: "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR0hBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJHMHdhd0lCQVFRZ2FqNlNud0pUZjRkclYyMzcKZFBEc2tDcDI4QnlXcXE4R0IrSXNBODZQWUFDaFJBTkNBQVJ0TlQ0ZFFMTnRuS013WjJnRjF3RHIrRmpodXkyOQpvZXpCblY0RDlzYkhyaUVoRXVpbmFsREZaWGlQNlJjeENZMkxxaHA3LzZTVGdFdXZsSkZvVU1JMAotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCg==" - nodeSpec: - # To specify resource limits for this Peer node, - # use kubernetes resource requirements spec - # resources: - # requests: - # memory: "32Mi" - # cpu: "200m" - # limits: - # memory: "1024mi" - # cpu: "250" - storageSize: "1Gi" - storageClass: "default" - image: "hyperledger/fabric-peer:2.1" - # Add all the configurable peer parameters as - # name-value pairs - configParams: - - name: CORE_PEER_ADDRESSAUTODETECT - value: "true" - - name: CORE_PEER_TLS_ENABLED - value: "true" diff --git a/src/agent/fabric-operator/deploy/fabric-operator.yaml b/src/agent/fabric-operator/deploy/fabric-operator.yaml deleted file mode 100755 index 922d70990..000000000 --- a/src/agent/fabric-operator/deploy/fabric-operator.yaml +++ /dev/null @@ -1,145 +0,0 @@ -apiVersion: v1 -kind: List -items: -- apiVersion: v1 - kind: ServiceAccount - metadata: - name: fabric-operator - -- apiVersion: rbac.authorization.k8s.io/v1 - kind: Role - metadata: - creationTimestamp: null - name: fabric-operator - rules: - - apiGroups: - - "" - resources: - - pods - - services - - endpoints - - persistentvolumeclaims - - events - - configmaps - - secrets - verbs: - - '*' - - apiGroups: - - apps - resources: - - deployments - - daemonsets - - replicasets - - statefulsets - verbs: - - '*' - - apiGroups: - - monitoring.coreos.com - resources: - - servicemonitors - verbs: - - get - - create - - apiGroups: - - apps - resourceNames: - - fabric-operator - resources: - - deployments/finalizers - verbs: - - update - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - apiGroups: - - apps - resources: - - replicasets - verbs: - - get - - apiGroups: - - fabric.hyperledger.org - resources: - - '*' - - peers - - orderers - verbs: - - '*' - -- apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - creationTimestamp: null - name: cluster-fabric-operator - rules: - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - watch - -- apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - metadata: - name: fabric-operator - roleRef: - kind: Role - name: fabric-operator - apiGroup: rbac.authorization.k8s.io - subjects: - - kind: ServiceAccount - name: fabric-operator - -- apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - name: cluster-fabric-operator - roleRef: - kind: ClusterRole - name: cluster-fabric-operator - apiGroup: rbac.authorization.k8s.io - subjects: - - kind: ServiceAccount - name: fabric-operator - namespace: "default" - -- apiVersion: apps/v1 - kind: Deployment - metadata: - name: fabric-operator - spec: - replicas: 1 - selector: - matchLabels: - name: fabric-operator - template: - metadata: - labels: - name: fabric-operator - spec: - serviceAccountName: fabric-operator - containers: - - name: fabric-operator - image: hyperledger/cello-k8s-operator-controller:latest - command: - - fabric-operator - imagePullPolicy: IfNotPresent - env: - - name: WATCH_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: OPERATOR_NAME - value: "fabric-operator" - - \ No newline at end of file diff --git a/src/agent/fabric-operator/go.mod b/src/agent/fabric-operator/go.mod deleted file mode 100644 index 71a75824c..000000000 --- a/src/agent/fabric-operator/go.mod +++ /dev/null @@ -1,32 +0,0 @@ -module github.com/hyperledger/cello/src/agent/fabric-operator - -require ( - github.com/go-openapi/spec v0.19.0 - github.com/operator-framework/operator-sdk v0.9.1-0.20190806200632-6c7039c37324 - github.com/spf13/pflag v1.0.3 - k8s.io/api v0.0.0-20190612125737-db0771252981 - k8s.io/apimachinery v0.0.0-20190612125636-6a5db36e93ad - k8s.io/client-go v11.0.0+incompatible - k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208 - sigs.k8s.io/controller-runtime v0.1.12 - sigs.k8s.io/controller-tools v0.1.10 -) - -// Pinned to kubernetes-1.13.4 -replace ( - k8s.io/api => k8s.io/api v0.0.0-20190222213804-5cb15d344471 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 - k8s.io/client-go => k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 -) - -replace ( - github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.29.0 - k8s.io/kube-state-metrics => k8s.io/kube-state-metrics v1.6.0 - sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.1.12 - sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde -) - -replace github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.9.0 - -go 1.13 diff --git a/src/agent/fabric-operator/go.sum b/src/agent/fabric-operator/go.sum deleted file mode 100644 index 8429be883..000000000 --- a/src/agent/fabric-operator/go.sum +++ /dev/null @@ -1,544 +0,0 @@ -bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c/go.mod h1:1vhO7Mn/FZMgOgDVGLy5X1mE6rq1HbkBdkF/yj8zkcg= -cloud.google.com/go v0.0.0-20160913182117-3b1ae45394a2/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.2 h1:4y4L7BdHenTfZL0HervofNTHh9Ad6mNX72cQvl+5eH0= -cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA= -contrib.go.opencensus.io/exporter/ocagent v0.4.9/go.mod h1:ueLzZcP7LPhPulEBukGn4aLh7Mx9YJwpVJ9nL2FYltw= -contrib.go.opencensus.io/exporter/ocagent v0.4.11 h1:Zwy9skaqR2igcEfSVYDuAsbpa33N0RPtnYTHEe2whPI= -contrib.go.opencensus.io/exporter/ocagent v0.4.11/go.mod h1:7ihiYRbdcVfW4m4wlXi9WRPdv79C0fStcjNlyE6ek9s= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v11.1.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.5.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.7.0+incompatible h1:gzma19dc9ejB75D90E5S+/wXouzpZyA+CV+/MJPSD/k= -github.com/Azure/go-autorest v11.7.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v0.0.0-20190301161902-9f8fceff796f/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk= -github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chai2010/gettext-go v0.0.0-20170215093142-bf70f2a70fb1/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.9+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/prometheus-operator v0.29.0 h1:Moi4klbr1xUVaofWzlaM12mxwCL294GiLW2Qj8ku0sY= -github.com/coreos/prometheus-operator v0.29.0/go.mod h1:SO+r5yZUacDFPKHfPoUjI3hMsH+ZUdiuNNhuSq3WoSg= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/docker/distribution v2.6.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.0.0-20180612054059-a9fbbdc8dd87/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.8.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.8.1+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.3+incompatible h1:2OwhVdhtzYUp5P5wuGsVDPagKSRd9JK72sJCHVCXh5g= -github.com/emicklei/go-restful v2.9.3+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful-swagger12 v0.0.0-20170926063155-7524189396c6/go.mod h1:qr0VowGBT4CS4Q8vFF8BSeKz34PuqKGxs/L0IAQA9DQ= -github.com/evanphx/json-patch v3.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= -github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8= -github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk= -github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k4= -github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.17.2/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.0 h1:Kg7Wl7LkTPlmc393QZQ/5rQadPhi7pBVEMZxyTi0Ii8= -github.com/go-openapi/swag v0.19.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gogo/protobuf v0.0.0-20170330071051-c0656edd0d9e/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20141105023935-44145f04b68c/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20180924190550-6f2cf27854a4/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.0.0-20180330165814-781450b3c4fc/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/gophercloud v0.0.0-20190318015731-ff9851476e98/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.0.0-20190408160324-6c7ac67f8855 h1:3dfUujjROkkXcwIpsh9z6bjOhPFooLpxejc7qgX13/g= -github.com/gophercloud/gophercloud v0.0.0-20190408160324-6c7ac67f8855/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM= -github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.5.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.6.3/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-health-probe v0.2.0/go.mod h1:4GVx/bTCtZaSzhjbGueDY5YgBdsmKeVx+LErv/n0L6s= -github.com/hashicorp/golang-lru v0.0.0-20160207214719-a0d98a5f2880/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= -github.com/hyperledger/cello v0.9.0 h1:0LrLnps21YaV72ZrtNZlmt44eNAap8UdpXLwKazAmhE= -github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= -github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 h1:wL11wNW7dhKIcRCHSm4sHKPWz0tt4mwBsVodG7+Xyqg= -github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= -github.com/martinlindhe/base36 v0.0.0-20180729042928-5cda0030da17/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8= -github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/maxbrunsfeld/counterfeiter v0.0.0-20181017030959-1aadac120687/go.mod h1:aoVsckWnsNzazwF2kmD+bzgdr4GBlbK91zsdivQJ2eU= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2-0.20180831124310-ae19f1b56d53/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/openshift/origin v0.0.0-20160503220234-8f127d736703/go.mod h1:0Rox5r9C8aQn6j1oAOQ0c1uC86mYbUFObzjBRvUKHII= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/operator-framework/operator-lifecycle-manager v0.0.0-20181023032605-e838f7fb2186/go.mod h1:Ma5ZXd4S1vmMyewWlF7aO8CZiokR7Sd8dhSfkGkNU4U= -github.com/operator-framework/operator-lifecycle-manager v0.0.0-20190105193533-81104ffdc4fb/go.mod h1:XMyE4n2opUK4N6L45YGQkXXi8F9fD7XDYFv/CsS6V5I= -github.com/operator-framework/operator-lifecycle-manager v0.0.0-20190128024246-5eb7ae5bdb7a/go.mod h1:vq6TTFvg6ti1Bn6ACsZneZTmjTsURgDD6tQtVDbEgsU= -github.com/operator-framework/operator-registry v1.0.1/go.mod h1:1xEdZjjUg2hPEd52LG3YQ0jtwiwEGdm98S1TH5P4RAA= -github.com/operator-framework/operator-registry v1.0.4/go.mod h1:hve6YwcjM2nGVlscLtNsp9sIIBkNZo6jlJgzWw7vP9s= -github.com/operator-framework/operator-sdk v0.9.0 h1:moY3n5vsg4OpD3FzHvqI68Fv+gJFQ1GaDKMHm2NRpF8= -github.com/operator-framework/operator-sdk v0.9.0/go.mod h1:7eW7ldXmvenehIMVdO2zCdERf/828Mrftq4u7GS0I68= -github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= -github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.3.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c/go.mod h1:HUpKUBZnpzkdx0kD/+Yfuft+uD3zHGtXF/XJB14TUr4= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20190104105734-b1c43a6df3ae/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190104112138-b1a0a9a36d74/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190403104016-ea9eea638872 h1:0aNv3xC7DmQoy1/x1sMh18g+fihWW68LL13i8ao9kl4= -github.com/prometheus/procfs v0.0.0-20190403104016-ea9eea638872/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/robfig/cron v0.0.0-20170526150127-736158dc09e1/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v0.0.0-20151117072312-300106c228d5/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sclevine/spec v1.0.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/stevvooe/resumable v0.0.0-20180830230917-22b14a53ba50/go.mod h1:1pdIZTAHUz+HDKDVZ++5xg/duPlhKAIzw9qy42CWYp4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/technosophos/moniker v0.0.0-20180509230615-a5dbd03a2245/go.mod h1:O1c8HleITsZqzNZDjSNzirUGsMT0oGu9LhHKoJrqO+A= -github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= -github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= -go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M= -go.opencensus.io v0.20.0 h1:L/ARO58pdktB6dLmYI0zAyW1XnavEmGziFd0MKfxnck= -go.opencensus.io v0.20.0/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M= -go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= -golang.org/x/crypto v0.0.0-20180222182404-49796115aa4b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5 h1:bselrhR0Or1vomJZC8ZIjWtbDmn9OYFLX5Ik9alpJpE= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20170412232759-a6bd8cefa181/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181105165119-ca4130e427c7/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181023152157-44b849a8bc13/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67 h1:1Fzlr8kkDLQwqMP8GxrhptBLqZG/EDpiATneiZHY998= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011152555-a398e557df60/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181207222222-4c874b978acb/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190213015956-f7e1b50d2251/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190408170212-12dd9f86f350/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU= -google.golang.org/api v0.3.0 h1:UIJY20OEo3+tK5MBlcdx37kmdH6EnRjGkW78mc6+EeA= -google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181016170114-94acd270e44e/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.0.0-20190222213804-5cb15d344471 h1:MzQGt8qWQCR+39kbYRd0uQqsvSidpYqJLFeWiJ9l4OE= -k8s.io/api v0.0.0-20190222213804-5cb15d344471/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= -k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 h1:UYfHH+KEF88OTg+GojQUwFTNxbxwmoktLwutUzR0GPg= -k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apiserver v0.0.0-20181026151315-13cfe3978170/go.mod h1:6bqaTSOSJavUIXUtfaR9Os9JtTCm8ZqH2SUl2S60C4w= -k8s.io/apiserver v0.0.0-20181213151703-3ccfe8365421/go.mod h1:6bqaTSOSJavUIXUtfaR9Os9JtTCm8ZqH2SUl2S60C4w= -k8s.io/cli-runtime v0.0.0-20181213153952-835b10687cb6/go.mod h1:qWnH3/b8sp/l7EvlDh7ulDU3UWA4P4N1NFbEEP791tM= -k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 h1:aE8wOCKuoRs2aU0OP/Rz8SXiAB0FTTku3VtGhhrkSmc= -k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/code-generator v0.0.0-20181203235156-f8cba74510f3/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8= -k8s.io/gengo v0.0.0-20181106084056-51747d6e00da/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20181113154421-fd15ee9cc2f7/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/helm v2.13.1+incompatible/go.mod h1:LZzlS4LQBHfciFOurYBFkCMTaZ0D1l+p0teMg7TSULI= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.1.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.1 h1:RVgyDHY/kFKtLqh67NvEWIgkMneNoIrdkN0CxDSQc68= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/kube-aggregator v0.0.0-20181204002017-122bac39d429/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU= -k8s.io/kube-aggregator v0.0.0-20181213152105-1e8cd453c474/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU= -k8s.io/kube-openapi v0.0.0-20181031203759-72693cb1fadd/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20190320154901-5e45bb682580/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208 h1:5sW+fEHvlJI3Ngolx30CmubFulwH28DhKjGf70Xmtco= -k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= -k8s.io/kube-state-metrics v1.6.0 h1:6wkxiTPTZ4j+LoMWuT+rZ+OlUWswktzXs5yHmggmAZ0= -k8s.io/kube-state-metrics v1.6.0/go.mod h1:84+q9aGVQPzXYGgtvyhZr/fSI6BdLsbPWXn37RASc9k= -k8s.io/kubernetes v1.11.7-beta.0.0.20181219023948-b875d52ea96d/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/kubernetes v1.11.8-beta.0.0.20190124204751-3a10094374f2/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= -sigs.k8s.io/controller-runtime v0.1.12 h1:ovDq28E64PeY1yR+6H7DthakIC09soiDCrKvfP2tPYo= -sigs.k8s.io/controller-runtime v0.1.12/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= -sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde/go.mod h1:ATWLRP3WGxuAN9HcT2LaKHReXIH+EZGzRuMHuxjXfhQ= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/testing_frameworks v0.1.0/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= -sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/src/agent/fabric-operator/pkg/apis/addtoscheme_fabric_v1alpha1.go b/src/agent/fabric-operator/pkg/apis/addtoscheme_fabric_v1alpha1.go deleted file mode 100644 index 1235d09cf..000000000 --- a/src/agent/fabric-operator/pkg/apis/addtoscheme_fabric_v1alpha1.go +++ /dev/null @@ -1,10 +0,0 @@ -package apis - -import ( - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1" -) - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme) -} diff --git a/src/agent/fabric-operator/pkg/apis/apis.go b/src/agent/fabric-operator/pkg/apis/apis.go deleted file mode 100644 index 07dc96164..000000000 --- a/src/agent/fabric-operator/pkg/apis/apis.go +++ /dev/null @@ -1,13 +0,0 @@ -package apis - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// AddToSchemes may be used to add all resources defined in the project to a Scheme -var AddToSchemes runtime.SchemeBuilder - -// AddToScheme adds all Resources to the Scheme -func AddToScheme(s *runtime.Scheme) error { - return AddToSchemes.AddToScheme(s) -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/group.go b/src/agent/fabric-operator/pkg/apis/fabric/group.go deleted file mode 100755 index 8d4f094ad..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/group.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package fabric contains fabric API versions. -// -// This file ensures Go source parsers acknowledge the fabric package -// and any child packages. It can be removed if any other Go source files are -// added to this package. -package fabric diff --git a/src/agent/fabric-operator/pkg/apis/fabric/utils.go b/src/agent/fabric-operator/pkg/apis/fabric/utils.go deleted file mode 100755 index feb21c720..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/utils.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2019 IBM Corp. -// -// 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 -// -// https://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. - -package fabric - -import ( - "context" - "io/ioutil" - "os" - "path/filepath" - "sync" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" -) - -var ( - // TemplateRoot is the root directory where all needed templates live - TemplateRootDir = "/usr/local/bin/templates/" - ScriptRoodDir = "/usr/local/bin/scripts" - ToolSetName = "fabric-toolset" -) - -var log = logf.Log.WithName("fabric_util") - -func GetObjectFromTemplate(templateName string) (runtime.Object, *schema.GroupVersionKind, error) { - template, _ := ioutil.ReadFile(TemplateRootDir + templateName) - decode := scheme.Codecs.UniversalDeserializer().Decode - - return decode(template, nil, nil) -} - -func GetDefault(p interface{}, v interface{}) interface{} { - switch p.(type) { - case string: - if p == "" { - return v - } else { - return p - } - case int, int8, int16, int32, int64, uint, uint8, uint16, - uint32, uint64, float32, float64: - if p == 0 { - return v - } else { - return p - } - case nil: - return v - } - return p -} - -// global mutex to ensure that not trying to create configmaps many times -var mutex = &sync.Mutex{} - -// CheckAndCreateConfigMap - Try to check if the configmap exists, if not, create one -func CheckAndCreateConfigMap(client client.Client, request reconcile.Request) error { - configmap := &corev1.ConfigMap{} - err := client.Get(context.TODO(), - types.NamespacedName{Name: ToolSetName, Namespace: request.Namespace}, - configmap) - if err != nil { - mutex.Lock() - defer mutex.Unlock() - err = client.Get(context.TODO(), - types.NamespacedName{Name: ToolSetName, Namespace: request.Namespace}, - configmap) - if err != nil && errors.IsNotFound(err) { - log.Info("Fabric operator configmap resource not found. We need to create it") - configmap.Namespace = request.Namespace - configmap.Name = ToolSetName - configmap.Data = map[string]string{} - filepath.Walk(ScriptRoodDir, func(path string, info os.FileInfo, err error) error { - if !info.IsDir() { - dat, _ := ioutil.ReadFile(path) - configmap.Data[info.Name()] = string(dat) - } - return nil - }) - err = client.Create(context.TODO(), configmap) - if err != nil && !errors.IsAlreadyExists(err) { - log.Error(err, "Failed to create Fabric configMap", "Service.Namespace", - configmap.Namespace, "Service.Name", configmap.Name) - return err - } - return nil - } - } - return nil -} - -func GetNodeIPaddress(c client.Client) ([]string, error) { - - nodeList := &corev1.NodeList{} - err := c.List(context.TODO(), &client.ListOptions{}, nodeList) - addresses := []string{} - if err == nil { - for _, node := range nodeList.Items { - for _, address := range node.Status.Addresses { - if address.Type == corev1.NodeExternalIP { - addresses = append(addresses, address.Address) - } - } - } - } - return addresses, err -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/ca_types.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/ca_types.go deleted file mode 100755 index 7ed25bf1f..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/ca_types.go +++ /dev/null @@ -1,55 +0,0 @@ -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. - -// CACerts defines the desired state of CA -// +k8s:openapi-gen=true -type CACerts struct { - Cert string `json:"cert,omitempty"` - Key string `json:"key,omitempty"` - TLSCert string `json:"tlsCert,omitempty"` - TLSKey string `json:"tlsKey,omitempty"` -} - -// CASpec defines the desired state of CA -// +k8s:openapi-gen=true -type CASpec 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 - Admin string `json:"admin"` - AdminPassword string `json:"adminPassword"` - Certs *CACerts `json:"certs,omitempty"` - NodeSpec `json:"nodeSpec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CA is the Schema for the cas API -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -type CA struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CASpec `json:"spec,omitempty"` - Status NodeStatus `json:"status,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CAList contains a list of CA -type CAList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CA `json:"items"` -} - -func init() { - SchemeBuilder.Register(&CA{}, &CAList{}) -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/doc.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/doc.go deleted file mode 100644 index 9f9dd3a47..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package v1alpha1 contains API Schema definitions for the fabric v1alpha1 API group -// +k8s:deepcopy-gen=package,register -// +groupName=fabric.hyperledger.org -package v1alpha1 diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/helper.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/helper.go deleted file mode 100755 index e04beebe2..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/helper.go +++ /dev/null @@ -1,68 +0,0 @@ -// NOTE: Boilerplate only. Ignore this file. - -// Package v1alpha1 contains API Schema definitions for the fabric v1alpha1 API group -// +k8s:deepcopy-gen=package,register -// +groupName=fabric.hyperledger.org -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" -) - -// The corresponding msp structure for node such as orderer or peer -// +k8s:openapi-gen=true -type MSP struct { - // Administrator's certificates - AdminCerts []string `json:"adminCerts,required"` - // CA certificates - CaCerts []string `json:"caCerts,required"` - // node private key - KeyStore string `json:"keyStore,required"` - // node certificate - SignCerts string `json:"signCerts,required"` - // ca tls certificates - TLSCacerts []string `json:"tlsCacerts,omitempty"` -} - -// +k8s:openapi-gen=true -type TLS struct { - // node certificate - TLSCert string `json:"tlsCert,required"` - // node private key - TLSKey string `json:"tlsKey,required"` -} - -// +k8s:openapi-gen=true -type NodeSpec struct { - Image string `json:"image"` - ConfigParams []ConfigParam `json:"configParams"` - Hosts []string `json:"hosts,omitempty"` - Resources corev1.ResourceRequirements `json:"resources,omitempty"` - StorageClass string `json:"storageClass,omitempty"` - StorageSize string `json:"storageSize,omitempty"` -} - -// NodeStatus defines the observed state of CA -// +k8s:openapi-gen=true -type NodeStatus 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 - AccessPoint string `json:"accessPoint"` -} - -// +k8s:openapi-gen=true -type CommonSpec 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 - MSP `json:"msp"` - TLS `json:"tls"` - NodeSpec `json:"nodeSpec,omitempty"` -} - -// +k8s:openapi-gen=true -type ConfigParam struct { - Name string `json:"name"` - Value string `json:"value"` -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/orderer_types.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/orderer_types.go deleted file mode 100755 index 3d924e984..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/orderer_types.go +++ /dev/null @@ -1,34 +0,0 @@ -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. - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Orderer is the Schema for the orderers API -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -type Orderer struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CommonSpec `json:"spec"` - Status NodeStatus `json:"status,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OrdererList contains a list of Orderer -type OrdererList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Orderer `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Orderer{}, &OrdererList{}) -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/peer_types.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/peer_types.go deleted file mode 100755 index d0ba2e8fa..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/peer_types.go +++ /dev/null @@ -1,34 +0,0 @@ -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. - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Peer is the Schema for the peers API -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -type Peer struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CommonSpec `json:"spec"` - Status NodeStatus `json:"status,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PeerList contains a list of Peer -type PeerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Peer `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Peer{}, &PeerList{}) -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/register.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/register.go deleted file mode 100644 index 6bf9b648d..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/register.go +++ /dev/null @@ -1,19 +0,0 @@ -// NOTE: Boilerplate only. Ignore this file. - -// Package v1alpha1 contains API Schema definitions for the fabric v1alpha1 API group -// +k8s:deepcopy-gen=package,register -// +groupName=fabric.hyperledger.org -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" -) - -var ( - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "fabric.hyperledger.org", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} -) diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.deepcopy.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 8ca9c3dbc..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,355 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by operator-sdk. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CA) DeepCopyInto(out *CA) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CA. -func (in *CA) DeepCopy() *CA { - if in == nil { - return nil - } - out := new(CA) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CA) 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 *CACerts) DeepCopyInto(out *CACerts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CACerts. -func (in *CACerts) DeepCopy() *CACerts { - if in == nil { - return nil - } - out := new(CACerts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAList) DeepCopyInto(out *CAList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CA, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAList. -func (in *CAList) DeepCopy() *CAList { - if in == nil { - return nil - } - out := new(CAList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CAList) 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 *CASpec) DeepCopyInto(out *CASpec) { - *out = *in - if in.Certs != nil { - in, out := &in.Certs, &out.Certs - *out = new(CACerts) - **out = **in - } - in.NodeSpec.DeepCopyInto(&out.NodeSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CASpec. -func (in *CASpec) DeepCopy() *CASpec { - if in == nil { - return nil - } - out := new(CASpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonSpec) DeepCopyInto(out *CommonSpec) { - *out = *in - in.MSP.DeepCopyInto(&out.MSP) - out.TLS = in.TLS - in.NodeSpec.DeepCopyInto(&out.NodeSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonSpec. -func (in *CommonSpec) DeepCopy() *CommonSpec { - if in == nil { - return nil - } - out := new(CommonSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigParam) DeepCopyInto(out *ConfigParam) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigParam. -func (in *ConfigParam) DeepCopy() *ConfigParam { - if in == nil { - return nil - } - out := new(ConfigParam) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MSP) DeepCopyInto(out *MSP) { - *out = *in - if in.AdminCerts != nil { - in, out := &in.AdminCerts, &out.AdminCerts - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.CaCerts != nil { - in, out := &in.CaCerts, &out.CaCerts - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.TLSCacerts != nil { - in, out := &in.TLSCacerts, &out.TLSCacerts - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MSP. -func (in *MSP) DeepCopy() *MSP { - if in == nil { - return nil - } - out := new(MSP) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { - *out = *in - if in.ConfigParams != nil { - in, out := &in.ConfigParams, &out.ConfigParams - *out = make([]ConfigParam, len(*in)) - copy(*out, *in) - } - if in.Hosts != nil { - in, out := &in.Hosts, &out.Hosts - *out = make([]string, len(*in)) - copy(*out, *in) - } - in.Resources.DeepCopyInto(&out.Resources) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSpec. -func (in *NodeSpec) DeepCopy() *NodeSpec { - if in == nil { - return nil - } - out := new(NodeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeStatus) DeepCopyInto(out *NodeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatus. -func (in *NodeStatus) DeepCopy() *NodeStatus { - if in == nil { - return nil - } - out := new(NodeStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Orderer) DeepCopyInto(out *Orderer) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Orderer. -func (in *Orderer) DeepCopy() *Orderer { - if in == nil { - return nil - } - out := new(Orderer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Orderer) 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 *OrdererList) DeepCopyInto(out *OrdererList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Orderer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrdererList. -func (in *OrdererList) DeepCopy() *OrdererList { - if in == nil { - return nil - } - out := new(OrdererList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OrdererList) 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 *Peer) DeepCopyInto(out *Peer) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Peer. -func (in *Peer) DeepCopy() *Peer { - if in == nil { - return nil - } - out := new(Peer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Peer) 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 *PeerList) DeepCopyInto(out *PeerList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Peer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerList. -func (in *PeerList) DeepCopy() *PeerList { - if in == nil { - return nil - } - out := new(PeerList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PeerList) 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 *TLS) DeepCopyInto(out *TLS) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLS. -func (in *TLS) DeepCopy() *TLS { - if in == nil { - return nil - } - out := new(TLS) - in.DeepCopyInto(out) - return out -} diff --git a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.openapi.go b/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.openapi.go deleted file mode 100644 index 9b9b9c0f4..000000000 --- a/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1/zz_generated.openapi.go +++ /dev/null @@ -1,467 +0,0 @@ -// +build ! - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package v1alpha1 - -import ( - spec "github.com/go-openapi/spec" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CA": schema_pkg_apis_fabric_v1alpha1_CA(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CACerts": schema_pkg_apis_fabric_v1alpha1_CACerts(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CASpec": schema_pkg_apis_fabric_v1alpha1_CASpec(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CommonSpec": schema_pkg_apis_fabric_v1alpha1_CommonSpec(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.ConfigParam": schema_pkg_apis_fabric_v1alpha1_ConfigParam(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.MSP": schema_pkg_apis_fabric_v1alpha1_MSP(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeSpec": schema_pkg_apis_fabric_v1alpha1_NodeSpec(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus": schema_pkg_apis_fabric_v1alpha1_NodeStatus(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.Orderer": schema_pkg_apis_fabric_v1alpha1_Orderer(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.Peer": schema_pkg_apis_fabric_v1alpha1_Peer(ref), - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.TLS": schema_pkg_apis_fabric_v1alpha1_TLS(ref), - } -} - -func schema_pkg_apis_fabric_v1alpha1_CA(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CA is the Schema for the cas API", - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CASpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CASpec", "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_CACerts(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CACerts defines the desired state of CA", - Properties: map[string]spec.Schema{ - "cert": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "key": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "tlsCert": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "tlsKey": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_CASpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CASpec defines the desired state of CA", - Properties: map[string]spec.Schema{ - "admin": { - SchemaProps: spec.SchemaProps{ - 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", - Type: []string{"string"}, - Format: "", - }, - }, - "adminPassword": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "certs": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CACerts"), - }, - }, - "nodeSpec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeSpec"), - }, - }, - }, - Required: []string{"admin", "adminPassword"}, - }, - }, - Dependencies: []string{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CACerts", "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeSpec"}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_CommonSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "msp": { - SchemaProps: spec.SchemaProps{ - 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", - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.MSP"), - }, - }, - "tls": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.TLS"), - }, - }, - "nodeSpec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeSpec"), - }, - }, - }, - Required: []string{"msp", "tls"}, - }, - }, - Dependencies: []string{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.MSP", "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeSpec", "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.TLS"}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_ConfigParam(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_MSP(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The corresponding msp structure for node such as orderer or peer", - Properties: map[string]spec.Schema{ - "adminCerts": { - SchemaProps: spec.SchemaProps{ - Description: "Administrator's certificates", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "caCerts": { - SchemaProps: spec.SchemaProps{ - Description: "CA certificates", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "keyStore": { - SchemaProps: spec.SchemaProps{ - Description: "node private key", - Type: []string{"string"}, - Format: "", - }, - }, - "signCerts": { - SchemaProps: spec.SchemaProps{ - Description: "node certificate", - Type: []string{"string"}, - Format: "", - }, - }, - "tlsCacerts": { - SchemaProps: spec.SchemaProps{ - Description: "ca tls certificates", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"adminCerts", "caCerts", "keyStore", "signCerts"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_NodeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "image": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "configParams": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.ConfigParam"), - }, - }, - }, - }, - }, - "hosts": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "storageClass": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "storageSize": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"image", "configParams"}, - }, - }, - Dependencies: []string{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.ConfigParam", "k8s.io/api/core/v1.ResourceRequirements"}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_NodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeStatus defines the observed state of CA", - Properties: map[string]spec.Schema{ - "accessPoint": { - SchemaProps: spec.SchemaProps{ - 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: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"accessPoint"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_Orderer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Orderer is the Schema for the orderers API", - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CommonSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CommonSpec", "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_Peer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Peer is the Schema for the peers API", - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CommonSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.CommonSpec", "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_fabric_v1alpha1_TLS(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "tlsCert": { - SchemaProps: spec.SchemaProps{ - Description: "node certificate", - Type: []string{"string"}, - Format: "", - }, - }, - "tlsKey": { - SchemaProps: spec.SchemaProps{ - Description: "node private key", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"tlsCert", "tlsKey"}, - }, - }, - Dependencies: []string{}, - } -} diff --git a/src/agent/fabric-operator/pkg/controller/add_ca.go b/src/agent/fabric-operator/pkg/controller/add_ca.go deleted file mode 100644 index acf3e3cfb..000000000 --- a/src/agent/fabric-operator/pkg/controller/add_ca.go +++ /dev/null @@ -1,10 +0,0 @@ -package controller - -import ( - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/controller/ca" -) - -func init() { - // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. - AddToManagerFuncs = append(AddToManagerFuncs, ca.Add) -} diff --git a/src/agent/fabric-operator/pkg/controller/add_orderer.go b/src/agent/fabric-operator/pkg/controller/add_orderer.go deleted file mode 100644 index 358d5cfda..000000000 --- a/src/agent/fabric-operator/pkg/controller/add_orderer.go +++ /dev/null @@ -1,10 +0,0 @@ -package controller - -import ( - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/controller/orderer" -) - -func init() { - // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. - AddToManagerFuncs = append(AddToManagerFuncs, orderer.Add) -} diff --git a/src/agent/fabric-operator/pkg/controller/add_peer.go b/src/agent/fabric-operator/pkg/controller/add_peer.go deleted file mode 100644 index 5a3b6e165..000000000 --- a/src/agent/fabric-operator/pkg/controller/add_peer.go +++ /dev/null @@ -1,10 +0,0 @@ -package controller - -import ( - "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/controller/peer" -) - -func init() { - // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. - AddToManagerFuncs = append(AddToManagerFuncs, peer.Add) -} diff --git a/src/agent/fabric-operator/pkg/controller/ca/ca_controller.go b/src/agent/fabric-operator/pkg/controller/ca/ca_controller.go deleted file mode 100755 index e3eaa4cdb..000000000 --- a/src/agent/fabric-operator/pkg/controller/ca/ca_controller.go +++ /dev/null @@ -1,344 +0,0 @@ -package ca - -import ( - "context" - "encoding/base64" - "strconv" - "strings" - "time" - - fabric "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric" - fabricv1alpha1 "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "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" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" - "sigs.k8s.io/controller-runtime/pkg/source" -) - -var log = logf.Log.WithName("controller_ca") - -/** -* USER ACTION REQUIRED: This is a scaffold file intended for the user to modify with their own Controller -* business logic. Delete these comments after modifying this file.* - */ - -// Add creates a new CA 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 &ReconcileCA{client: mgr.GetClient(), scheme: mgr.GetScheme(), kubeconfig: mgr.GetConfig()} -} - -// 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("ca-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to primary resource CA - err = c.Watch(&source.Kind{Type: &fabricv1alpha1.CA{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - // Watch for changes to stateful set that we create - err = c.Watch(&source.Kind{Type: &appsv1.StatefulSet{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - // Watch for changes to secret that we create - err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - // Watch for changes to services that we create - err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - return nil -} - -// blank assignment to verify that ReconcileCA implements reconcile.Reconciler -var _ reconcile.Reconciler = &ReconcileCA{} - -// ReconcileCA reconciles a CA object -type ReconcileCA 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 - kubeconfig *rest.Config -} - -// Reconcile reads that state of the cluster for a CA object and makes changes based on the state read -// and what is in the CA.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 *ReconcileCA) Reconcile(request reconcile.Request) (reconcile.Result, error) { - reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) - reqLogger.Info("Reconciling Fabric CA") - - err := fabric.CheckAndCreateConfigMap(r.client, request) - if err != nil { - reqLogger.Error(err, "Failed to find Fabric configuration, can not continue!") - return reconcile.Result{}, err - } - - // Fetch the CA instance - instance := &fabricv1alpha1.CA{} - err = r.client.Get(context.TODO(), request.NamespacedName, instance) - if err != nil { - if errors.IsNotFound(err) { - // Request object not found, could have been deleted after reconcile request. - // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. - // Return and don't requeue - reqLogger.Info("Fabric CA resource not found. Ignoring since object must be deleted.") - return reconcile.Result{}, nil - } - // Error reading the object - requeue the request. - reqLogger.Error(err, "Failed to get Fabric CA.") - return reconcile.Result{}, err - } - - secretID := request.Name + "-secret" - foundSecret := &corev1.Secret{} - err = r.client.Get(context.TODO(), - types.NamespacedName{Name: secretID, Namespace: request.Namespace}, - foundSecret) - if err != nil && errors.IsNotFound(err) { - secret := r.newSecretForCR(instance, request) - err = r.client.Create(context.TODO(), secret) - if err != nil { - reqLogger.Error(err, "Failed to retrieve Fabric CA secrets") - return reconcile.Result{}, err - } - // When we reach here, it means that we have created the secret successfully - // and ready to do more - } - - foundService := &corev1.Service{} - err = r.client.Get(context.TODO(), request.NamespacedName, foundService) - if err != nil && errors.IsNotFound(err) { - // Define a new Service object - service := r.newServiceForCR(instance, request) - reqLogger.Info("Creating a new service.", "Service.Namespace", service.Namespace, - "Service.Name", service.Name) - err = r.client.Create(context.TODO(), service) - if err != nil { - reqLogger.Error(err, "Failed to create new service for CA.", "Service.Namespace", - service.Namespace, "Service.Name", service.Name) - return reconcile.Result{}, err - } - // Create the service ok, try to get its ports - r.client.Get(context.TODO(), request.NamespacedName, foundService) - } else if err != nil { - reqLogger.Error(err, "Failed to get CA service.") - return reconcile.Result{}, err - } - - if len(foundService.Spec.Ports) == 0 { - // if no ports yet, we need to wait. - return reconcile.Result{Requeue: true}, nil - } - - if instance.Status.AccessPoint == "" { - if foundService.Spec.Ports[0].NodePort > 0 { - reqLogger.Info("The service port has been found", "Service port", foundService.Spec.Ports[0].NodePort) - r.client.Get(context.TODO(), request.NamespacedName, instance) - - allHostIPs, _ := fabric.GetNodeIPaddress(r.client) - publicIPs := append(instance.Spec.Hosts, allHostIPs...) - - if len(publicIPs) > 0 { - // Got some public IPs, set access point accordingly - instance.Status.AccessPoint = "https://" + publicIPs[0] + ":" + - strconv.FormatInt(int64(foundService.Spec.Ports[0].NodePort), 10) - } else { - // Not getting any public accessible IPs, only expose port - instance.Status.AccessPoint = - strconv.FormatInt(int64(foundService.Spec.Ports[0].NodePort), 10) - } - err = r.client.Status().Update(context.TODO(), instance) - if err != nil { - reqLogger.Error(err, "Failed to update CA status", "Fabric CA namespace", - instance.Namespace, "Fabric CA Name", instance.Name) - return reconcile.Result{}, err - } - } else { - return reconcile.Result{Requeue: true}, nil - } - } - - foundSTS := &appsv1.StatefulSet{} - err = r.client.Get(context.TODO(), request.NamespacedName, foundSTS) - if err != nil && errors.IsNotFound(err) { - // Define a new StatefulSet object - sts := r.newSTSForCR(instance, request) - reqLogger.Info("Creating a new set.", "StatefulSet.Namespace", sts.Namespace, - "StatefulSet.Name", sts.Name) - err = r.client.Create(context.TODO(), sts) - if err != nil && !errors.IsAlreadyExists(err) { - reqLogger.Error(err, "Failed creating new statefulset for CA.", "StatefulSet.Namespace", - sts.Namespace, "StatefulSet.Name", sts.Name) - return reconcile.Result{}, err - } - } else if err != nil { - reqLogger.Error(err, "Failed to get CA StatefulSet.") - return reconcile.Result{}, err - } - - return reconcile.Result{}, nil -} - -// newSecretForCR returns k8s secret with the name + "-secret" /namespace as the cr -func (r *ReconcileCA) newSecretForCR(cr *fabricv1alpha1.CA, request reconcile.Request) *corev1.Secret { - obj, _, _ := fabric.GetObjectFromTemplate("ca/ca_secret.yaml") - secret, ok := obj.(*corev1.Secret) - if !ok { - secret = nil - } else { - secret.Name = request.Name + "-secret" - secret.Namespace = request.Namespace - secret.Data = make(map[string][]byte) - if cr.Spec.Certs != nil { - secret.Data["cert"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.Cert) - secret.Data["key"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.Key) - secret.Data["tlsCert"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.TLSCert) - secret.Data["tlsKey"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.TLSKey) - } - controllerutil.SetControllerReference(cr, secret, r.scheme) - } - return secret -} - -// newServiceForCR returns a fabric CA service with the same name/namespace as the cr -func (r *ReconcileCA) newServiceForCR(cr *fabricv1alpha1.CA, request reconcile.Request) *corev1.Service { - obj, _, _ := fabric.GetObjectFromTemplate("ca/ca_service.yaml") - service, ok := obj.(*corev1.Service) - if !ok { - service = nil - } else { - service.Name = request.Name - service.Namespace = request.Namespace - service.Labels["k8s-app"] = service.Name - service.Spec.Selector["k8s-app"] = service.Name - controllerutil.SetControllerReference(cr, service, r.scheme) - } - return service -} - -// newStatefulSetForCR returns a fabric CA statefulset with the same name/namespace as the cr -func (r *ReconcileCA) newSTSForCR(cr *fabricv1alpha1.CA, request reconcile.Request) *appsv1.StatefulSet { - obj, _, err := fabric.GetObjectFromTemplate("ca/ca_statefulset.yaml") - if err != nil { - log.Error(err, "Failed to load statefulset.") - } - sts, ok := obj.(*appsv1.StatefulSet) - if !ok { - sts = nil - } else { - sts.Name = request.Name - sts.Namespace = request.Namespace - sts.Spec.ServiceName = sts.Name - sts.Spec.Selector.MatchLabels["k8s-app"] = sts.Name - storageClassName := fabric.GetDefault(cr.Spec.StorageClass, "default").(string) - sts.Spec.VolumeClaimTemplates[0].Spec.StorageClassName = &storageClassName - storageSize := fabric.GetDefault(cr.Spec.StorageSize, "5Gi").(string) - sts.Spec.VolumeClaimTemplates[0].Spec.Resources.Requests["storage"] = resource.MustParse(storageSize) - sts.Spec.Template.Labels["k8s-app"] = sts.Name - sts.Spec.Template.Spec.Containers[0].Image = - fabric.GetDefault(cr.Spec.Image, "hyperledger/fabric-ca:1.4.3").(string) - sts.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.SecretName = request.Name + "-secret" - - sts.Spec.Template.Spec.InitContainers[0].Env[4].Value = cr.Spec.Admin - sts.Spec.Template.Spec.InitContainers[0].Env[5].Value = cr.Spec.AdminPassword - clusterIPs, _ := fabric.GetNodeIPaddress(r.client) - cr.Spec.Hosts = append(cr.Spec.Hosts, clusterIPs...) - hosts := "[" + strings.Join(cr.Spec.Hosts, ",") + "]" - sts.Spec.Template.Spec.InitContainers[0].Env = - append(sts.Spec.Template.Spec.InitContainers[0].Env, - corev1.EnvVar{Name: "FCO_HOSTS", Value: hosts}, - ) - - sts.Spec.Template.Spec.Containers[0].Resources = cr.Spec.Resources - sts.Spec.Template.Spec.Containers[0].Env[1].Value = request.Name - for _, configParam := range cr.Spec.ConfigParams { - sts.Spec.Template.Spec.Containers[0].Env = - append(sts.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{ - Name: configParam.Name, Value: configParam.Value, - }) - } - - if cr.Spec.Certs != nil { - sts.Spec.Template.Spec.Containers[0].Env = - append(sts.Spec.Template.Spec.Containers[0].Env, - corev1.EnvVar{Name: "FABRIC_CA_SERVER_CA_KEYFILE", Value: "/certs/key"}, - corev1.EnvVar{Name: "FABRIC_CA_SERVER_CA_CERTFILE", Value: "/certs/cert"}, - corev1.EnvVar{Name: "FABRIC_CA_SERVER_TLS_KEYFILE", Value: "/certs/tlsKey"}, - corev1.EnvVar{Name: "FABRIC_CA_SERVER_TLS_CERTFILE", Value: "/certs/tlsCert"}, - ) - } - - controllerutil.SetControllerReference(cr, sts, r.scheme) - } - return sts -} - -func (r *ReconcileCA) getCerts(request reconcile.Request) string { - - kubeclient := kubernetes.NewForConfigOrDie(r.kubeconfig) - if kubeclient == nil { - log.Info("The client is empty", "the name space is ", request.Namespace, "the name is ", request.Name) - } else { - timeout, _ := time.ParseDuration("30s") - execRequest := kubeclient.CoreV1().RESTClient().Post().Resource("pods").Timeout(timeout). - Name(request.Name+"-0").Namespace(request.Namespace).SubResource("exec"). - Param("container", "ca").Param("command", "ls").Param("stdin", "false"). - Param("stdout", "false").Param("stderr", "false").Param("tty", "false") - result := execRequest.Do() - if result.Error() != nil { - log.Error(result.Error(), "Execution failed", "request.Namespace", request.Namespace, "request.Name", request.Name) - return "" - } - - buf, _ := result.Raw() - log.Info("The content of the exec result is ", string(buf)) - log.Info("The client is not empty", "the name space is ", request.Namespace, "the name is ", request.Name) - return string(buf) - } - return "" -} diff --git a/src/agent/fabric-operator/pkg/controller/controller.go b/src/agent/fabric-operator/pkg/controller/controller.go deleted file mode 100644 index 7c069f3ee..000000000 --- a/src/agent/fabric-operator/pkg/controller/controller.go +++ /dev/null @@ -1,18 +0,0 @@ -package controller - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -// AddToManagerFuncs is a list of functions to add all Controllers to the Manager -var AddToManagerFuncs []func(manager.Manager) error - -// AddToManager adds all Controllers to the Manager -func AddToManager(m manager.Manager) error { - for _, f := range AddToManagerFuncs { - if err := f(m); err != nil { - return err - } - } - return nil -} diff --git a/src/agent/fabric-operator/pkg/controller/orderer/orderer_controller.go b/src/agent/fabric-operator/pkg/controller/orderer/orderer_controller.go deleted file mode 100644 index a5058fe6e..000000000 --- a/src/agent/fabric-operator/pkg/controller/orderer/orderer_controller.go +++ /dev/null @@ -1,334 +0,0 @@ -package orderer - -import ( - "context" - "crypto/x509" - "encoding/base64" - "encoding/pem" - "strconv" - - fabric "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric" - fabricv1alpha1 "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - - "k8s.io/apimachinery/pkg/api/resource" - "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" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" - "sigs.k8s.io/controller-runtime/pkg/source" -) - -var log = logf.Log.WithName("controller_orderer") - -/** -* USER ACTION REQUIRED: This is a scaffold file intended for the user to modify with their own Controller -* business logic. Delete these comments after modifying this file.* - */ - -// Add creates a new Orderer 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 &ReconcileOrderer{client: mgr.GetClient(), scheme: 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("orderer-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to primary resource Orderer - err = c.Watch(&source.Kind{Type: &fabricv1alpha1.Orderer{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - // Watch for changes to stateful set that we create - err = c.Watch(&source.Kind{Type: &appsv1.StatefulSet{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - // Watch for changes to secret that we create - err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - // Watch for changes to services that we create - err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - return nil -} - -// blank assignment to verify that ReconcileOrderer implements reconcile.Reconciler -var _ reconcile.Reconciler = &ReconcileOrderer{} - -// ReconcileOrderer reconciles a Orderer object -type ReconcileOrderer 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 -} - -// Reconcile reads that state of the cluster for a Orderer object and makes changes based on the state read -// and what is in the Orderer.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 *ReconcileOrderer) Reconcile(request reconcile.Request) (reconcile.Result, error) { - reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) - reqLogger.Info("Reconciling Orderer") - - err := fabric.CheckAndCreateConfigMap(r.client, request) - if err != nil { - reqLogger.Error(err, "Failed to find Fabric configuration, can not continue!") - return reconcile.Result{}, err - } - - // Fetch the Orderer instance - instance := &fabricv1alpha1.Orderer{} - err = r.client.Get(context.TODO(), request.NamespacedName, instance) - if err != nil { - if errors.IsNotFound(err) { - // Request object not found, could have been deleted after reconcile request. - // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. - // Return and don't requeue - reqLogger.Info("Orderer resource not found. Ignoring since object must be deleted.") - return reconcile.Result{}, nil - } - // Error reading the object - requeue the request. - reqLogger.Error(err, "Failed to get Orderer.") - return reconcile.Result{}, err - } - - secret := &corev1.Secret{} - secretID := request.Name + "-secret" - foundSecret := &corev1.Secret{} - err = r.client.Get(context.TODO(), - types.NamespacedName{Name: secretID, Namespace: request.Namespace}, - foundSecret) - if err != nil && errors.IsNotFound(err) { - secret = r.newSecretForCR(instance, request) - err = r.client.Create(context.TODO(), secret) - if err != nil { - reqLogger.Error(err, "Failed to retrieve Fabric Peer secrets") - return reconcile.Result{}, err - } - // When we reach here, it means that we have created the secret successfully - // and ready to do more - } - - foundService := &corev1.Service{} - err = r.client.Get(context.TODO(), request.NamespacedName, foundService) - if err != nil && errors.IsNotFound(err) { - // Define a new Service object - service := r.newServiceForCR(instance, request) - reqLogger.Info("Creating a new service.", "Service.Namespace", service.Namespace, - "Service.Name", service.Name) - err = r.client.Create(context.TODO(), service) - if err != nil { - reqLogger.Error(err, "Failed to create new service for Orderer.", "Service.Namespace", - service.Namespace, "Service.Name", service.Name) - return reconcile.Result{}, err - } - r.client.Get(context.TODO(), request.NamespacedName, foundService) - } else if err != nil { - reqLogger.Error(err, "Failed to get Orderer service.") - return reconcile.Result{}, err - } - - if len(foundService.Spec.Ports) == 0 { - // if no ports yet, we need to wait. - return reconcile.Result{Requeue: true}, nil - } - - if instance.Status.AccessPoint == "" { - if foundService.Spec.Ports[0].NodePort > 0 { - reqLogger.Info("The service port has been found", "Service port", foundService.Spec.Ports[0].NodePort) - r.client.Get(context.TODO(), request.NamespacedName, instance) - - allHostIPs, _ := fabric.GetNodeIPaddress(r.client) - publicIPs := append(instance.Spec.Hosts, allHostIPs...) - - if len(publicIPs) > 0 { - // Got some public IPs, set access point accordingly - instance.Status.AccessPoint = "https://" + publicIPs[0] + ":" + - strconv.FormatInt(int64(foundService.Spec.Ports[0].NodePort), 10) - } else { - // Not getting any public accessible IPs, only expose port - instance.Status.AccessPoint = - strconv.FormatInt(int64(foundService.Spec.Ports[0].NodePort), 10) - } - err = r.client.Status().Update(context.TODO(), instance) - if err != nil { - reqLogger.Error(err, "Failed to update Orderer status", "Fabric Orderer namespace", - instance.Namespace, "Fabric Orderer Name", instance.Name) - return reconcile.Result{}, err - } - } else { - return reconcile.Result{Requeue: true}, nil - } - } - - foundSTS := &appsv1.StatefulSet{} - err = r.client.Get(context.TODO(), request.NamespacedName, foundSTS) - if err != nil && errors.IsNotFound(err) { - // Define a new StatefulSet object - sts := r.newSTSForCR(instance, request) - reqLogger.Info("Creating a new set.", "StatefulSet.Namespace", sts.Namespace, - "StatefulSet.Name", sts.Name) - err = r.client.Create(context.TODO(), sts) - if err != nil && !errors.IsAlreadyExists(err) { - reqLogger.Error(err, "Failed creating new statefulset for Orderer.", "StatefulSet.Namespace", - sts.Namespace, "StatefulSet.Name", sts.Name) - return reconcile.Result{}, err - } - } else if err != nil { - reqLogger.Error(err, "Failed to get Orderer StatefulSet.") - return reconcile.Result{}, err - } - - return reconcile.Result{}, nil -} - -// newSecretForCR returns k8s secret with the name + "-secret" /namespace as the cr -func (r *ReconcileOrderer) newSecretForCR(cr *fabricv1alpha1.Orderer, request reconcile.Request) *corev1.Secret { - obj, _, _ := fabric.GetObjectFromTemplate("orderer/orderer_secret.yaml") - secret, ok := obj.(*corev1.Secret) - if !ok { - secret = nil - } else { - secret.Name = request.Name + "-secret" - secret.Namespace = request.Namespace - secret.Data = make(map[string][]byte) - - if cr.Spec.AdminCerts == nil || len(cr.Spec.AdminCerts) == 0 || - cr.Spec.CaCerts == nil || len(cr.Spec.CaCerts) == 0 || - len(cr.Spec.KeyStore) == 0 || len(cr.Spec.SignCerts) == 0 || - cr.Spec.TLSCacerts == nil || len(cr.Spec.TLSCacerts) == 0 || - len(cr.Spec.TLS.TLSCert) == 0 || len(cr.Spec.TLS.TLSKey) == 0 { - log.Error(errors.NewBadRequest("All entries under MSP and TLS in the request are required."), - "Orderer creation", "Provide all certs under msp and tls in the request") - return nil - } - - for i, adminCert := range cr.Spec.AdminCerts { - secret.Data["admincert"+strconv.Itoa(i)], _ = base64.StdEncoding.DecodeString(adminCert) - } - for i, caCert := range cr.Spec.CaCerts { - secret.Data["cacert"+strconv.Itoa(i)], _ = base64.StdEncoding.DecodeString(caCert) - } - secret.Data["keystore"], _ = base64.StdEncoding.DecodeString(cr.Spec.KeyStore) - secret.Data["signcert"], _ = base64.StdEncoding.DecodeString(cr.Spec.SignCerts) - // Try to find the organization name to be used as mspid - block, _ := pem.Decode(secret.Data["signcert"]) - secret.Data["mspid"] = []byte("SampleOrgMSPID") - if block != nil { - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - log.Error(err, "Failed to parse certificate") - } else { - if len(cert.Subject.Organization) > 0 { - secret.Data["mspid"] = []byte(cert.Subject.Organization[0]) - } else if len(cert.Issuer.Organization) > 0 { - secret.Data["mspid"] = []byte(cert.Issuer.Organization[0]) - } - } - } - for i, tlsCacerts := range cr.Spec.TLSCacerts { - secret.Data["tlscacert"+strconv.Itoa(i)], _ = base64.StdEncoding.DecodeString(tlsCacerts) - } - - secret.Data["tlscert"], _ = base64.StdEncoding.DecodeString(cr.Spec.TLS.TLSCert) - secret.Data["tlskey"], _ = base64.StdEncoding.DecodeString(cr.Spec.TLS.TLSKey) - controllerutil.SetControllerReference(cr, secret, r.scheme) - } - return secret -} - -// newServiceForCR returns a fabric Orderer service with the same name/namespace as the cr -func (r *ReconcileOrderer) newServiceForCR(cr *fabricv1alpha1.Orderer, request reconcile.Request) *corev1.Service { - obj, _, _ := fabric.GetObjectFromTemplate("orderer/orderer_service.yaml") - service, ok := obj.(*corev1.Service) - if !ok { - service = nil - } else { - service.Name = request.Name - service.Namespace = request.Namespace - service.Labels["k8s-app"] = service.Name - service.Spec.Selector["k8s-app"] = service.Name - controllerutil.SetControllerReference(cr, service, r.scheme) - } - return service -} - -// newStatefulSetForCR returns a fabric Orderer statefulset with the same name/namespace as the cr -func (r *ReconcileOrderer) newSTSForCR(cr *fabricv1alpha1.Orderer, request reconcile.Request) *appsv1.StatefulSet { - obj, _, err := fabric.GetObjectFromTemplate("orderer/orderer_statefulset.yaml") - if err != nil { - log.Error(err, "Failed to load statefulset.") - } - sts, ok := obj.(*appsv1.StatefulSet) - if !ok { - sts = nil - } else { - sts.Name = request.Name - sts.Namespace = request.Namespace - sts.Spec.ServiceName = sts.Name - sts.Spec.Selector.MatchLabels["k8s-app"] = sts.Name - storageClassName := fabric.GetDefault(cr.Spec.StorageClass, "default").(string) - sts.Spec.VolumeClaimTemplates[0].Spec.StorageClassName = &storageClassName - storageSize := fabric.GetDefault(cr.Spec.StorageSize, "5Gi").(string) - sts.Spec.VolumeClaimTemplates[0].Spec.Resources.Requests["storage"] = resource.MustParse(storageSize) - sts.Spec.Template.Labels["k8s-app"] = sts.Name - sts.Spec.Template.Spec.Containers[0].Image = - fabric.GetDefault(cr.Spec.Image, "hyperledger/fabric-orderer:1.4.3").(string) - sts.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.SecretName = request.Name + "-secret" - sts.Spec.Template.Spec.InitContainers[0].Env[0].ValueFrom.SecretKeyRef.Name = request.Name + "-secret" - sts.Spec.Template.Spec.Containers[0].Env[0].ValueFrom.SecretKeyRef.Name = request.Name + "-secret" - - containerEnvs := sts.Spec.Template.Spec.Containers[0].Env - - for _, e := range cr.Spec.ConfigParams { - containerEnvs = append(containerEnvs, corev1.EnvVar{ - Name: e.Name, Value: e.Value, - }) - } - - sts.Spec.Template.Spec.Containers[0].Env = containerEnvs - sts.Spec.Template.Spec.Containers[0].Resources = cr.Spec.Resources - controllerutil.SetControllerReference(cr, sts, r.scheme) - } - return sts -} diff --git a/src/agent/fabric-operator/pkg/controller/peer/peer_controller.go b/src/agent/fabric-operator/pkg/controller/peer/peer_controller.go deleted file mode 100644 index d30e21788..000000000 --- a/src/agent/fabric-operator/pkg/controller/peer/peer_controller.go +++ /dev/null @@ -1,337 +0,0 @@ -package peer - -import ( - "context" - "crypto/x509" - "encoding/base64" - "encoding/pem" - "strconv" - - fabric "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric" - fabricv1alpha1 "github.com/hyperledger/cello/src/agent/fabric-operator/pkg/apis/fabric/v1alpha1" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - - "k8s.io/apimachinery/pkg/api/resource" - "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" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" - "sigs.k8s.io/controller-runtime/pkg/source" -) - -var log = logf.Log.WithName("controller_peer") - -/** -* USER ACTION REQUIRED: This is a scaffold file intended for the user to modify with their own Controller -* business logic. Delete these comments after modifying this file.* - */ - -// Add creates a new Peer 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 &ReconcilePeer{client: mgr.GetClient(), scheme: 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("peer-controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to primary resource Peer - err = c.Watch(&source.Kind{Type: &fabricv1alpha1.Peer{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - // Watch for changes to stateful set that we create - err = c.Watch(&source.Kind{Type: &appsv1.StatefulSet{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - // Watch for changes to secret that we create - err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - // Watch for changes to services that we create - err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{ - IsController: true, - OwnerType: &fabricv1alpha1.CA{}, - }) - if err != nil { - return err - } - - return nil -} - -// blank assignment to verify that ReconcilePeer implements reconcile.Reconciler -var _ reconcile.Reconciler = &ReconcilePeer{} - -// ReconcilePeer reconciles a Peer object -type ReconcilePeer 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 -} - -// Reconcile reads that state of the cluster for a Peer object and makes changes based on the state read -// and what is in the Peer.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 *ReconcilePeer) Reconcile(request reconcile.Request) (reconcile.Result, error) { - reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) - reqLogger.Info("Reconciling Peer") - - err := fabric.CheckAndCreateConfigMap(r.client, request) - if err != nil { - reqLogger.Error(err, "Failed to find Fabric configuration, can not continue!") - return reconcile.Result{}, err - } - - // Fetch the Peer instance - instance := &fabricv1alpha1.Peer{} - err = r.client.Get(context.TODO(), request.NamespacedName, instance) - if err != nil { - if errors.IsNotFound(err) { - // Request object not found, could have been deleted after reconcile request. - // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. - // Return and don't requeue - reqLogger.Info("Peer resource not found. Ignoring since object must be deleted.") - return reconcile.Result{}, nil - } - // Error reading the object - requeue the request. - reqLogger.Error(err, "Failed to get Peer.") - return reconcile.Result{}, err - } - - secret := &corev1.Secret{} - secretID := request.Name + "-secret" - foundSecret := &corev1.Secret{} - err = r.client.Get(context.TODO(), - types.NamespacedName{Name: secretID, Namespace: request.Namespace}, - foundSecret) - if err != nil && errors.IsNotFound(err) { - secret = r.newSecretForCR(instance, request) - err = r.client.Create(context.TODO(), secret) - if err != nil { - reqLogger.Error(err, "Failed to retrieve Fabric Peer secrets") - return reconcile.Result{}, err - } - // When we reach here, it means that we have created the secret successfully - // and ready to do more - } - - foundService := &corev1.Service{} - err = r.client.Get(context.TODO(), request.NamespacedName, foundService) - if err != nil && errors.IsNotFound(err) { - // Define a new Service object - service := r.newServiceForCR(instance, request) - reqLogger.Info("Creating a new service.", "Service.Namespace", service.Namespace, - "Service.Name", service.Name) - err = r.client.Create(context.TODO(), service) - if err != nil { - reqLogger.Error(err, "Failed to create new service for Peer.", "Service.Namespace", - service.Namespace, "Service.Name", service.Name) - return reconcile.Result{}, err - } - r.client.Get(context.TODO(), request.NamespacedName, foundService) - } else if err != nil { - reqLogger.Error(err, "Failed to get Peer service.") - return reconcile.Result{}, err - } - - if len(foundService.Spec.Ports) == 0 { - // if no ports yet, we need to wait. - return reconcile.Result{Requeue: true}, nil - } - - if instance.Status.AccessPoint == "" { - if foundService.Spec.Ports[0].NodePort > 0 { - reqLogger.Info("The service port has been found", "Service port", foundService.Spec.Ports[0].NodePort) - r.client.Get(context.TODO(), request.NamespacedName, instance) - - allHostIPs, _ := fabric.GetNodeIPaddress(r.client) - publicIPs := append(instance.Spec.Hosts, allHostIPs...) - - if len(publicIPs) > 0 { - // Got some public IPs, set access point accordingly - instance.Status.AccessPoint = "https://" + publicIPs[0] + ":" + - strconv.FormatInt(int64(foundService.Spec.Ports[0].NodePort), 10) - } else { - // Not getting any public accessible IPs, only expose port - instance.Status.AccessPoint = - strconv.FormatInt(int64(foundService.Spec.Ports[0].NodePort), 10) - } - err = r.client.Status().Update(context.TODO(), instance) - if err != nil { - reqLogger.Error(err, "Failed to update Peer status", "Fabric Peer namespace", - instance.Namespace, "Fabric Peer Name", instance.Name) - return reconcile.Result{}, err - } - } else { - return reconcile.Result{Requeue: true}, nil - } - } - - foundSTS := &appsv1.StatefulSet{} - err = r.client.Get(context.TODO(), request.NamespacedName, foundSTS) - if err != nil && errors.IsNotFound(err) { - // Define a new StatefulSet object - sts := r.newSTSForCR(instance, request) - reqLogger.Info("Creating a new set.", "StatefulSet.Namespace", sts.Namespace, - "StatefulSet.Name", sts.Name) - err = r.client.Create(context.TODO(), sts) - if err != nil && !errors.IsAlreadyExists(err) { - reqLogger.Error(err, "Failed creating new statefulset for Peer.", "StatefulSet.Namespace", - sts.Namespace, "StatefulSet.Name", sts.Name) - return reconcile.Result{}, err - } - } else if err != nil { - reqLogger.Error(err, "Failed to get Peer StatefulSet.") - return reconcile.Result{}, err - } - - return reconcile.Result{}, nil -} - -// newSecretForCR returns k8s secret with the name + "-secret" /namespace as the cr -func (r *ReconcilePeer) newSecretForCR(cr *fabricv1alpha1.Peer, request reconcile.Request) *corev1.Secret { - obj, _, _ := fabric.GetObjectFromTemplate("peer/peer_secret.yaml") - secret, ok := obj.(*corev1.Secret) - if !ok { - secret = nil - } else { - secret.Name = request.Name + "-secret" - secret.Namespace = request.Namespace - secret.Data = make(map[string][]byte) - - if cr.Spec.AdminCerts == nil || len(cr.Spec.AdminCerts) == 0 || - cr.Spec.CaCerts == nil || len(cr.Spec.CaCerts) == 0 || - len(cr.Spec.KeyStore) == 0 || len(cr.Spec.SignCerts) == 0 || - cr.Spec.TLSCacerts == nil || len(cr.Spec.TLSCacerts) == 0 || - len(cr.Spec.TLS.TLSCert) == 0 || len(cr.Spec.TLS.TLSKey) == 0 { - log.Error(errors.NewBadRequest("All entries under MSP and TLS in the request are required."), - "Orderer creation", "Provide all certs under msp and tls in the request") - return nil - } - - for i, adminCert := range cr.Spec.AdminCerts { - secret.Data["admincert"+strconv.Itoa(i)], _ = base64.StdEncoding.DecodeString(adminCert) - } - for i, caCert := range cr.Spec.CaCerts { - secret.Data["cacert"+strconv.Itoa(i)], _ = base64.StdEncoding.DecodeString(caCert) - } - secret.Data["keystore"], _ = base64.StdEncoding.DecodeString(cr.Spec.KeyStore) - secret.Data["signcert"], _ = base64.StdEncoding.DecodeString(cr.Spec.SignCerts) - // Try to find the organization name to be used as mspid - block, _ := pem.Decode(secret.Data["signcert"]) - secret.Data["mspid"] = []byte("SampleOrgMSPID") - if block != nil { - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - log.Error(err, "Failed to parse certificate") - } else { - if len(cert.Subject.Organization) > 0 { - secret.Data["mspid"] = []byte(cert.Subject.Organization[0]) - } else if len(cert.Issuer.Organization) > 0 { - secret.Data["mspid"] = []byte(cert.Issuer.Organization[0]) - } - } - } - for i, tlsCacerts := range cr.Spec.TLSCacerts { - secret.Data["tlscacert"+strconv.Itoa(i)], _ = base64.StdEncoding.DecodeString(tlsCacerts) - } - - secret.Data["tlscert"], _ = base64.StdEncoding.DecodeString(cr.Spec.TLS.TLSCert) - secret.Data["tlskey"], _ = base64.StdEncoding.DecodeString(cr.Spec.TLS.TLSKey) - controllerutil.SetControllerReference(cr, secret, r.scheme) - } - return secret -} - -// newServiceForCR returns a fabric Peer service with the same name/namespace as the cr -func (r *ReconcilePeer) newServiceForCR(cr *fabricv1alpha1.Peer, request reconcile.Request) *corev1.Service { - obj, _, _ := fabric.GetObjectFromTemplate("peer/peer_service.yaml") - service, ok := obj.(*corev1.Service) - if !ok { - service = nil - } else { - service.Name = request.Name - service.Namespace = request.Namespace - service.Labels["k8s-app"] = service.Name - service.Spec.Selector["k8s-app"] = service.Name - controllerutil.SetControllerReference(cr, service, r.scheme) - } - return service -} - -// newStatefulSetForCR returns a fabric Peer statefulset with the same name/namespace as the cr -func (r *ReconcilePeer) newSTSForCR(cr *fabricv1alpha1.Peer, request reconcile.Request) *appsv1.StatefulSet { - obj, _, err := fabric.GetObjectFromTemplate("peer/peer_statefulset.yaml") - if err != nil { - log.Error(err, "Failed to load statefulset.") - } - sts, ok := obj.(*appsv1.StatefulSet) - if !ok { - sts = nil - } else { - sts.Name = request.Name - sts.Namespace = request.Namespace - sts.Spec.ServiceName = sts.Name - sts.Spec.Selector.MatchLabels["k8s-app"] = sts.Name - storageClassName := fabric.GetDefault(cr.Spec.StorageClass, "default").(string) - sts.Spec.VolumeClaimTemplates[0].Spec.StorageClassName = &storageClassName - storageSize := fabric.GetDefault(cr.Spec.StorageSize, "5Gi").(string) - sts.Spec.VolumeClaimTemplates[0].Spec.Resources.Requests["storage"] = resource.MustParse(storageSize) - sts.Spec.Template.Labels["k8s-app"] = sts.Name - sts.Spec.Template.Spec.Containers[0].Image = - fabric.GetDefault(cr.Spec.Image, "hyperledger/fabric-peer:1.4.3").(string) - sts.Spec.Template.Spec.Volumes[0].VolumeSource.Secret.SecretName = request.Name + "-secret" - sts.Spec.Template.Spec.Containers[0].Env[0].ValueFrom.SecretKeyRef.Name = request.Name + "-secret" - - containerEnvs := sts.Spec.Template.Spec.Containers[0].Env - if len(cr.Status.AccessPoint) > 9 { - ep := string(cr.Status.AccessPoint[8:len(cr.Status.AccessPoint)]) - containerEnvs = append(containerEnvs, - corev1.EnvVar{Name: "CORE_PEER_GOSSIP_EXTERNALENDPOINT", Value: ep}) - } - for _, e := range cr.Spec.ConfigParams { - containerEnvs = append(containerEnvs, corev1.EnvVar{ - Name: e.Name, Value: e.Value, - }) - } - - sts.Spec.Template.Spec.Containers[0].Env = containerEnvs - sts.Spec.Template.Spec.Containers[0].Resources = cr.Spec.Resources - controllerutil.SetControllerReference(cr, sts, r.scheme) - } - return sts -} diff --git a/src/agent/fabric-operator/tools.go b/src/agent/fabric-operator/tools.go deleted file mode 100644 index 648413f98..000000000 --- a/src/agent/fabric-operator/tools.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build tools - -package tools - -import ( - _ "sigs.k8s.io/controller-tools/pkg/crd/generator" -) diff --git a/src/agent/fabric-operator/version/version.go b/src/agent/fabric-operator/version/version.go deleted file mode 100644 index e3e130bf9..000000000 --- a/src/agent/fabric-operator/version/version.go +++ /dev/null @@ -1,5 +0,0 @@ -package version - -var ( - Version = "0.0.1" -) From 0828679ff1558f80d61cee9ce0eb47fcdec1e642 Mon Sep 17 00:00:00 2001 From: Yuanmao Zhu Date: Sun, 5 Feb 2023 19:52:16 -0500 Subject: [PATCH 2/2] wip Signed-off-by: Yuanmao Zhu --- .github/workflows/docker-image.yml | 19 +++--- azure-pipelines.yml | 60 +++++++++---------- .../agent/fabric-operator/Dockerfile.in | 17 ------ .../dockerhub/latest/agent/ansible/Dockerfile | 45 -------------- ci/check-component.yml | 6 +- 5 files changed, 39 insertions(+), 108 deletions(-) delete mode 100644 build_image/docker/agent/fabric-operator/Dockerfile.in delete mode 100755 build_image/dockerhub/latest/agent/ansible/Dockerfile diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 07600a161..b8934740d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,21 +2,18 @@ name: Cello CI on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: - build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build images - run: | - docker build . --file "build_image/docker/common/api-engine/Dockerfile.in" --tag hyperledger/cello-api-engine:$(date +%s) - docker build . --file "build_image/docker/common/nginx/Dockerfile.in" --tag hyperledger/cello-nginx:$(date +%s) - docker build . --file "build_image/docker/common/dashboard/Dockerfile.in" --tag hyperledger/cello-dashboard:$(date +%s) - docker build . --file "build_image/docker/agent/ansible/Dockerfile.in" --tag hyperledger/cello-ansible-agent:$(date +%s) + - uses: actions/checkout@v3 + - name: Build images + run: | + docker build . --file "build_image/docker/common/api-engine/Dockerfile.in" --tag hyperledger/cello-api-engine:$(date +%s) + docker build . --file "build_image/docker/common/nginx/Dockerfile.in" --tag hyperledger/cello-nginx:$(date +%s) + docker build . --file "build_image/docker/common/dashboard/Dockerfile.in" --tag hyperledger/cello-dashboard:$(date +%s) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fdbf6babf..e8d3c4b40 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,44 +4,44 @@ # https://aka.ms/yaml trigger: -- main + - main pool: - vmImage: 'ubuntu-18.04' + vmImage: "ubuntu-18.04" variables: - group: credentials stages: -- stage: PreCheck - displayName: Check license and documents - jobs: - - job: CheckLicenseAndDocs - condition: false - steps: - - template: ci/check-license-and-docs.yml + - stage: PreCheck + displayName: Check license and documents + jobs: + - job: CheckLicenseAndDocs + condition: false + steps: + - template: ci/check-license-and-docs.yml -- stage: ProcessComponents - displayName: ProcessComponents - condition: false - jobs: - - template: ci/process-components.yml - parameters: - param: - - name: dashandapi - pretest: "dashandapi_pre.yml" - posttest: "dashandapi_post.yml" - images: - - imagename: "hyperledger/cello-api-engine" - dockerfile: "build_image/docker/common/api-engine/Dockerfile.in" - - imagename: "hyperledger/cello-nginx" - dockerfile: "build_image/docker/common/nginx/Dockerfile.in" - - imagename: "hyperledger/cello-dashboard" - dockerfile: "build_image/docker/common/dashboard/Dockerfile.in" - - name: ansibleagent - images: - - imagename: "hyperledger/cello-ansible-agent" - dockerfile: "build_image/docker/agent/ansible/Dockerfile.in" + - stage: ProcessComponents + displayName: ProcessComponents + condition: false + jobs: + - template: ci/process-components.yml + parameters: + param: + - name: dashandapi + pretest: "dashandapi_pre.yml" + posttest: "dashandapi_post.yml" + images: + - imagename: "hyperledger/cello-api-engine" + dockerfile: "build_image/docker/common/api-engine/Dockerfile.in" + - imagename: "hyperledger/cello-nginx" + dockerfile: "build_image/docker/common/nginx/Dockerfile.in" + - imagename: "hyperledger/cello-dashboard" + dockerfile: "build_image/docker/common/dashboard/Dockerfile.in" + # - name: ansibleagent + # images: + # - imagename: "hyperledger/cello-ansible-agent" + # dockerfile: "build_image/docker/agent/ansible/Dockerfile.in" # - name: fabricoperator # images: # - imagename: "hyperledger/cello-k8s-operator-agent" diff --git a/build_image/docker/agent/fabric-operator/Dockerfile.in b/build_image/docker/agent/fabric-operator/Dockerfile.in deleted file mode 100644 index 3da5b10d6..000000000 --- a/build_image/docker/agent/fabric-operator/Dockerfile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Dockerfile for hyperledger cello fabirc operator agent -# -# @see https://github.com/hyperledger/cello/tree/master/docs/agents/fabric-operator.md -# -FROM alpine -RUN release=$(wget -O - https://storage.googleapis.com/kubernetes-release/release/stable.txt) && \ - wget https://storage.googleapis.com/kubernetes-release/release/${release}/bin/linux/amd64/kubectl \ - -O /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl -RUN apk update && apk add jq gettext curl bash && mkdir /home/app -ADD src/agent/fabric-operator/deploy /home/app -ADD src/agent/fabric-operator/agent /home/app - -ENV HOME /home -WORKDIR /home/app -ENV KUBECONFIG /home/.kube/config - -CMD bash /home/app/deploy_cr.sh diff --git a/build_image/dockerhub/latest/agent/ansible/Dockerfile b/build_image/dockerhub/latest/agent/ansible/Dockerfile deleted file mode 100755 index bf15ec23d..000000000 --- a/build_image/dockerhub/latest/agent/ansible/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Dockerfile for hyperledger cello ansible agent -# -# @see https://github.com/hyperledger/cello/blob/master/docs/worker_ansible_howto.md -# -FROM alpine/git AS BUILD - -RUN cd /tmp && git init cello && cd cello && \ - git remote add origin https://github.com/hyperledger/cello.git && \ - git config core.sparsecheckout true && \ - echo "src/agent/ansible/*" >> .git/info/sparse-checkout && \ - git pull --depth=1 origin master - -FROM ubuntu:xenial - -MAINTAINER Tong Li - -ARG user=ubuntu -ARG uid=1000 -ARG gid=1000 - -RUN apt-get update && \ - apt-get install -y bash python-pip sudo curl && \ - pip install --upgrade pip ansible pyyaml && \ - groupadd -g ${gid} ${user} && \ - useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \ - usermod -a -G root ${user} && \ - echo "${user} ALL=(ALL) NOPASSWD: ALL"|tee /etc/sudoers.d/${user} && \ - mkdir -p /opt/agent/.ssh && \ - cd /opt/agent/.ssh && \ - echo "host *" > config && \ - echo " StrictHostKeyChecking no" >> config && \ - echo " UserKnownHostsFile /dev/null" >> config - -COPY --from=build /tmp/cello/src/agent/ansible /opt/agent -RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ - mv kubectl /usr/local/bin/kubectl -RUN chown -R ${uid}:${gid} /opt/agent && \ - chmod 755 /usr/local/bin/kubectl - -ENV HOME /opt/agent -ENV WORKDIR /opt/agent -WORKDIR /opt/agent -USER ${user} - -CMD [ "ansible-playbook", "--version" ] diff --git a/ci/check-component.yml b/ci/check-component.yml index ede688d44..186e10562 100644 --- a/ci/check-component.yml +++ b/ci/check-component.yml @@ -7,10 +7,6 @@ steps: echo Checking changes in ${{ parameters.componentName }} dashandapi=("src/api-engine/" "src/dashboard/" "build_image/docker/common/") - ansibleagent=("src/agent/ansible/" - "build_image/docker/agent/ansible") - fabricoperator=("src/agent/fabric-operator/" - "build_image/docker/fabric-operator/") allchanges=$(git diff --name-only HEAD HEAD~1) echo 'changed files in the pull request' @@ -40,4 +36,4 @@ steps: echo 'No changes found for the component' echo "##vso[task.setvariable variable=ContinueJob]False" fi - displayName: 'Check changes' + displayName: "Check changes"