Posts with the tag docker:
A python example of realizing secure grpc communication Useful links and references: Here are some links that I found it can be helpful when I was trying to work out how to setup the python ssl communication.
Secure gRPC with TLS/SSL, This is golang implementation
certstrap, a convienient tool to generate openssl keys and certificate
gRPC authentication, the official guide of grpc
grpcio, python package, the source code and official document of grpc python
grpc golang ssl example, another golang example of ssl communication
What is the difference between .pem , .csr , .key and .crt?, a stackexchange question which explains the concepts and differences of different types of files
First, build a docker container that contains all required packages. In this example, I choose ubuntu:bionic as the basic image, and I installed other packages onto it.
FROM ubuntu:bionic RUN apt-get update RUN apt-get install python3 -y RUN apt-get install python3-pip -y RUN pip3 install grpcio ADD app /app/ EXPOSE 22222 The Dockerfile is shown above. In the app file, it contains 4 files. They are:
client.py, server.py, test_pb2.py, test_pb2_grpc.py
test_pb2.py and test_pb2_grpc.py is generated by compiling the test.protofile. The content for test.proto is shown below.
syntax = "proto3"; package lmjwtest; // service, encode a plain text service EncodeService { // request a service of encode rpc GetEncode(plaintext) returns (encodetext) {} } message plaintext { string pttransactionID = 1; string ptproperties = 2; string ptsenderID = 3; } message encodetext { string enctransactionID = 1; string encproperties = 2; string encsenderID = 3; } By using the grpcio-tools to compile the test.
#Some concepts of Kubernetes Clusters
Kubernetes cluster(KC) can be analogy to the conventional computational cluster, which includes many computers and to work as a single unit.
application runs on the KC needs to be containerized.
the program organizing the KC, namely Kubernete, manage the deployment and make containerized application run in KC in a more efficient way.
Kubernetes cluster structure Master ( act as a manager): coordinate the cluster Nodes (act as worker, the job of work is to run the containerize application) Master responsibilities : coordinate activities in cluster scheduling application maintaining application states scaling application rolling new updates Node(worker) definition of Node: A node can be a VM or a physical computer that serves as a worker machine in a KC.
Description:
Using golang to execute python code, which can in turn execute docker command to control docker container.