Skip to content

Commit fa01b30

Browse files
authored
Merge pull request #49 from ibm-cloud-architecture/ocp46
Ocp46 - major merge from azure repo
2 parents 8c2f77d + 3b39df1 commit fa01b30

File tree

14 files changed

+866
-299
lines changed

14 files changed

+866
-299
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*.tfvars
1010
openshift_pull_secret.json
1111
.terraform.lock.hcl
12+
*.pem
13+
installer-files/**
1214

1315
# OS X files
1416
.DS_Store

README.md

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ This project uses mainly Terraform as infrastructure management and installation
3030
git --version
3131
```
3232

33-
3. Install OpenShift command line `oc` cli:
34-
35-
```bash
36-
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux-4.x.xx.tar.gz
37-
tar -xvf openshift-client-linux-4.x.xx.tar.gz
38-
chmod u+x oc kubectl
39-
sudo mv oc /usr/local/bin
40-
sudo mv kubectl /usr/local/bin
41-
oc version
42-
```
43-
4433
4. Install wget command:
4534

4635
- MacOS:
@@ -54,8 +43,6 @@ This project uses mainly Terraform as infrastructure management and installation
5443
zypper install wget
5544
```
5645
57-
5. Install jq: see [https://stedolan.github.io/jq/download/](https://stedolan.github.io/jq/download/)
58-
5946
6. Get the Terraform code
6047
6148
```bash
@@ -123,37 +110,33 @@ This project installs the OpenShift 4 in several stages where each stage automat
123110
cluster_name = "ocp4"
124111
base_domain = "example.com"
125112
openshift_pull_secret = "./openshift_pull_secret.json"
126-
openshift_installer_url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.6.28"
113+
openshift_version = "4.6.28"
127114
128-
aws_access_key_id = "AAAA"
129-
aws_secret_access_key = "AbcDefGhiJkl"
130-
aws_ami = "ami-06f85a7940faa3217"
131115
aws_extra_tags = {
132116
"owner" = "admin"
133117
}
134-
aws_azs = [
135-
"us-east-1a",
136-
"us-east-1b",
137-
"us-east-1c"
138-
]
139118
aws_region = "us-east-1"
140119
aws_publish_strategy = "External"
141120
```
142121

143122
|name | required | description and value |
144123
|----------------|------------|--------------|
145-
| `cluster_name` | yes | The name of the OpenShift cluster you will install |
146-
| `base_domain` | yes | The domain that has been created in Route53 public hosted zone |
124+
| `cluster_name` | yes | The name of the OpenShift cluster you will install |
125+
| `base_domain` | yes | The domain that has been created in Route53 public hosted zone |
147126
| `openshift_pull_secret` | no | The value refers to a file name that contain downloaded pull secret from https://cloud.redhat.com/openshift/pull-secret; the default name is `openshift_pull_secret.json` |
148-
| `openshift_installer_url` | no | The URL to the download site for Red Hat OpenShift installation and client codes. |
127+
| `openshift_version` | yes | The openshift version to be installed. |
149128
| `aws_region` | yes | AWS region that the VPC will be created in. By default, uses `us-east-2`. Note that for an HA installation, the AWS selected region should have at least 3 availability zones. |
150129
| `aws_extra_tags` | no | AWS tag to identify a resource for example owner:myname |
151-
| `aws_ami` | yes | Red Hat CoreOS ami for your region (see [here](https://docs.openshift.com/container-platform/4.6/installing/installing_aws/installing-aws-user-infra.html#installation-aws-user-infra-rhcos-ami_installing-aws-user-infra)). Other platforms images information can be found [here](https://github.com/openshift/installer/blob/master/data/data/rhcos.json) |
152-
| `aws_secret_access_key` | yes | adding aws_secret_access_key to the cluster |
153-
| `aws_access_key_id` | yes | adding aws_access_key_id to the cluster |
154-
| `aws_azs` | yes | list of availability zones to deploy VMs |
130+
| `aws_azs` | no | list of availability zones to deploy VMs - default to the [`a`, `b`, `c`] |
131+
| `openshift_byo_dns` | no | whether to ignore DNS resources (you still need a public zone defined) |
132+
| `openshift_ssh_key` | no | whether to use a specific public key |
133+
| `openshift_additional_trust_bundle` | no | additional trust bundle for accessing resources - ie proxy or repo |
155134
| `aws_publish_strategy` | no | Whether to publish the API endpoint externally - Default: "External" |
156135
| `airgapped` | no | A map with enabled (true/false) and repository name - This must be used with `aws_publish_strategy` of `Internal` |
136+
| `proxy_config` | no | To be implemented |
137+
| `use_ipv4` | no | To be implemented |
138+
| `use_ipv6` | no | To be implemented |
139+
157140

158141

159142
See [Terraform documentation](https://www.terraform.io/intro/getting-started/variables.html) for the format of this file.

config.tf

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,56 @@ variable "openshift_pull_secret" {
4343
description = "File containing pull secret - get it from https://cloud.redhat.com/openshift/install/pull-secret"
4444
}
4545

46-
variable "openshift_installer_url" {
47-
type = string
48-
description = "URL of the appropriate OpenShift installer under https://mirror.openshift.com/pub/openshift-v4/clients/ocp/"
46+
variable "use_ipv4" {
47+
type = bool
48+
default = true
49+
description = "not implemented"
50+
}
51+
52+
variable "use_ipv6" {
53+
type = bool
54+
default = false
55+
description = "not implemented"
56+
}
57+
58+
variable "openshift_version" {
59+
type = string
60+
default = "4.6.28"
61+
}
62+
63+
variable "airgapped" {
64+
type = map(string)
65+
default = {
66+
enabled = false
67+
repository = ""
68+
}
69+
}
70+
71+
variable "proxy_config" {
72+
type = map(string)
73+
description = "Not implemented"
74+
default = {
75+
enabled = false
76+
httpProxy = "http://user:password@ip:port"
77+
httpsProxy = "http://user:password@ip:port"
78+
noProxy = "ip1,ip2,ip3,.example.com,cidr/mask"
79+
}
80+
}
81+
82+
variable "openshift_additional_trust_bundle" {
83+
description = "path to a file with all your additional ca certificates"
84+
type = string
85+
default = ""
86+
}
87+
88+
variable "openshift_ssh_key" {
89+
description = "Path to SSH Public Key file to use for OpenShift Installation"
90+
type = string
91+
default = ""
92+
}
93+
94+
variable "openshift_byo_dns" {
95+
description = "Do not deploy any public or private DNS zone into Azure"
96+
type = bool
97+
default = false
4998
}

delocp.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

helper.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
locals {
2+
major_version = join(".", slice(split(".", var.openshift_version), 0, 2))
3+
aws_azs = (var.aws_azs != null) ? var.aws_azs : tolist([join("",[var.aws_region,"a"]),join("",[var.aws_region,"b"]),join("",[var.aws_region,"c"])])
4+
rhcos_image = lookup(lookup(lookup(jsondecode(data.http.images.body), "amis"), "${var.aws_region}"),"hvm")
5+
}
6+
7+
data "http" "images" {
8+
url = "https://raw.githubusercontent.com/openshift/installer/release-${local.major_version}/data/data/rhcos.json"
9+
request_headers = {
10+
Accept = "application/json"
11+
}
12+
}

install/aws_cleanup.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
path=$(dirname $0)
4-
clusterId=$(cat $path/infraID)
3+
path=$(dirname $0)
4+
clusterId=$(cat $path/../installer-files/infraID)
55

66
if [ -z "$clusterId" ]; then
7-
exit 99
7+
exit
88
fi
99

1010
if [ -z "$AWS_ACCESS_KEY_ID" ]; then
@@ -13,6 +13,10 @@ fi
1313
if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then
1414
exit 80
1515
fi
16+
if [ -z "$AWS_DEFAULT_REGION" ]; then
17+
exit 80
18+
fi
19+
1620

1721
echo "0 - Start processing for cluster $clusterId - waiting for masters to be destroyed"
1822
masters=3
@@ -24,7 +28,6 @@ while [ $masters -gt 0 ]; do
2428
sleep 10
2529
fi
2630
done
27-
2831
workers=$(echo "$nodes" | cut -d$'\t' -f1)
2932

3033
echo "1 - Deleting workers - $workers -"

0 commit comments

Comments
 (0)