将 Kubernetes 用于区块链应用的挑战和解决方案

Kubernetes 轻易让用户缩放其应用所使用的资源,这非常适合概念验证和产品就绪的用途。区块链应用需要强大的计算性能和存储,并且在容器化的环境中运行时带来其自身的独特挑战。 在本次演讲中,Tong 将简要介绍区块链技术和 Hyperledger Fabric 技术,然后深入探讨如何在更多的 K8S 云提供商(如 IKS、GKE 和 AKS)上成功的部署和管理这些技术。在强调区块链对网络体系、存储和 CPU 资源带来的挑战之后,他将讨论自己为这些挑战开发的解决方案以及如何独立利用这些解决方案。最后谈及今后可能需要什么特性使得 K8S 对于这些计算密集型应用更为强大。
展开查看详情

1.Challenges and Solutions of Using Kubernetes for Blockchain Applications

2.Blockchain Technology Blockchain can do for business what the internet did for communication Every second of every day, businesses exchange value with suppliers, partners, customers and others. By value, we mean goods, services, money, data and more. Each exchange of value is a transaction. Successful transactions need to be fast, precise and easily agreed on by parties participating in the transaction. Blockchain for business provides a way to execute many more of these transactions — a much better way. -- ibm.com

3.What is unique about blockchain? • Decentralized, shared, tamper-evident ledger — once recorded, transactions cannot be altered • All parties must give consensus before a new transaction is added to the ledger

4.Differences of Chains • Transaction visibility • Public/Open • Private/Permissioned • Consensus methods • PoW (Work) • PoS (Stake) • PoET (Elapsed Time by intel) • PoA (Authority)

5.Hyperledger Fabric • One of the 10 Hyperledger projects • Open source • Permission based • Consortium • Consensus (PoA like) • Orderering service • Components are containerized & available on Docker Hub • Repo https://github.com/hyperledger/fabric • To try, use Fabric Cello, Ansible Agent

6.Why use K8S for fabric • Fabric was designed & developed to run in a container environment from very beginning • Fabric network is decentralized like any other blockchain networks, you can stand up your own nodes anywhere in the world, then join the network with permission • Start up small, then scale up or down when you want to for the resources such as CPU, Memory and storage.

7.Challenges & Solutions - 1 Getting a k8s cluster from different vendors differ

8.Challenges & Solutions - 2 Getting the kubeconfig file is where things really going dramatically different. • Download link • Vendor specific client tool instead of kubectl • Manual copy/paste

9.Challenges & Solutions - 3 Persistent volume capabilities Access Modes: ReadWriteOnce ReadOnlyMany ReadWriteMany Setup your own Persistent Class for your own app

10.Challenges & Solutions - 4 Finding Pods using their names - DNS search and communication Solution: Use service

11.Challenges & Solutions - 5 K8S Dashboard access, from easy to somewhat so weird approaches, Link after provision Proxy No user interface, all command line

12.Challenges & Solutions - 6 Docker issues • Docker in docker issue • Container side-by-side requirement from app using daemon set to create dind container for endpoint.

13.Challenges & Solutions - 7 Application deployment • Sequence control • For an application, there can be many services, how the services depend on each other, what is the start up sequence, in many applications, it is quite important Solution: Use deployment tools such as Ansible or InitContainer (may not work in some cases)

14.Good news K8S conformance program • Not only from API perspective, but also from usability perspective

15.Q&A Thanks

16.