Skip to content

Commit 6c633c3

Browse files
authored
Merge pull request #6 from digitalkram/master
Added initial support for GCP
2 parents 5e01b82 + 7910a71 commit 6c633c3

File tree

3 files changed

+223
-43
lines changed

3 files changed

+223
-43
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Inside the test-vm's the salt directories are mapped to /srv/salt/*
2828
- internet connection (for things like package install)
2929
- In case of a vmware-vm as host, following settings are needed:
3030
![settings vmware-vm](images/vmware_setting.png)
31+
- In case you want to use "Google Cloud" as a provider backend you need:
32+
- An account and a project in GCP (with allocated budget)
33+
- The gcloud cli utility installed (`snap install google-cloud-sdk --classic`)
34+
- Some additional dependencies installed (`apt-get install -y nfs-kernel-server portmap autossh`)
35+
- Gcloud configured to use the correct account/project (core/account property): (`gcloud init`)
3136

3237
## 1.2. configuration
3338

@@ -41,8 +46,20 @@ used to deploy the ssh-pub-key to each launchend vm to `root` and to the normal
4146

4247
Further, in `samutev.conf` you can customize [cloudinit](https://cloudinit.readthedocs.io/en/latest/) to bootstrap the vms.
4348

49+
If you intend to use the GCP provider backend you also need to customize
50+
1. `my_ssh_pub_key=""`
51+
should be the public SSH key you want to use to connect to the instances
52+
2. `DEFAULT_GCP_ZONE` and `FALLBACK_GCP_MACH_TYPE`
53+
should not be modified unless you know what/why you are doing
4454

4555
## 1.3. usage
56+
### gcp
57+
See section `multipass` - only the default values displayed differ a little.
58+
To use provider `gcp` instead of the default (`multipass`) just prefix the script with `PROVIDER=gcp`:
59+
```
60+
PROVIDER=gcp ./samutev.sh -h
61+
```
62+
### multipass
4663
```
4764
Usage:
4865
./samutev.sh -h display this help message
@@ -89,18 +106,35 @@ Both directories will be available either to the salt master or to masterless mi
89106

90107
### 1.4.2. vm defaults
91108

109+
### multipass
92110
type | default
93111
-----|--------
94112
cpu | 2
95113
memory | 1 (GB)
96114
disk | 3 (GB)
97115

116+
### gcp
117+
Type: e2-micro
118+
119+
type | default
120+
-----|--------
121+
cpu | 2
122+
memory | 1 (GB)
123+
disk | 10 (GB)
124+
125+
98126
### 1.4.3. performance
99127
some meassured times, create 4 vm's, 1 salt-master and 3 minions:
100128
`samutev.sh -s "project-master project-app project-db project-web"`
101129

130+
#### multipass
102131
environment | time
103132
------------|------
104133
vm Testcluster (4GB RAM)| 10:49 min
105134
Lenovo x390 (16GB RAM)| 04:27 min
106135
Lenoveo P53 (32GB RAM)| 03:31 min
136+
137+
#### gcp
138+
environment | time
139+
------------|------
140+
not relevant| 05:38

samutev.conf.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
salt_base=""
22
my_ssh_pub_key=""
3-
3+
DEFAULT_GCP_ZONE="europe-west4-a"
4+
FALLBACK_GCP_MACH_TYPE="e2-micro"
45
# --------------------------------------------------
56
# --------------------------------------------------
67
CLOUDINIT_1_header="
@@ -58,6 +59,7 @@ package_upgrade: false
5859
CLOUDINIT_2_master="
5960
packages:
6061
- salt-master
62+
- nfs-common
6163

6264
write_files:
6365
- content: |
@@ -77,6 +79,7 @@ write_files:
7779
CLOUDINIT_2_masterless="
7880
packages:
7981
- salt-minion
82+
- nfs-common
8083

8184
write_files:
8285
- content: |

0 commit comments

Comments
 (0)