Skip to content

Commit cd40cbd

Browse files
committed
feat(workflow): add all-in-one install scripts
1 parent 708c8f2 commit cd40cbd

33 files changed

Lines changed: 231 additions & 1295 deletions

.drone/drone.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ steps:
88
privileged: true
99
commands:
1010
- make docker-build docker-build-docs
11+
- cp _scripts/* _build/html
1112
- cd _build/html && echo "www.drycc.cc" > CNAME && git init
1213
environment:
1314
SSH_DEPLOY_KEY:

_scripts/install.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail
3+
shopt -s expand_aliases
4+
5+
if [[ -z "${PLATFORM_DOMAIN}" ]] ; then
6+
echo -e "\\033[31m---> Please set the PLATFORM_DOMAIN variable.\\033[0m"
7+
echo -e "\\033[31m---> For example:\\033[0m"
8+
echo -e "\\033[31m---> export PLATFORM_DOMAIN=drycc.cc\\033[0m"
9+
echo -e "\\033[31m---> And confirm that wildcard domain name resolution has been set.\\033[0m"
10+
echo -e "\\033[31m---> For example, the current server IP is 8.8.8.8\\033[0m"
11+
echo -e "\\033[31m---> Please point *.drycc.cc to 8.8.8.8\\033[0m"
12+
exit 1
13+
fi
14+
15+
function clean_before_exit {
16+
# delay before exiting, so stdout/stderr flushes through the logging system
17+
rm -rf helm-broker
18+
sleep 3
19+
}
20+
trap clean_before_exit EXIT
21+
22+
if [[ "${INSTALL_K3S_MIRROR}"=="cn" ]] ; then
23+
k3s_install_url="http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh"
24+
else
25+
k3s_install_url="https://get.k3s.io"
26+
fi
27+
if [[ -z "${K3S_URL}" ]] ; then
28+
INSTALL_K3S_EXEC="server --no-flannel --cluster-cidr=10.233.0.0/16"
29+
else
30+
INSTALL_K3S_EXEC="agent --no-flannel"
31+
fi
32+
33+
export INSTALL_K3S_EXEC='--no-flannel'
34+
35+
alias install-k3s="curl -sfL "${k3s_install_url}" | sh - $@"
36+
37+
install-k3s
38+
39+
curl -sfL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -
40+
41+
helm repo add cilium https://helm.cilium.io/
42+
helm repo add longhorn https://charts.longhorn.io
43+
helm repo add jetstack https://charts.jetstack.io
44+
helm repo add svc-cat https://kubernetes-sigs.github.io/service-catalog
45+
helm repo add drycc https://charts.drycc.cc/${CHANNEL:-stable}
46+
helm repo update
47+
git clone --dept 1 https://github.com/kyma-project/helm-broker
48+
49+
50+
helm install cilium --set operator.replicas=1 cilium/cilium --namespace kube-system
51+
helm install longhorn --create-namespace --set persistence.defaultClassReplicaCount=1 longhorn/longhorn --namespace longhorn-system
52+
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true
53+
helm install catalog svc-cat/catalog --set asyncBindingOperationsEnabled=true --namespace catalog --create-namespace
54+
helm install helm-broker --set global.helm_broker.dir=/ --set global.helm_controller.dir=/ helm-broker/charts/helm-broker/ --namespace helm-broker --create-namespace
55+
56+
57+
echo -e "\\033[32m---> Waiting cert-manager...\\033[0m"
58+
while [ $(kubectl get pods -n cert-manager|grep Running|wc -l) -le 2 ]
59+
do
60+
kubectl get pods -n cert-manager
61+
sleep 10
62+
done
63+
64+
helm install drycc drycc/workflow \
65+
--set builder.service.type=LoadBalancer \
66+
--set global.platform_domain="${PLATFORM_DOMAIN}" \
67+
--set global.ingress_class=traefik \
68+
--set fluentd.daemon_environment.CONTAINER_TAIL_PARSER_TYPE="/^(?<time>.+) (?<stream>stdout|stderr)( (?<tags>.))? (?<log>.*)$/" \
69+
--set controller.app_storage_class=longhorn \
70+
--set minio.persistence.enabled=true \
71+
--set minio.persistence.size=50Gi \
72+
--set minio.persistence.storageClass="longhorn" \
73+
--set rabbitmq.persistence.enabled=true \
74+
--set rabbitmq.persistence.size=5Gi \
75+
--set rabbitmq.persistence.storageClass="longhorn" \
76+
--set influxdb.persistence.enabled=true \
77+
--set influxdb.persistence.size=20Gi \
78+
--set influxdb.persistence.storageClass="longhorn" \
79+
--set monitor.grafana.persistence.enabled=true \
80+
--set monitor.grafana.persistence.size=20Gi \
81+
--set monitor.grafana.persistence.storageClass="longhorn" \
82+
--namespace drycc \
83+
--create-namespace

_scripts/uninstall.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail
3+
shopt -s expand_aliases
4+
5+
/usr/local/bin/k3s-killall.sh
6+
/usr/local/bin/k3s-uninstall.sh

mkdocs.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,14 @@ nav:
88
- Home: index.md
99
- Quick Start:
1010
- Overview: quickstart/index.md
11+
- Install Workflow: quickstart/install-workflow.md
1112
- Install CLI Tools: quickstart/install-cli-tools.md
12-
- AWS:
13-
- Boot: quickstart/provider/aws/boot.md
14-
- DNS: quickstart/provider/aws/dns.md
15-
- Install Workflow: quickstart/provider/aws/install-aws.md
16-
- Azure:
17-
- Boot: quickstart/provider/azure-acs/boot.md
18-
- DNS: quickstart/provider/azure-acs/dns.md
19-
- Install Workflow: quickstart/provider/azure-acs/install-azure-acs.md
20-
- GKE:
21-
- Boot: quickstart/provider/gke/boot.md
22-
- DNS: quickstart/provider/gke/dns.md
23-
- Install Workflow: quickstart/provider/gke/install-gke.md
24-
- Minikube:
25-
- Boot: quickstart/provider/minikube/boot.md
26-
- DNS: quickstart/provider/minikube/dns.md
27-
- Install Workflow: quickstart/provider/minikube/install-minikube.md
2813
- Deploy Your First App: quickstart/deploy-an-app.md
2914
- Understanding Workflow:
3015
- Concepts: understanding-workflow/concepts.md
3116
- Architecture: understanding-workflow/architecture.md
3217
- Components: understanding-workflow/components.md
33-
- Installing Workflow:
18+
- Installing To Kubenetes:
3419
- System Requirements: installing-workflow/system-requirements.md
3520
- Installing Ingress: installing-workflow/ingress.md
3621
- Installing Workflow: installing-workflow/index.md

src/quickstart/index.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,13 @@ Get started with Drycc Workflow in three easy steps.
88

99
This guide will help you set up a cluster suitable for evaluation, development and testing. When you are ready for staging and production, view our [production checklist](../managing-workflow/production-deployments.md).
1010

11-
## Step 1: Install CLI tools
11+
## Step 1: Install Workflow
1212

13-
For the quickstart we will [install both Helm and Drycc Workflow CLI](install-cli-tools.md).
13+
For the quickstart we will [install Drycc Workflow](install-workflow.md).
1414

15-
## Step 2: Boot Kubernetes and Install Drycc Workflow
15+
## Step 2: Install CLI tools
1616

17-
There are many ways to boot and run Kubernetes. You may choose to get up and running in cloud environments or locally on
18-
your laptop.
19-
20-
Cloud-based options:
21-
22-
* [Google Container Engine](provider/gke/boot.md): provides a managed Kubernetes environment, available with a few clicks.
23-
* [Amazon Web Services](provider/aws/boot.md): uses Kubernetes upstream `kube-up.sh` to boot a cluster on AWS EC2.
24-
* [Azure Container Service](provider/azure-acs/boot.md): uses Azure Container Service to provision Kubernetes and install Workflow.
25-
26-
If you would like to test on your local machine follow, our guide for [Minikube](provider/minikube/boot.md).
27-
28-
If you have already created a Kubernetes cluster, check out the [system requirements](../installing-workflow/system-requirements.md) and then proceed to [install Drycc Workflow on your own Kubernetes cluster](../installing-workflow/index.md).
17+
For the quickstart we will [install Drycc Workflow CLI](install-cli-tools.md).
2918

3019
## Step 3: Deploy your first app
3120

src/quickstart/install-cli-tools.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,3 @@ Check your work by running `drycc version`:
2525

2626
!!! note
2727
Note that version numbers may vary as new releases become available
28-
29-
## Helm Installation
30-
31-
We will install Drycc Workflow using Helm which is a tool for installing and managing software in a
32-
Kubernetes cluster.
33-
34-
Install the latest `helm` cli for Linux or Mac OS X by following the
35-
[installation instructions][helm-install].
36-
37-
## Step 2: Boot a Kubernetes Cluster and Install Drycc Workflow
38-
39-
There are many ways to boot and run Kubernetes. You may choose to get up and running in cloud environments or locally on your laptop.
40-
41-
Cloud-based options:
42-
43-
* [Google Container Engine](provider/gke/boot.md): provides a managed Kubernetes environment, available with a few clicks.
44-
* [Amazon Web Services](provider/aws/boot.md): uses Kubernetes upstream [kops](https://github.com/kubernetes/kops) to boot a cluster on AWS EC2.
45-
* [Azure Container Service](provider/azure-acs/boot.md): provides a managed Kubernetes environment.
46-
47-
If you would like to test on your local machine follow our guide for [Minikube](provider/minikube/boot.md).
48-
49-
50-
[helm-install]: https://github.com/kubernetes/helm#install

src/quickstart/install-workflow.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Install Workflow
2+
3+
If you have a pure host, it can be a cloud server, bare metal server, virtual machine, or even your laptop. Then this chapter is very suitable for you.
4+
5+
## Operating Systems
6+
7+
Drycc is expected to work on most modern Linux systems. Some OSS have specific requirements:
8+
9+
* (Red Hat/CentOS) Enterprise Linux, they usually use RPM package management.
10+
* Ubuntu (Desktop/Server/Cloud) Linux, a very popular distribution.
11+
* Debian GNU Linux, a very pure distribution of opensource software.
12+
13+
If you want to add more Linux distribution support, please submit a issue on github or submit PR directly.
14+
15+
## System Software
16+
17+
Some basic software needs to be installed before installing drycc workflow.
18+
19+
### Installing open-iscsi
20+
21+
The command used to install open-iscsi differs depending on the Linux distribution.
22+
We recommend using Ubuntu as the guest OS image since it contains open-iscsi already.
23+
You may need to edit the cluster security group to allow SSH access.
24+
For SUSE and openSUSE, use this command:
25+
26+
```
27+
$ zypper install open-iscsi
28+
```
29+
30+
For Debian and Ubuntu, use this command:
31+
32+
```
33+
$ apt-get install open-iscsi
34+
```
35+
36+
For RHEL, CentOS, and EKS with EKS Kubernetes Worker AMI with AmazonLinux2 image, use this command:
37+
38+
```
39+
$ yum install iscsi-initiator-utils
40+
```
41+
42+
### Installing NFSv4 client
43+
44+
The command used to install a NFSv4 client differs depending on the Linux distribution.
45+
46+
For Debian and Ubuntu, use this command:
47+
48+
```
49+
$ apt-get install nfs-common
50+
```
51+
52+
For RHEL, CentOS, and EKS with EKS Kubernetes Worker AMI with AmazonLinux2 image, use this command:
53+
54+
```
55+
$ yum install nfs-utils
56+
```
57+
58+
### Installing curl and git
59+
60+
For Debian and Ubuntu, use this command:
61+
62+
```
63+
$ apt-get install curl git
64+
```
65+
66+
For RHEL, CentOS, and EKS with EKS Kubernetes Worker AMI with AmazonLinux2 image, use this command:
67+
68+
```
69+
$ yum install curl git
70+
```
71+
72+
## Hardware
73+
74+
Hardware requirements scale based on the size of your deployments. Minimum recommendations are outlined here.
75+
76+
* RAM: 1G Minimum (we recommend at least 2GB)
77+
* CPU: 1 Minimum
78+
79+
This configuration only contains the minimum requirements that can meet the operation.
80+
81+
## Disk
82+
83+
Drycc performance depends on the performance of the database. To ensure optimal speed, we recommend using an SSD when possible. Disk performance will vary on ARM devices utilizing an SD card or eMMC.
84+
85+
## Domain Name
86+
87+
Drycc needs a root domain name under your full control and points this domain name to the server to be installed.
88+
Suppose there is a wildcard domain pointing to the current server to install drycc, which is the name `*.dryccdoman.com`.
89+
We need to set the `PLATFORM_DOMAIN` environment variables before installation.
90+
91+
```
92+
$ export PLATFORM_DOMAIN=dryccdoman.co
93+
```
94+
95+
Of course, if it is a test environment, we can also use `nip.io`, an IP to domain name service.
96+
For example, your host IP is `59.46.3.190`, we will get the following domain name `59.46.3.190.nip.io`
97+
98+
```
99+
$ export PLATFORM_DOMAIN=59.46.3.190.nip.io
100+
```
101+
102+
## Install
103+
104+
You can use the installation script available at https://www.drycc.cc/install.sh to install drycc as a service on systemd and openrc based systems.
105+
106+
```
107+
$ curl -sfL https://www.drycc.cc/install.sh | bash -
108+
```
109+
110+
!!! important
111+
Users in Chinese mainland can use the following methods to speed up installation:
112+
113+
```
114+
$ curl -sfL https://www.drycc.cc/install.sh | INSTALL_K3S_MIRROR=cn bash -
115+
```
116+
117+
### Install Options
118+
119+
When using this method to install drycc, the following environment variables can be used to configure the installation:
120+
121+
ENVIRONMENT VARIABLE | DESCRIPTION
122+
--------------------------------|------------------------------------------------------------------------------------------------
123+
PLATFORM_DOMAIN | Required item, specify drycc's domain name
124+
CHANNEL | By default, drycc of the `stable` channel will be installed. You can also specify `testing`
125+
INSTALL_K3S_MIRROR | Specify the accelerated mirror location. Currently, only `cn` is supported
126+
127+
Since the installation script will install k3s, other environment variables can refer to k3s installation [environment variables](https://rancher.com/docs/k3s/latest/en/installation/install-options/).
128+
129+
## Uninstall
130+
131+
If you installed drycc using an installation script, you can uninstall the entire drycc using this script.
132+
133+
```
134+
$ curl -sfL https://www.drycc.cc/uninstall.sh | bash -
135+
```

0 commit comments

Comments
 (0)