Skip to content

Commit

Permalink
*: remove support for container linux
Browse files Browse the repository at this point in the history
This drops a number of configuration options that are specific to
Container Linux. This also changes the default region to us-east-1
throughout the tests.
  • Loading branch information
crawford committed Sep 10, 2018
1 parent b789c79 commit 66ef3be
Show file tree
Hide file tree
Showing 42 changed files with 131 additions and 647 deletions.
37 changes: 8 additions & 29 deletions config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,17 @@ variable "tectonic_container_images" {
default = {
addon_resizer = "gcr.io/google_containers/addon-resizer:2.1"
bootkube = "quay.io/coreos/bootkube:v0.10.0"
tnc_operator = "quay.io/coreos/tectonic-node-controller-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
tnc_operator = "quay.io/coreos/tectonic-node-controller-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
etcd_cert_signer = "quay.io/coreos/kube-etcd-signer-server:678cc8e6841e2121ebfdb6e2db568fce290b67d6"
etcd = "quay.io/coreos/etcd:v3.2.14"
hyperkube = "openshift/origin-node:latest"
kube_core_renderer = "quay.io/coreos/kube-core-renderer-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
kube_core_operator = "quay.io/coreos/kube-core-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
tectonic_channel_operator = "quay.io/coreos/tectonic-channel-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
kube_addon_operator = "quay.io/coreos/kube-addon-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
kube_core_renderer = "quay.io/coreos/kube-core-renderer-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
kube_core_operator = "quay.io/coreos/kube-core-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
tectonic_channel_operator = "quay.io/coreos/tectonic-channel-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
kube_addon_operator = "quay.io/coreos/kube-addon-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
tectonic_alm_operator = "quay.io/coreos/tectonic-alm-operator:v0.3.1"
tectonic_ingress_controller_operator = "quay.io/coreos/tectonic-ingress-controller-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
tectonic_utility_operator = "quay.io/coreos/tectonic-utility-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
tectonic_network_operator = "quay.io/coreos/tectonic-network-operator-dev:436b1b4395ae54d866edc88864c9b01797cebac1"
tectonic_ingress_controller_operator = "quay.io/coreos/tectonic-ingress-controller-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
tectonic_utility_operator = "quay.io/coreos/tectonic-utility-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
tectonic_network_operator = "quay.io/coreos/tectonic-network-operator-dev:0a24db2288f00b10ced358d9643debd601ffd0f1"
}
}

Expand Down Expand Up @@ -192,26 +191,6 @@ You can download the pull secret from your Account overview page at [3].
EOF
}

variable "tectonic_container_linux_channel" {
type = "string"

description = <<EOF
The Container Linux update channel.
Examples: `stable`, `beta`, `alpha`
EOF
}

variable "tectonic_container_linux_version" {
type = "string"

description = <<EOF
The Container Linux version to use. Set to `latest` to select the latest available version for the selected update channel.
Examples: `latest`, `1465.6.0`
EOF
}

variable "tectonic_update_server" {
type = "string"
default = "https://tectonic.update.core-os.net"
Expand Down
21 changes: 1 addition & 20 deletions examples/tectonic.aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ admin:
password: "verysecure"
sshKey: "ssh-ed25519 AAAA..."
aws:
# (optional) Unique name under which the Amazon S3 bucket will be created. Bucket name must start with a lower case name and is limited to 63 characters.
# The Tectonic Installer uses the bucket to store tectonic assets and kubeconfig.
# If name is not provided the installer will construct the name using "name", current AWS region and "baseDomain"
# assetsS3BucketName:

# (optional) AMI override for all nodes. Example: `ami-foobar123`.
# ec2AMIOverride:

Expand Down Expand Up @@ -95,7 +90,7 @@ aws:
# publicEndpoints: true

# The target AWS region for the cluster.
region: eu-west-1
region: us-east-1

# 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.
Expand Down Expand Up @@ -164,20 +159,6 @@ ca:
# This field is mandatory if `ca_cert` is set.
# keyAlg: RSA

containerLinux:
# (optional) The Container Linux update channel.
#
# Examples: `stable`, `beta`, `alpha`
# channel: stable

# The Container Linux version to use. Set to `latest` to select the latest available version for the selected update channel.
#
# Examples: `latest`, `1465.6.0`
version: latest

# (optional) A list of PEM encoded CA files that will be installed in /etc/ssl/certs on etcd, master, and worker nodes.
# customCAPEMList:

iscsi:
# (optional) Start iscsid.service to enable iscsi volume attachment.
# enabled: false
Expand Down
14 changes: 0 additions & 14 deletions examples/tectonic.libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ ca:
# This field is mandatory if `ca_cert` is set.
# keyAlg: RSA

containerLinux:
# (optional) The Container Linux update channel.
#
# Examples: `stable`, `beta`, `alpha`
channel: beta

# The Container Linux version to use. Set to `latest` to select the latest available version for the selected update channel.
#
# Examples: `latest`, `1465.6.0`
version: latest

# (optional) A list of PEM encoded CA files that will be installed in /etc/ssl/certs on master and worker nodes.
# customCAPEMList:

iscsi:
# (optional) Start iscsid.service to enable iscsi volume attachment.
# enabled: false
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/config-generator/fixtures/kube-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data:
type: canal
platform:
aws:
region: eu-west-1
region: us-east-1
vpcCIDRBlock: 10.0.0.0/16
vpcID: ""
pullSecret: '{"auths": {}}'
Expand Down
5 changes: 1 addition & 4 deletions installer/pkg/config-generator/fixtures/test-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ worker:
nodePools:
- worker
pullSecret: '{"auths": {}}'
containerLinux:
channel: stable
version: latest
admin:
email: test@coreos.com
password: asd123
aws:
region: eu-west-1
region: us-east-1
sshKey: tectonic
vpcCIDRBlock: 10.0.0.0/16
master:
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/config-generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func initConfig(t *testing.T, file string) ConfigGenerator {
cluster, err := config.ParseConfigFile("./fixtures/" + file)
if err != nil {
t.Errorf("Test case TestUrlFunctions: failed to parse test config, %s", err)
t.Fatalf("Test case TestUrlFunctions: failed to parse test config, %s", err)
}

return ConfigGenerator{
Expand Down
1 change: 1 addition & 0 deletions installer/pkg/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_library(
"//installer/pkg/config/aws:go_default_library",
"//installer/pkg/config/libvirt:go_default_library",
"//installer/pkg/validate:go_default_library",
"//pkg/rhcos:go_default_library",
"//vendor/github.com/Sirupsen/logrus:go_default_library",
"//vendor/github.com/coreos/ignition/config/v2_2:go_default_library",
"//vendor/github.com/coreos/tectonic-config/config/tectonic-network:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/config/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
// DefaultProfile is the default AWS credentials profile to use.
DefaultProfile = "default"
// DefaultRegion is the default AWS region for the cluster.
DefaultRegion = "eu-west-1"
DefaultRegion = "us-east-1"
)

// AWS converts AWS related config.
Expand Down
7 changes: 2 additions & 5 deletions installer/pkg/config/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const (
PlatformAWS Platform = "aws"
// PlatformLibvirt is the platform for a cluster launched on libvirt.
PlatformLibvirt Platform = "libvirt"
// DefaultChannel is the default RHCOS channel for the cluster.
DefaultChannel = "tested"
)

// Platform indicates the target platform of the cluster.
Expand Down Expand Up @@ -54,10 +56,6 @@ var defaultCluster = Cluster{
CA: CA{
RootCAKeyAlg: "RSA",
},
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelStable,
Version: ContainerLinuxVersionLatest,
},
Libvirt: libvirt.Libvirt{
Network: libvirt.Network{
IfName: libvirt.DefaultIfName,
Expand All @@ -77,7 +75,6 @@ type Cluster struct {
aws.AWS `json:",inline" yaml:"aws,omitempty"`
BaseDomain string `json:"tectonic_base_domain,omitempty" yaml:"baseDomain,omitempty"`
CA `json:",inline" yaml:"CA,omitempty"`
ContainerLinux `json:",inline" yaml:"containerLinux,omitempty"`
IgnitionMasters []string `json:"tectonic_ignition_masters,omitempty" yaml:"-"`
IgnitionWorker string `json:"tectonic_ignition_worker,omitempty" yaml:"-"`
Internal `json:",inline" yaml:"-"`
Expand Down
11 changes: 11 additions & 0 deletions installer/pkg/config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package config

import (
"errors"
"fmt"
"io/ioutil"

"gopkg.in/yaml.v2"

"github.com/openshift/installer/pkg/rhcos"
)

// ParseConfig parses a yaml string and returns, if successful, a Cluster.
Expand All @@ -28,6 +31,14 @@ func ParseConfig(data []byte) (*Cluster, error) {
cluster.PullSecret = string(data)
}

if cluster.EC2AMIOverride == "" {
ami, err := rhcos.AMI(DefaultChannel, cluster.AWS.Region)
if err != nil {
return nil, fmt.Errorf("Failed to determine default AMI: %v", err)
}
cluster.EC2AMIOverride = ami
}

return &cluster, nil
}

Expand Down
20 changes: 0 additions & 20 deletions installer/pkg/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ package config

import "github.com/coreos/tectonic-config/config/tectonic-network"

// ContainerLinuxChannel indicates the selected Container Linux channel.
type ContainerLinuxChannel string

const (
// ContainerLinuxChannelStable is the stable Container Linux channel.
ContainerLinuxChannelStable ContainerLinuxChannel = "stable"
// ContainerLinuxChannelBeta is the beta Container Linux channel.
ContainerLinuxChannelBeta ContainerLinuxChannel = "beta"
// ContainerLinuxChannelAlpha is the alpha Container Linux channel.
ContainerLinuxChannelAlpha ContainerLinuxChannel = "alpha"
// ContainerLinuxVersionLatest is the string to indicate the latest Container Linux version.
ContainerLinuxVersionLatest = "latest"
)

// Admin converts admin related config.
type Admin struct {
Email string `json:"tectonic_admin_email" yaml:"email,omitempty"`
Expand All @@ -30,12 +16,6 @@ type CA struct {
RootCAKeyAlg string `json:"-" yaml:"rootCAKeyAlg,omitempty"`
}

// ContainerLinux converts container linux related config.
type ContainerLinux struct {
Channel ContainerLinuxChannel `json:"tectonic_container_linux_channel,omitempty" yaml:"channel,omitempty"`
Version string `json:"tectonic_container_linux_version,omitempty" yaml:"version,omitempty"`
}

// NodePool converts node pool related config.
type NodePool struct {
Count int `json:"-" yaml:"count"`
Expand Down
20 changes: 0 additions & 20 deletions installer/pkg/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (c *Cluster) Validate() []error {
errs = append(errs, c.validateIgnitionFiles()...)
errs = append(errs, c.validateNetworking()...)
errs = append(errs, c.validateAWS()...)
errs = append(errs, c.validateCL()...)
errs = append(errs, c.validatePullSecret()...)
errs = append(errs, c.validateLibvirt()...)
errs = append(errs, c.validateCA()...)
Expand Down Expand Up @@ -126,25 +125,6 @@ func (c *Cluster) validateAWS() []error {
return errs
}

// validateCL validates all fields specific to Container Linux.
func (c *Cluster) validateCL() []error {
var errs []error
switch c.ContainerLinux.Channel {
case ContainerLinuxChannelStable:
fallthrough
case ContainerLinuxChannelBeta:
fallthrough
case ContainerLinuxChannelAlpha:
break
default:
errs = append(errs, fmt.Errorf("invalid Container Linux channel %q", c.ContainerLinux.Channel))
}
if c.ContainerLinux.Version != ContainerLinuxVersionLatest && !regexp.MustCompile(`\d+\.\d+\.\d+`).MatchString(c.ContainerLinux.Version) {
errs = append(errs, fmt.Errorf("invalid Container Linux version %q", c.ContainerLinux.Version))
}
return errs
}

// validateOverlapWithPodOrServiceCIDR ensures that the given CIDR does not
// overlap with the pod or service CIDRs of the cluster config.
func (c *Cluster) validateOverlapWithPodOrServiceCIDR(cidr, name string) []error {
Expand Down
88 changes: 0 additions & 88 deletions installer/pkg/config/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,94 +443,6 @@ func TestValidateIgnitionFiles(t *testing.T) {
}
}

func TestValidateCL(t *testing.T) {
cases := []struct {
cluster Cluster
err bool
}{
{
cluster: defaultCluster,
err: false,
},
{
cluster: Cluster{},
err: true,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelBeta,
},
},
err: true,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelBeta,
Version: ContainerLinuxVersionLatest,
},
},
err: false,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: "foo",
Version: ContainerLinuxVersionLatest,
},
},
err: true,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelStable,
Version: "100.99.98",
},
},
err: false,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelStable,
Version: "100..98",
},
},
err: true,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelStable,
Version: "100a99a98",
},
},
err: true,
},
{
cluster: Cluster{
ContainerLinux: ContainerLinux{
Channel: ContainerLinuxChannelStable,
Version: "foo",
},
},
err: true,
},
}

for i, c := range cases {
if err := c.cluster.validateCL(); (err != nil) != c.err {
no := "no"
if c.err {
no = "an"
}
t.Errorf("test case %d: expected %s error, got %v", i, no, err)
}
}
}

func TestValidateLibvirt(t *testing.T) {
fValid, err := ioutil.TempFile("", "qcow")
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions installer/pkg/workflow/fixtures/aws.basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ aws:
size: 30
type: gp2
baseDomain: tectonic-ci.de
containerLinux:
channel: beta
master:
nodePools:
- master
Expand Down
Loading

0 comments on commit 66ef3be

Please sign in to comment.