Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer/pkg/config: Support loading InstallConfig YAML #236

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pkg_tar(
name = "tectonic-%s" % TECTONIC_VERSION,
srcs = [
"//:template_resources",
"//examples:tectonic_cli_examples",
"//examples:config_examples",
],
extension = "tar.gz",
mode = "0666",
Expand Down
10 changes: 5 additions & 5 deletions Documentation/dev/libvirt-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ iptables -I INPUT -p tcp -s 192.168.124.0/24 -d 192.168.124.1 --dport 16509 \
```

#### 1.7 Prepare the configuration file
1. `cp examples/tectonic.libvirt.yaml ./`
1. `cp examples/libvirt.yaml ./`
1. Edit the configuration file:
1. Set an email and password in the `admin` section
1. Set a `baseDomain` (to `tt.testing`)
1. Set the `sshKey` in the `admin` section to the **contents** of an ssh key (e.g. `ssh-rsa AAAA...`)
1. Set the `imagePath` to the **absolute** path of the operating system image you downloaded
1. Set the `name` (e.g. test1)
1. Set a `baseDomain` (to `tt.testing`)
1. Set the `imagePath` entries to the **absolute** path of the operating system image you downloaded
1. Set the `name` (e.g. `test1`)
1. Look at the `podCIDR` and `serviceCIDR` fields in the `networking` section. Make sure they don't conflict with anything important.
1. Set the `pullSecret` to your JSON pull secret.

Expand Down Expand Up @@ -132,7 +132,7 @@ alias tectonic="${PWD}/tectonic-dev/installer/tectonic"

Initialize (the environment variables are a convenience):
```sh
tectonic init --config=../tectonic.libvirt.yaml
tectonic init --config=../libvirt.yaml
export CLUSTER_NAME=<the cluster name>
export BASE_DOMAIN=<the base domain>
```
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ These instructions can be used for AWS:

5. Edit Tectonic configuration file including the $CLUSTER_NAME
```sh
$EDITOR examples/tectonic.aws.yaml
$EDITOR examples/aws.yaml
```

6. Prepare a local configuration.
The structure behind the YAML input is described [here][godoc-InstallConfig].
```sh
tectonic init --config=examples/tectonic.aws.yaml
tectonic init --config=examples/aws.yaml
```

7. Install Tectonic cluster
Expand All @@ -51,7 +51,7 @@ These instructions can be used for AWS:

8. Visit `https://{$CLUSTER_NAME}-api.${BASE_DOMAIN}:6443/console/`.
You may need to ignore a certificate warning if you did not configure a CA known to your browser.
Log in with the admin credentials you configured in `tectonic.aws.yaml`.
Log in with the admin credentials you configured in `aws.yaml`.

9. Teardown Tectonic cluster
```sh
Expand Down
8 changes: 4 additions & 4 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
example_cli_configs = glob(["tectonic.*.yaml"])
config_examples = glob(["*.yaml"])

filegroup(
name = "tectonic_cli_examples",
srcs = example_cli_configs,
name = "config_examples",
srcs = config_examples,
visibility = ["//visibility:public"],
)

exports_files(example_cli_configs)
exports_files(config_examples)
83 changes: 83 additions & 0 deletions examples/aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
metadata:

# The name of the cluster.
# If used in a cloud-environment, this will be prepended to `baseDomain` to construct a domain for the OpenShift console.
#
# Note: This field MUST be set manually prior to creating the cluster.
# Warning: Special characters in the name like '.' may cause errors on OpenStack platforms due to resource name constraints.
name:

# (optional) A cluster ID for this cluster.
# This defaults to a random ID.
clusterID:

admin:
email: a@b.c
password: verysecure
sshKey: "ssh-ed25519 AAAA..."

# The base DNS domain of the cluster. It must NOT contain a trailing period. Some
# DNS providers will automatically add this if necessary.
#
# Example: `openshift.example.com`.
#
# Note: This field MUST be set manually prior to creating the cluster.
baseDomain:

networking:
# This declares the IP range to assign Kubernetes pod IPs in CIDR notation.
podCIDR: 10.2.0.0/16

# This declares the IP range to assign Kubernetes service cluster IPs in CIDR notation.
# The maximum size of this IP range is /12
serviceCIDR: 10.3.0.0/16

# (optional) Configures the network to be used in the cluster. One of the following values can be used:
#
# - "flannel": enables overlay networking only. This is implemented by flannel using VXLAN.
#
# - "canal": enables overlay networking including network policy. Overlay is implemented by flannel using VXLAN. Network policy is implemented by Calico.
#
# - "calico-ipip": [ALPHA] enables BGP based networking. Routing and network policy is implemented by Calico. Note this has been tested on baremetal installations only.
#
# - "none": disables the installation of any Pod level networking layer. By setting this value, users are expected to deploy their own solution to enable network connectivity for Pods and Services.
# type: flannel

machines:
- name: master
replicas: 1

- name: worker
replicas: 3

platform:
aws:
# The target AWS region for the cluster.
region: us-east-1

# (optional) Additional tags for AWS resources created for the cluster.
#
# Example: {"key": "value", "foo": "bar"}
# userTags:

# (optional) ID of an existing VPC to launch nodes into.
# If unset a new VPC is created.
#
# Example: `vpc-123456`
# vpcID:

# Block of IP addresses used by the VPC.
# This should not overlap with any other networks, such as a private datacenter connected via Direct Connect.
vpcCIDRBlock: 10.0.0.0/16

# The pull secret in JSON format.
# This is known to be a "Docker pull secret" as produced by the docker login [1] command.
# A sample JSON content is shown in [2].
# You can download the pull secret from your Account overview page at [3].
#
# [1] https://docs.docker.com/engine/reference/commandline/login/
#
# [2] https://coreos.com/os/docs/latest/registry-authentication.html#manual-registry-auth-setup
#
# [3] https://account.coreos.com/overview
pullSecret: '{"auths": {}}'
81 changes: 81 additions & 0 deletions examples/libvirt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
metadata:

# The name of the cluster.
# If used in a cloud-environment, this will be prepended to `baseDomain` to construct a domain for the OpenShift console.
#
# Note: This field MUST be set manually prior to creating the cluster.
# Warning: Special characters in the name like '.' may cause errors on OpenStack platforms due to resource name constraints.
name:

# (optional) A cluster ID for this cluster.
# This defaults to a random ID.
clusterID:

admin:
email: a@b.c
password: verysecure
sshKey: "ssh-ed25519 AAAA..."

# The base DNS domain of the cluster. It must NOT contain a trailing period. Some
# DNS providers will automatically add this if necessary.
#
# Example: `openshift.example.com`.
#
# Note: This field MUST be set manually prior to creating the cluster.
baseDomain:

networking:
# This declares the IP range to assign Kubernetes pod IPs in CIDR notation.
podCIDR: 10.2.0.0/16

# This declares the IP range to assign Kubernetes service cluster IPs in CIDR notation.
# The maximum size of this IP range is /12
serviceCIDR: 10.3.0.0/16

# (optional) Configures the network to be used in the cluster. One of the following values can be used:
#
# - "flannel": enables overlay networking only. This is implemented by flannel using VXLAN.
#
# - "canal": enables overlay networking including network policy. Overlay is implemented by flannel using VXLAN. Network policy is implemented by Calico.
#
# - "calico-ipip": [ALPHA] enables BGP based networking. Routing and network policy is implemented by Calico. Note this has been tested on baremetal installations only.
#
# - "none": disables the installation of any Pod level networking layer. By setting this value, users are expected to deploy their own solution to enable network connectivity for Pods and Services.
# type: flannel

machines:
- name: master
replicas: 1
platform:
libvirt:
qcowImagePath: /path/to/image

- name: worker
replicas: 2
platform:
libvirt:
qcowImagePath: /path/to/image

platform:
libvirt:
# You must specify an IP address here that libvirtd is listening on,
# and that the cluster-api controller pod will be able to connect
# to. Often 192.168.122.1 is the default for the virbr0 interface.
uri: qemu+tcp://192.168.122.1/system

network:
name: openshift
ifName: tt0
ipRange: 192.168.124.0/24

# The pull secret in JSON format.
# This is known to be a "Docker pull secret" as produced by the docker login [1] command.
# A sample JSON content is shown in [2].
# You can download the pull secret from your Account overview page at [3].
#
# [1] https://docs.docker.com/engine/reference/commandline/login/
#
# [2] https://coreos.com/os/docs/latest/registry-authentication.html#manual-registry-auth-setup
#
# [3] https://account.coreos.com/overview
pullSecret: '{"auths": {}}'
Loading