-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from infracloudio/deploy_stack
Deploy tinkerbell stack in a single step
- Loading branch information
Showing
19 changed files
with
617 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM registry:2 | ||
ARG REGISTRY_USERNAME | ||
ARG REGISTRY_PASSWORD | ||
RUN mkdir -p /certs /auth | ||
RUN htpasswd -Bbn ${REGISTRY_USERNAME} ${REGISTRY_PASSWORD} > /auth/htpasswd | ||
EXPOSE 443 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,79 @@ | ||
# Setup the Provisioner machine with docker-compose.yml file | ||
|
||
## Install git and git lfs as follows | ||
|
||
1. ### Setup git and git lfs | ||
```shell | ||
$ sudo apt install -y git | ||
$ wget https://github.com/git-lfs/git-lfs/releases/download/v2.9.0/git-lfs-linux-amd64-v2.9.0.tar.gz | ||
$ tar -C /usr/local/bin -xzf git-lfs-linux-amd64-v2.9.0.tar.gz | ||
$ rm git-lfs-linux-amd64-v2.9.0.tar.gz | ||
$ git lfs install | ||
|
||
2. ### Setup go | ||
```shell | ||
$ wget https://dl.google.com/go/go1.13.9.linux-amd64.tar.gz | ||
$ tar -C /usr/local -xzf go1.13.9.linux-amd64.tar.gz go/ | ||
$ rm go1.12.13.linux-amd64.tar.gz | ||
3. ### Set GOPATH | ||
```shell | ||
$ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc | ||
$ echo 'export GOPATH=$GOPATH:$HOME/go' >> ~/.bashrc | ||
$ echo 'export PATH=$PATH:$GOPATH' >> ~/.bashrc | ||
$ source ~/.bashrc | ||
|
||
4. ### Install docker and docker-compose as follows: | ||
```shell | ||
$ curl -L get.docker.com | bash | ||
$ curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
$ chmod +x /usr/local/bin/docker-compose | ||
5. ### Clone the tink repo in the $GOPATH | ||
```shell | ||
$ mkdir -p ~/go/src/github.com/tinkerbell | ||
$ cd ~/go/src/github.com/tinkerbell | ||
$ git clone https://github.com/tinkerbell/tink.git | ||
$ cd tink | ||
|
||
6. ### Provide the input details in "inputenv" file | ||
|
||
7. ### Run the following command | ||
``` | ||
$ sudo ./setup_with_docker_compose.sh | ||
# Setup the Provisioner | ||
|
||
### Prerequisites | ||
- The setup must be executed as a privileged or root user. | ||
- The setup downloads about 1.5GB of assets, therefore, it is advised to have a minimum of 10GB disk space available before you begin. | ||
|
||
### Interactive Mode | ||
Execute the following commands to bring up the Tinkerbell stack with an interactive setup: | ||
```shell | ||
$ wget https://raw.githubusercontent.com/tinkerbell/tink/master/setup.sh && chmod +x setup.sh | ||
$ ./setup.sh | ||
``` | ||
|
||
### Declarative Mode | ||
You can also execute the setup in declarative mode. In order to do so, define the following environment variables (examples here): | ||
```shell | ||
export TB_INTERFACE=network-interface # enp1s0f1 | ||
export TB_NETWORK=network-with-cidr # 192.168.1.0/29 | ||
export TB_IPADDR=provisioner-ip-address # 192.168.1.1 | ||
export TB_REGUSER=registry-username # admin | ||
``` | ||
|
||
Now, you can execute the setup with the following command: | ||
```shell | ||
$ curl https://raw.githubusercontent.com/tinkerbell/tink/master/setup.sh | bash | ||
``` | ||
|
||
### Good to know | ||
- All the environment variables are kept in the `envrc` file, which is generated from the setup itself. | ||
- It is advised that you keep all the environment variables in the same file. | ||
- It is important to note that if you execute the setup the again, a new `envrc` will be generated. However, the existing environment configuration be saved as `envrc.bak`. | ||
- The setup removes all the `.tar.gz` files downloaded in process. | ||
|
||
# Setup the Provisioner | ||
|
||
### Prerequisites | ||
- The setup must be executed as a privileged or root user. | ||
- The setup downloads about 1.5GB of assets, therefore, it is advised to have a minimum of 10GB disk space available before you begin. | ||
|
||
### Interactive Mode | ||
Execute the following commands to bring up the Tinkerbell stack with an interactive setup: | ||
```shell | ||
$ wget https://raw.githubusercontent.com/tinkerbell/tink/master/setup.sh && chmod +x setup.sh | ||
$ ./setup.sh | ||
``` | ||
|
||
### Declarative Mode | ||
You can also execute the setup in declarative mode. In order to do so, define the following environment variables (examples here): | ||
```shell | ||
export TB_INTERFACE=network-interface # enp1s0f1 | ||
export TB_NETWORK=network-with-cidr # 192.168.1.0/29 | ||
export TB_IPADDR=provisioner-ip-address # 192.168.1.1 | ||
export TB_REGUSER=registry-username # admin | ||
``` | ||
|
||
Now, you can execute the setup with the following command: | ||
```shell | ||
$ curl https://raw.githubusercontent.com/tinkerbell/tink/master/setup.sh | bash | ||
``` | ||
|
||
### Good to know | ||
- All the environment variables are kept in the `envrc` file, which is generated from the setup itself. | ||
- It is advised that you keep all the environment variables in the same file. | ||
- It is important to note that if you execute the setup the again, a new `envrc` will be generated. However, the existing environment configuration be saved as `envrc.bak`. | ||
- The setup removes all the `.tar.gz` files downloaded in process. | ||
|
||
### For Packet Environment | ||
|
||
The script was tested with: | ||
- Server class: `c3.small.x86` | ||
- Operating System: Ubuntu 18.04 and CentOS 7 | ||
- Region: Amsterdam, NL (AMS1) | ||
- ENV variables: | ||
```shell | ||
export TB_INTERFACE=enp1s0f1 | ||
export TB_NETWORK=192.168.1.0/29 | ||
export TB_IPADDR=192.168.1.1 | ||
export TB_REGUSER=admin | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Network interface for Tinkerbell | ||
export TINKERBELL_NETWORK_INTERFACE=enp5s0f1 | ||
|
||
# Subnet (IP block) used by Tinkerbell ecosystem | ||
export TINKERBELL_NETWORK=192.168.1.0/29 | ||
|
||
# Host IP is used by provisioner to expose different services such as tink, boots, etc. | ||
export TINKERBELL_HOST_IP=192.168.1.1 | ||
|
||
# NGINX IP is used by provisioner to serve files required for iPXE boot | ||
export TINKERBELL_NGINX_IP=192.168.1.2 | ||
|
||
# Netmask for Tinkerbell network | ||
export TINKERBELL_NETMASK=255.255.255.248 | ||
|
||
# Broadcast IP for Tinkerbell network | ||
export TINKERBELL_BROADCAST_IP=192.168.1.7 | ||
|
||
# We host a private Docker registry on provisioner which is used by different workers | ||
# Registry username | ||
export TINKERBELL_REGISTRY_USERNAME=admin | ||
|
||
# Registry password | ||
export TINKERBELL_REGISTRY_PASSWORD=admin | ||
|
||
export FACILITY=onprem | ||
export ROLLBAR_TOKEN=ignored | ||
export ROLLBAR_DISABLE=1 |
Oops, something went wrong.