<commit_before>## Singular

Singular design for deploy and operation ContainerOps platform, mostly focus on Kubernetes, Prometheus, others in the Cloud Native technology stack. We are trying to build all stack cross cloud, OpenStack, bare metals.

Singular don't use any other deploy tools like _kubeadm_, deploy everything in a hard way instead. Singular providers templates for service so could deploy any version. Singular deploys development versions of **Kubernetes**, **CoreDNS**, others in **CNCF** CI demo.

### Deployment Template

Singular uses a **YAML** file as deploy template, it describes the architecture of the cluster. It don't only deploy ContainerOps modules, also use to deploy Kubernetes, others in Cloud Native stack and some common software.

#### SSH Key

When deploy infrastructures, **Singular** need to _SSH_ to virtual machine or bare metal.

1. At least provide SSH private key, **Singular** will create public key from it. Generate ssh key follow Github document - [How to generate SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
2. If no SSH key files in deployment template, **Singular** will create _SSH_ pair key files in default folder(**_$HOME/.containerops/ssh_**) and name(**_id_rsa.pub_** and **_id_rsa_**).

#### Template Samples

```YAML
uri: containerops/demo-for-cncf-ci/deploy-cncf-stack
title: Demo For Deploy Cloud Native Computing Foundation CI Working Group
version: 4
tag: latest
nodes: 3
service:
  provider: digitalocean
  token: <KEY>
  region: sfo2
  size: 4gb
  image: ubuntu-17-04-x64
tools:
  ssh:
    private: $HOME/.containerops/ssh/id_rsa
    public: $HOME/.containerops/ssh/id_rsa.pub
infras:
  -
    name: etcd
    version: 3.2.2
    nodes:
      master: 3
      node: 0
    components:
      -
        binary: etcd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/etcd/3.2.2
        package: false
        systemd: etcd-3.2.2
        ca: etcd-3.2.2
      -
        binary: etcdctl
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/etcdctl/3.2.2
        package: false
  -
    name: flannel
    version: 0.7.1
    nodes:
      master: 3
      node: 0
    dependencies:
      - etcd
    components:
      -
        binary: flanneld
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/flanneld/0.7.1
        package: false
        systemd: flannel-0.7.1
        ca: flannel-0.7.1
        before: "etcdctl --endpoints={{.EtcdEndpoints}} --ca-file={{.CAPemFile}} --cert-file={{.FlanneldPemFile}} --key-file={{.FlanneldKeyFile}} set /kubernetes/network/config '{\"Network\":\"'172.30.0.0/16'\", \"SubnetLen\": 24, \"Backend\": {\"Type\": \"vxlan\"}}'"
      -
        binary: mk-docker-opts.sh
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/mk-docker-opts.sh/0.7.1
        package: false
  -
    name: docker
    version: 1.7.04.0-ce
    nodes:
      master: 3
      node: 0
    dependencies:
      - flannel
    components:
      -
        binary: docker
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker/17.04.0-ce
        package: false
        systemd: docker-1.7.04.0-ce
        before: "apt update && apt dist-upgrade && apt install -y bridge-utils aufs-tools cgroupfs-mount libltdl7 && systemctl stop ufw && systemctl disable ufw && iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat"
        after: "iptables -P FORWARD ACCEPT"
      -
        binary: dockerd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/dockerd/17.04.0-ce
        package: false
      -
        binary: docker-init
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-init/17.04.0-ce
        package: false
      -
        binary: docker-proxy
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-proxy/17.04.0-ce
        package: false
      -
        binary: docker-runc
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-runc/17.04.0-ce
        package: false
      -
        binary: docker-containerd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd/17.04.0-ce
        package: false
      -
        binary: docker-containerd-ctr
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd-ctr/17.04.0-ce
        package: false
      -
        binary: docker-containerd-shim
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd-shim/17.04.0-ce
        package: false
  -
    name: kubernetes
    version: 1.6.7
    nodes:
      master: 1
      node: 3
    dependencies:
      - etcd
      - flannel
      - docker
    components:
      -
        binary: kube-apiserver
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-apiserver/1.6.7
        package: false
        systemd: kube-apiserver-1.6.7
        ca: kubernetes-1.6.7
      -
        binary: kube-controller-manager
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-controller-manager/1.6.7
        package: false
        systemd: kube-controller-manager-1.6.7
        ca: kubernetes-1.6.7
      -
        binary: kube-scheduler
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-scheduler/1.6.7
        package: false
        systemd: kube-scheduler-1.6.7
      -
        binary: kubectl
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kubectl/1.6.7
        package: false
      -
        binary: kubelet
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kubelet/1.6.7
        package: false
        systemd: kubelet-1.6.7
      -
        binary: kube-proxy
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-proxy/1.6.7
        package: false
        systemd: kube-proxy-1.6.7
        ca: kube-proxy-1.6.7
```<commit_msg>Update deploy template in Singular README.<commit_after>## Singular

Singular design for deploy and operation ContainerOps platform, mostly focus on Kubernetes, Prometheus, others in the Cloud Native technology stack. We are trying to build all stack cross cloud, OpenStack, bare metals.

Singular don't use any other deploy tools like _kubeadm_, deploy everything in a hard way instead. Singular providers templates for service so could deploy any version. Singular deploys development versions of **Kubernetes**, **CoreDNS**, others in **CNCF** CI demo.

### Deployment Template

Singular uses a **YAML** file as deploy template, it describes the architecture of the cluster. It don't only deploy ContainerOps modules, also use to deploy Kubernetes, others in Cloud Native stack and some common software.

#### SSH Key

When deploy infrastructures, **Singular** need to _SSH_ to virtual machine or bare metal.

1. At least provide SSH private key, **Singular** will create public key from it. Generate ssh key follow Github document - [How to generate SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
2. If no SSH key files in deployment template, **Singular** will create _SSH_ pair key files in default folder(**_$HOME/.containerops/ssh_**) and name(**_id_rsa.pub_** and **_id_rsa_**).

#### Template Samples

##### Create Nodes In DigitalOcean And Deploy Kuberentes Cluster

```YAML
uri: containerops/demo-for-cncf-ci/deploy-cncf-stack
title: Demo For Deploy Cloud Native Computing Foundation CI Working Group
version: 4
tag: latest
service:
  provider: digitalocean
  token: <KEY>
  region: sfo2
  size: 4gb
  image: ubuntu-17-04-x64
tools:
  ssh:
    private: $HOME/.containerops/ssh/id_rsa
    public: $HOME/.containerops/ssh/id_rsa.pub
infras:
  -
    name: etcd
    version: 3.2.2
    nodes:
      master: 3
      node: 0
    components:
      -
        binary: etcd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/etcd/3.2.2
        package: false
        systemd: etcd-3.2.2
        ca: etcd-3.2.2
      -
        binary: etcdctl
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/etcdctl/3.2.2
        package: false
  -
    name: flannel
    version: 0.7.1
    nodes:
      master: 3
      node: 0
    dependencies:
      - etcd
    components:
      -
        binary: flanneld
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/flanneld/0.7.1
        package: false
        systemd: flannel-0.7.1
        ca: flannel-0.7.1
        before: "etcdctl --endpoints={{.EtcdEndpoints}} --ca-file={{.CAPemFile}} --cert-file={{.FlanneldPemFile}} --key-file={{.FlanneldKeyFile}} set /kubernetes/network/config '{\"Network\":\"'172.30.0.0/16'\", \"SubnetLen\": 24, \"Backend\": {\"Type\": \"vxlan\"}}'"
      -
        binary: mk-docker-opts.sh
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/mk-docker-opts.sh/0.7.1
        package: false
  -
    name: docker
    version: 1.7.04.0-ce
    nodes:
      master: 3
      node: 0
    dependencies:
      - flannel
    components:
      -
        binary: docker
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker/17.04.0-ce
        package: false
        systemd: docker-1.7.04.0-ce
        before: "apt update && apt dist-upgrade && apt install -y bridge-utils aufs-tools cgroupfs-mount libltdl7 && systemctl stop ufw && systemctl disable ufw && iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat"
        after: "iptables -P FORWARD ACCEPT"
      -
        binary: dockerd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/dockerd/17.04.0-ce
        package: false
      -
        binary: docker-init
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-init/17.04.0-ce
        package: false
      -
        binary: docker-proxy
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-proxy/17.04.0-ce
        package: false
      -
        binary: docker-runc
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-runc/17.04.0-ce
        package: false
      -
        binary: docker-containerd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd/17.04.0-ce
        package: false
      -
        binary: docker-containerd-ctr
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd-ctr/17.04.0-ce
        package: false
      -
        binary: docker-containerd-shim
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd-shim/17.04.0-ce
        package: false
  -
    name: kubernetes
    version: 1.6.7
    nodes:
      master: 1
      node: 3
    dependencies:
      - etcd
      - flannel
      - docker
    components:
      -
        binary: kube-apiserver
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-apiserver/1.6.7
        package: false
        systemd: kube-apiserver-1.6.7
        ca: kubernetes-1.6.7
      -
        binary: kube-controller-manager
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-controller-manager/1.6.7
        package: false
        systemd: kube-controller-manager-1.6.7
        ca: kubernetes-1.6.7
      -
        binary: kube-scheduler
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-scheduler/1.6.7
        package: false
        systemd: kube-scheduler-1.6.7
      -
        binary: kubectl
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kubectl/1.6.7
        package: false
      -
        binary: kubelet
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kubelet/1.6.7
        package: false
        systemd: kubelet-1.6.7
      -
        binary: kube-proxy
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-proxy/1.6.7
        package: false
        systemd: kube-proxy-1.6.7
        ca: kube-proxy-1.6.7
```

##### Using Bare Metals To Deploy Kubernetes Cluster

```
uri: containerops/demo-for-cncf-ci/deploy-cncf-stack
title: Demo For Deploy Cloud Native Computing Foundation CI Working Group
version: 4
tag: latest
nodes:
  -
    ip: 192.168.127.12
    user: root
  -
    ip: 172.16.17.32
    user: root
  -
    ip: 172.16.31.10
    user: root
tools:
  ssh:
    private: /home/meaglith/.ssh/id_rsa
    public: /home/meaglith/.ssh/id_rsa.pub
infras:
  -
    name: etcd
    version: etcd-3.2.2
    master: 3
    minion: 0
    components:
      -
        binary: etcd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/etcd/3.2.2
        package: false
        systemd: etcd-3.2.2
        ca: etcd-3.2.2
      -
        binary: etcdctl
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/etcdctl/3.2.2
        package: false
  -
    name: flannel
    version: flannel-0.7.1
    master: 3
    minion: 0
    dependencies:
      - etcd
    components:
      -
        binary: flanneld
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/flanneld/0.7.1
        package: false
        systemd: flannel-0.7.1
        ca: flannel-0.7.1
        before: "etcdctl --endpoints={{.Nodes}} --ca-file=/etc/kubernetes/ssl/ca.pem --cert-file=/etc/flanneld/ssl/flanneld.pem --key-file=/etc/flanneld/ssl/flanneld-key.pem set /kubernetes/network/config '{\"Network\":\"'172.30.0.0/16'\", \"SubnetLen\": 24, \"Backend\": {\"Type\": \"vxlan\"}}'"
      - 
        binary: mk-docker-opts.sh
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/mk-docker-opts.sh/0.7.1
        package: false
  -
    name: docker
    version: docker-17.04.0-ce
    master: 3
    minion: 0
    dependencies:
      - flannel
    components:
      -
        binary: docker
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker/17.04.0-ce
        package: false
        systemd: docker-17.04.0-ce
        before: "iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat"
        after: "iptables -P FORWARD ACCEPT"
      -
        binary: dockerd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/dockerd/17.04.0-ce
        package: false
      -
        binary: docker-init
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-init/17.04.0-ce
        package: false
      -
        binary: docker-proxy
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-proxy/17.04.0-ce
        package: false
      -
        binary: docker-runc
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-runc/17.04.0-ce
        package: false
      -
        binary: docker-containerd
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd/17.04.0-ce
        package: false
      -
        binary: docker-containerd-ctr
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd-ctr/17.04.0-ce
        package: false
      -
        binary: docker-containerd-shim
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/docker-containerd-shim/17.04.0-ce
        package: false
  -
    name: kubernetes
    version: kubernetes-1.6.7
    master: 1
    minion: 3
    dependencies:
      - etcd
      - flannel
      - docker
    components:
      -
        binary: kube-apiserver
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-apiserver/1.6.7
        package: false
        systemd: kube-apiserver-1.6.7
        ca: kubernetes-1.6.7
      -
        binary: kube-controller-manager
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-controller-manager/1.6.7
        package: false
        systemd: kube-controller-manager-1.6.7
        ca: kubernetes-1.6.7
      -
        binary: kube-scheduler
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-scheduler/1.6.7
        package: false
        systemd: kube-scheduler-1.6.7
      -
        binary: kubectl
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kubectl/1.6.7
        package: false
      -
        binary: kubelet
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kubelet/1.6.7
        package: false
        systemd: kubelet-1.6.7
      -
        binary: kube-proxy
        url: https://hub.opshub.sh/binary/v1/containerops/singular/binary/kube-proxy/1.6.7
        package: false
        systemd: kube-proxy-1.6.7
        ca: kube-proxy-1.6.7
```

##### Using Local Binary Files To Deploy Kubernetes Clusters
{'fraction_non_alphanumeric': 0.12740069187641656, 'fraction_numerical': 0.03226768459978528, 'mean_word_length': 2.225663716814159, 'pattern_counts': {'":': 12, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 56, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2712877', 'n_tokens_mistral': 6015, 'n_tokens_neox': 5685, 'n_words': 1159}