Install and Configure Docker App into KubeSail Platform - NETSEC

Latest

Learning, Sharing, Creating

Cybersecurity Memo

Monday, July 27, 2020

Install and Configure Docker App into KubeSail Platform

KubeSail is a cloud company which makes server software easier. For users, 1-click install server-software for free at home or in the cloud! For coders, KubeSail provides simple and fast tools to host apps anywhere. For sysadmins, KubeSail makes apps are consistent and easy to manage. In this post, I will show the steps how to create a simple docker based app using free resources provided by KubeSail.




Sign in KubeSail with Your GitHub Account



Here is how the dashboard looks like. There are two Apps hosted under my account:


Create a new Template



Edit Yaml:

I am using one of my APPs , WebSSH docker image, as an example:


Change Image Name (found from hub.docker.com's image repository )  and default container port number:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: new
  labels:
    app: webssh
spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  replicas: 1
  selector:
    matchLabels:
      app: webssh
  template:
    metadata:
      labels:
        app: webssh
    spec:
      containers:
        - name: api
          image: jakewalker/webssh
          imagePullPolicy: Always
          ports:
            - name: http-ports
              containerPort: 8888



Launch APP from Template and Configure Network

After edit YAML , you can launch this app from the template directly. You can check logs or directly connect to it:










Configure Cloudflare Workers 

Create a workers with following script:
addEventListener(
  "fetch",event => {
     let url=new URL(event.request.url);
     url.hostname="webssh.51sec.usw1.kubesail.org";
     let request=new Request(url,event.request);
     event. respondWith(
       fetch(request)
     )
  }
)
DNS A record for webssh. Value can be any valid ip such as 8.8.8.8. Once A record created, a workers route will route webssh.51sec.org url to your workers - webssh, which eventually will be redirected to destination webssh.51sec.usw1.kubesail.org. 




I tested two docker images: WebSSH and Ghost. Both worked well. Especially Ghost blog , it is running on http://ghost.51sec.org with admin page at http://ghost.51sec.org/ghost.


No comments:

Post a Comment