Skip to content

Commit 35b9612

Browse files
committed
latest updates including revised install instructions
1 parent 768ff31 commit 35b9612

File tree

7 files changed

+226
-51
lines changed

7 files changed

+226
-51
lines changed

content/install/install.md

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,64 @@ weight = 2
1212
You must create the scot4 user prior to cloning the repository.
1313

1414
```
15-
useradd -m -s /bin/bash -c "SCOT4 User" scot4
15+
$ sudo useradd -m -s /bin/bash -c "SCOT4 User" scot4
16+
```
17+
18+
Set the scot4 user's password
19+
20+
```
21+
$ sudo passwd scot4
22+
Changing password for user scot4.
23+
New password:
24+
Retype new password:
25+
passwd: all authentication tokens updated successfully.
26+
```
27+
28+
Add user to the proper group to allow sudo:
29+
30+
RHEL:
31+
```
32+
$ sudo usermod -aG wheel scot4
33+
```
34+
Ubuntu:
35+
```
36+
$ sudo usermod -aG sudo scot4
1637
```
1738

1839
### Clone Repository
1940

2041
Clone the SCOT 4 repository as the scot4 user.
2142

2243
```
23-
su - scot4
24-
git clone https://github.com/sandialabs/scot4.git
44+
$ su - scot4
45+
$ pwd
46+
/home/scot4
47+
$ git clone https://github.com/sandialabs/scot4.git
48+
```
49+
50+
### Optional, but recommended
51+
52+
If you are behind a web proxy, it is recommended that you set the following variables in the /etc/environment file. This is so sudo will pick up these variables during the install.
53+
54+
```
55+
http_proxy=http://your.proxy.here
56+
https_proxy=https://your.proxy.here
57+
no_proxy=localhost,yourservername,other,exceptions,list,here
58+
HTTP_PROXY=$http_proxy
59+
HTTPS_PROXY=$https_proxy
60+
NO_PROXY=$no_proxy
2561
```
2662

63+
If you do not wish to alter you environment file, the install script will prompt you for your proxy settings.
64+
2765
### Run Helper
2866

2967
The repository contains a helper script to automate most of the remaining tasks.
3068

3169
```
32-
su - scot4
33-
cd scot4
34-
./install.sh
70+
$ sudo su - scot4
71+
$ cd scot4
72+
$ sudo ./install.sh
3573
```
3674

3775
### install.sh options
@@ -47,12 +85,13 @@ Here are the options supported:
4785
database. You do not have to set this if you are using the
4886
default provided mysql database container.
4987
-e SURGE set the surge limit for the API server. (Kubernetes)
50-
-g pause script after displaying values of the script variables
5188
-h VERSION set the version of Helm to download and install. defaults to
52-
version 3.14.3
89+
version 3.19.0
5390
-i IPADDR set the IP address that the API server will listen to. Defaults to
5491
the first result of "ip -4 -o addr show scope global"
5592
-k TLS_KEY_FILE the fully qualified filename for your TLS KEY File
93+
-m TRAEFIKVERSION set the version of Traefik to download and install. defaults to
94+
version 3.3.6
5695
-n NO_PROXY the values to use for your NO_PROXY environment
5796
-P HTTPS_PROXY the value to use for HTTPS_PROXY
5897
-p HTTP_PROXY the value to use for HTTP_PROXY
@@ -81,7 +120,7 @@ Here are the options supported:
81120
Once the install program has completed, it will take a few minutes for the containers to download and spin up. You can monitor progress with the following command:
82121

83122
```
84-
watch kubectl -n scot4 get pods
123+
$ watch kubectl -n scot4 get pods
85124
```
86125

87126
You will see the pods go through various init stages. When the display looks like:
@@ -102,12 +141,23 @@ scot4-search-init-7llfw 0/1 Completed 0 20m
102141

103142
you can then end the watch program (ctrl-c) and begin to use SCOT.
104143

105-
### Should there be an Error
144+
### Should there be an installer error
145+
146+
We have seen on rare occasions that the install of k3s can experience a problem. When this occurs, you will most likely see this in the "testing k3s readiness" section of the installer. Try the following steps:
147+
148+
```
149+
$ sudo /usr/local/bin/k3s-uninstall.sh
150+
$ sudo rm -rf /etc/rancher/node
151+
$ sudo ./install.sh
152+
```
153+
154+
### Should there be a Pod Error
106155

107156
If a pod is displaying a backoff error condition, you can get more details about what is causing the problem by using the command:
108157

109158
```
110-
kubectl -n scot4 describe pod <pod-name-here>
159+
$ kubectl -n scot4 describe pod <pod-name-here>
111160
```
112161

113162
The most likely error would be some kind of failure to pull the container from the repository. Make sure you are not having a network issue and retry the install once network issue has been resolved.
163+

content/install/manual_install.md

Lines changed: 67 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,48 @@ Deployment of SCOT requires the existence of a scot4 user.
1616
sudo useradd -m -s /bin/bash -c "SCOT4 User" scot4
1717
```
1818

19+
### TLS Certificates
20+
21+
For deploying SCOT for testing purposes, you can use self signed certificates. If you are planning on using SCOT in production, you will need a valid certificate for the URL that you are planning on serving SCOT from.
22+
23+
To create self-signed certificate for testing:
24+
25+
```
26+
$ export KEYFILENAME="/home/test/.ssl/scot4.key"
27+
$ export CSRFILENAME="/home/test/.ssl/scot4.csr"
28+
$ export CRTFILENAME="/home/test/.ssl/scot4.crt"
29+
$ openssl genrsa -out $KEYFILENAME 2048
30+
$ openssl req -key $KEYFILENAME -new -out $CSRFILENAME
31+
$ openssl x509 -signkey $KEYFILENAME -in $CSRFILENAME -req -days 365 -out $CRTFILENAME
32+
```
33+
34+
Note: ensure that when prompted for the Common Name while generating the KEYFILE, that you enter the hostname for the server you are installing SCOT on.
35+
36+
### Disable Swap (as root)
37+
38+
Disabling swap is recommended for k3s.
39+
40+
```
41+
swapoff -a
42+
sed -i '/ swap / s/^/#/' /etc/fstab
43+
```
44+
45+
### SELinux
46+
47+
If you are running SELinux, which is default on RHEL like systems, you will need to put it into permissive mode. This can be accomplished by entering `setenforce 0`.
1948

2049
### Install K3s (as root)
2150

2251
K3s is the Kubernetes implementation we use. Here's how to install it.
2352

53+
Non-SELinux:
2454
```
2555
curl -sfLl https://get.k3s.io | INSTALL_K3S_EXEC="--prefer-bundled-bin --disable-cloud-controller" sh -
2656
```
57+
SELinux:
58+
```
59+
curl -sfLl https://get.k3s.io | INSTALL_K3S_EXEC="--prefer-bundled-bin --disable-cloud-controller --selinux" sh -
60+
```
2761
Go to [k3s](https://docs.k3s.io/installation) for detailed installation instructions.
2862

2963
Using a different implementation of Kubernetes is an exercise left to the reader.
@@ -33,7 +67,7 @@ Using a different implementation of Kubernetes is an exercise left to the reader
3367
The installer downloads a specific version of Helm. This is mainly because they don't have a *latest* alias on their downloads. The Helper then extracts the tar file and installs the helm executable into the /usr/local/bin directory.
3468

3569
```
36-
HELM_VERSION="v3.14.3"
70+
HELM_VERSION="v3.19.0"
3771
HELM_TAR="helm-$HELM_VERSION-linux-amd64.tar.gz"
3872
curl -sfl -o $HELM_TAR https://get.helm.sh/$HELM_TAR
3973
tar zxvf /tmp/$HELM_TAR -C /tmp
@@ -42,23 +76,6 @@ mv /tmp/linux-amd64/helm /usr/local/bin/helm
4276

4377
Addition Helm installation information can be found [here](https://helm.sh/docs/intro/install/)
4478

45-
### TLS Certificates
46-
47-
For deploying SCOT for testing purposes, you can use self signed certificates. If you
48-
are planning on using SCOT in production, you will need a valid certificate for the URL
49-
that you are planning on serving SCOT from.
50-
51-
To create self-signed certificate for testing:
52-
53-
```
54-
$ export KEYFILENAME="/home/test/.ssl/scot4.key"
55-
$ export CSRFILENAME="/home/test/.ssl/scot4.csr"
56-
$ export CRTFILENAME="/home/test/.ssl/scot4.crt"
57-
$ openssl genrsa -out $KEYFILENAME 2048
58-
$ openssl req -key $KEYFILENAME -new -out $CSRFILENAME
59-
$ openssl x509 -signkey $KEYFILENAME -in $CSRFILENAME -req -days 365 -out $CRTFILENAME
60-
```
61-
6279
### IP Address
6380

6481
You will need to know the IP address of your server. This command will help:
@@ -77,6 +94,7 @@ $ export NO_PROXY=localhost,127.0.0.1,.widget.com,172.16.,192.168.,*.local,.loca
7794

7895
where $IPADDR is the IP address you discovered in the previous step.
7996

97+
Go ahead and put those lines in your /etc/environment as well.
8098

8199
### Firewall Configuration (as root)
82100

@@ -100,6 +118,20 @@ ufw allow from 10.43.0.0/16 to any
100118

101119
*note*: a rule for port 6443 is not necessary for single node installs like SCOT.
102120

121+
### Ensure that PyYAML is not Ancient (as scot4)
122+
123+
The helper then makes sure the major version number of PyYAML is at least 5. If it is older, then pip is used to upgrade the module.
124+
125+
```
126+
PYYAMLVER=$(python3 -m pip freeze | grep -i pyyaml | awk -F== '{print $2}')
127+
PYYAMLMAJ=$(echo $PYYAMLVER | awk -F. '{print $1}')
128+
129+
if [ "$PYYAMLMAJ" -lt "5" ]; then
130+
echo "Upgrading PyYAML..."
131+
python3 -m pip install --upgrade PyYAML
132+
fi
133+
```
134+
103135
### Install Tab Completions (as scot4)
104136

105137
The following commands creates aliases and tab completions to make working on the command line easier.
@@ -113,34 +145,14 @@ echo "kubectl config set-context --current --namespace=scot4" >> /home/scot4/.ba
113145

114146
These are not absolutely necessary, but make administrating your Kubernetes system easier.
115147

116-
### Disable Swap (as root)
117-
118-
Disabling swap is recommended for k3s.
119-
120-
```
121-
swapoff -a
122-
sed -i '/ swap / s/^/#/' /etc/fstab
123-
```
124-
125148
### Create a scot4 namespace in Kubernetes
126149

127150
```
128151
su -c 'kubectl create ns scot4' scot4
129152
```
130153

131-
### Ensure that PyYAML is not Ancient (as scot4)
132-
133-
The helper then makes sure the major version number of PyYAML is at least 5. If it is older, then pip is used to upgrade the module.
134-
135-
```
136-
PYYAMLVER=$(python3 -m pip freeze | grep -i pyyaml | awk -F== '{print $2}')
137-
PYYAMLMAJ=$(echo $PYYAMLVER | awk -F. '{print $1}')
154+
If you receive an error creating this namespace, do not proceed until resolved.
138155

139-
if [ "$PYYAMLMAJ" -lt "5" ]; then
140-
echo "Upgrading PyYAML..."
141-
python3 -m pip install --upgrade PyYAML
142-
fi
143-
```
144156

145157
### Merge Secrets into Kubernetes (as scot4)
146158

@@ -153,6 +165,20 @@ kubectl -n scot4 apply -f scot4-chart/auto_gen_secrets.yaml
153165
kubectl -n scot4 apply -f scot4-chart/auto_gen_flair_secrets.yaml
154166
```
155167

168+
Again, do not proceed until any errors are resolved.
169+
170+
### Merge Repository Secrets
171+
172+
If you are using a custom repository, you will need to merge those secrets now. Users pulling from GitHub may skip this step.
173+
174+
```
175+
kubectl create secret docker-registry scot4-image-pull-secret \
176+
--docker-server $REPO_HOST \
177+
--docker-username $USER \
178+
--docker-password $PASS \
179+
--namespace $NS
180+
```
181+
156182
### Update values.yaml (as scot4)
157183

158184
Update the `scot4-chart/OS_values.yaml` file with information about your environment.
@@ -177,6 +203,8 @@ scot4.frontend.vueAppApiBase
177203
scot4.flair.frontendAccessibleURL
178204
: set to the same as scot4.api.externalApiUri
179205

206+
You may also look at the script, `./inst_func/inst_update_values.sh` for ways to update the OS_values.yaml.
207+
180208
### Run Helm to Deploy (as scot4)
181209

182210
If this is your first time installing, you will run the following command. *NOTE*: Running this command will delete all data in your scot4 database.

content/install/migration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description = "Bringing forward your SCOT3 data"
44
weight = 5
55
+++
66

7+
# NOTE: Migration process is being revamped. The process below is currently not working. Please contact the team if you need to migrate data from a SCOT3 instance.
8+
79
If you are upgrading from SCOT 3 and wish to bring forward your data to SCOT 4, these are the steps to take.
810

911
## Backup SCOT 3

content/install/requirements.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ Assuming that you select to use an external database, and either an external obj
2323
| 8 to 32 | 8 | 32 GB |
2424
| 32+ | 16 | 64 GB |
2525

26+
### Disk Partitioning
27+
If you partition your disk space, it is important to allocate a large /var partition because that is where all persistent storage will reside.
28+
29+
There are several factors that will impact how much disk space you will need. Primarily, disk usage is driven by the amount of data being input into SCOT. Also, configuring SCOT to use an external database server will greatly reduce your long term storage needs. Likewise, if you use S3 to store uploaded files, storage needs can be reduced.
30+
31+
In the table below, we characterize the minimum space needed based on usage patterns and assuming that you will collocate you database and file storage on this system. When in doubt, give /var as much space as you can afford.
32+
33+
| Usage | GB of Disk | Notes |
34+
| Proof of Concept | 128 | Little automated input of data, few users |
35+
| Light Activity | 256 | Automated feeds of 10 to 100 items a day, User input of 0 - 100 items a day |
36+
| Medium Activity | 512 | Automated feeds of 100-500 items a day, User input of 100 - 300 items a day |
37+
| Heavy Activity | 1TB | Automated feeds of 500+ items a day, User input 300+ items a day |
38+
39+
In the table above, automated items refer to Alertgroup and Dispatch items created and any other automated input of data you might do via API. User input is primary the creation of Entries.
40+
41+
Keep in mind, that your usage patterns may allow you to use less or require more space. If at possible, configure you system so that you may adjust the /var partition to meet your needs as they change with your usage. When planning also consider that SCOT does not do any data reduction, so usage will grow over time. In other words, data you input into SCOT will stay there unless you manually delete it.
42+
2643
## Kubernetes
2744

2845
We use [k3s](https://k3s.io) as our Kubernetes orchestrater, and [Helm](https://helm.sh) to define and manage the application.

0 commit comments

Comments
 (0)