From 3d8180a621a671a0b9984777371d6f114a39b83c Mon Sep 17 00:00:00 2001 From: richie Date: Wed, 18 Dec 2019 16:44:51 +0800 Subject: [PATCH] no message --- README.md | 7 ++----- docker-compose.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 docker-compose.yaml diff --git a/README.md b/README.md index 2b2acb4..c423e72 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,10 @@ # make docker ``` -- push 镜像: - ```bash - docker-compose push k8s-webshell - ``` - ### 部署方式有2种: - kubernetes 部署(k8s 集群内 incluster 模式)到集群当中 + - docker-compose 部署(k8s集群外部署) ### kubernetes 部署 k8s-webshell @@ -35,6 +31,7 @@ ```bash # kubectl apply -f k8s-webshell-sa.yaml # kubectl apply -f k8s-webshell-clusterrole.yaml +# kubectl apply -f k8s-webshell-secret.yaml # kubectl apply -f k8s-webshell-clusterrolebinding.yaml # kubectl apply -f k8s-webshell-deployment.yaml # kubectl apply -f k8s-webshell-svc.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c31521b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,26 @@ +version: "3" +services: + k8s-webshell: + build: + context: . + image: k8s-webshell:1.3 + command: ["./k8s-webshell", "--config", "/etc/k8s-webshell/config.yaml"] + + ports: + - "30001:777" + environment: + - WEBSHELL_SERVER_RUN_MODE=debug + - WEBSHELL_SERVER_LOGPATH=/var/logs + - WEBSHELL_SERVER_PORT=7777 + - WEBSHELL_SERVER_LOGNAME=webshell.log + - WEBSHELL_K8S_KUBECONFIG=/etc/k8s-webshell/admin.conf + - WEBSHELL_SERVER_CERTIFICATE=/etc/k8s-webshell/webshell.crt + - WEBSHELL_SERVER_CERTIFICATEKEY=/etc/k8s-webshell/webshell.key + - WEBSHELL_K8S_INCLUSTER=false + volumes: + - "./configs/config.yaml:/etc/k8s-webshell/config.yaml" + - "./configs/admin.conf:/etc/k8s-webshell/admin.conf" + - "./configs/webshell.crt:/etc/k8s-webshell/webshell.crt" + - "./configs/webshell.key:/etc/k8s-webshell/webshell.key" + +