-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Hill
committed
Feb 11, 2021
1 parent
636e7b1
commit 500371e
Showing
6 changed files
with
89 additions
and
72 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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# post_script | ||
# Output external IP on master-1 | ||
[ $cluster -eq 1 ] && echo IP is $(curl -s https://ipinfo.io/ip) || true | ||
[ $cluster -eq 1 ] && echo SUCCESS - IP is $(curl -s https://ipinfo.io/ip) || true |
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 |
---|---|---|
@@ -1,66 +1,48 @@ | ||
#https://www.openshift.com/blog/openshift-4-bare-metal-install-quickstart | ||
|
||
curl -s https://mirror.go-repo.io/centos/go-repo.repo >/etc/yum.repos.d/go-repo.repo | ||
dnf install -y bind git golang | ||
|
||
cat <<EOF >/var/named/db.ocp4 | ||
\$TTL 3D | ||
@ IN SOA ocp4. root.ocp4. ( | ||
202009290 ; serial, todays date + todays serial # | ||
8H ; refresh, seconds | ||
2H ; retry, seconds | ||
4W ; expire, seconds | ||
1D ) ; minimum, seconds | ||
NS master-$c.ocp4. | ||
|
||
localhost A 127.0.0.1 | ||
api A 192.168.10$c.90 | ||
api-int A 192.168.10$c.90 | ||
*.apps A 192.168.10$c.90 | ||
bootstrap A 192.168.10$c.90 | ||
master-$c A 192.168.10$c.90 | ||
EOF | ||
|
||
cat <<EOF >/var/named/db.192.168.10$c | ||
\$TTL 3D | ||
10$c.168.192.in-addr.arpa. IN SOA ocp4. root.ocp4. ( | ||
202009290 ; serial, todays date + todays serial # | ||
8H ; refresh, seconds | ||
2H ; retry, seconds | ||
4W ; expire, seconds | ||
1D ) ; minimum, seconds | ||
NS master-$c.ocp4. | ||
|
||
90 IN PTR master-$c.ocp4. | ||
eval $(ssh-agent) | ||
cd /tmp | ||
curl -sO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$ocp4_version/openshift-install-linux-$ocp4_version.tar.gz | ||
curl -sO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$ocp4_version/openshift-client-linux-$ocp4_version.tar.gz | ||
tar xzf openshift-install-linux-$ocp4_version.tar.gz | ||
tar xzf openshift-client-linux-$ocp4_version.tar.gz | ||
mv openshift-install oc kubectl /usr/bin | ||
rm -f openshift-install-linux-$ocp4_version.tar.gz openshift-client-linux-$ocp4_version.tar.gz | ||
|
||
mkdir /root/ocp4 | ||
cd /root/ocp4 | ||
cat <<EOF >install-config.yaml | ||
apiVersion: v1 | ||
baseDomain: $ocp4_domain | ||
compute: | ||
- hyperthreading: Enabled | ||
name: worker | ||
platform: | ||
aws: | ||
type: t2.xlarge | ||
replicas: $nodes | ||
controlPlane: | ||
hyperthreading: Enabled | ||
name: master | ||
platform: {} | ||
replicas: 3 | ||
metadata: | ||
creationTimestamp: null | ||
name: $name | ||
networking: | ||
clusterNetwork: | ||
- cidr: 10.128.0.0/14 | ||
hostPrefix: 23 | ||
machineCIDR: 10.0.0.0/16 | ||
networkType: OpenShiftSDN | ||
serviceNetwork: | ||
- 172.30.0.0/16 | ||
platform: | ||
aws: | ||
region: $aws_region | ||
pullSecret: '$ocp4_pull_secret' | ||
sshKey: | | ||
EOF | ||
|
||
for i in $(seq 1 $nodes); do | ||
echo "node-$c-$i A 192.168.1$(printf %.2d $c).1$(printf %.2d $i)" >>/var/named/db.ocp4 | ||
echo "10$i PTR node-$c-$i.ocp4." >>/var/named/db.192.168.10$c | ||
done | ||
|
||
cat <<EOF >>/etc/named.conf | ||
zone "ocp4" { | ||
type master; | ||
file "/var/named/db.ocp4"; | ||
}; | ||
|
||
zone "1$(printf %.2d $c).168.192.in-addr.arpa" { | ||
type master; | ||
file "/var/named/db.192.168.1$(printf %.2d $c)"; | ||
}; | ||
EOF | ||
|
||
systemctl enable bind | ||
systemctl start bind | ||
|
||
cd /root | ||
git clone https://github.com/openshift/installer | ||
cd installer | ||
./hack/build.sh | ||
#./bin/openshift-install create install-config | ||
#curl -sLO https://github.com/openshift/okd/releases/download/4.5.0-0.okd-2020-09-04-180756/openshift-install-linux-4.5.0-0.okd-2020-09-04-180756.tar.gz | ||
#tar -C /usr/bin -xzf openshift-install-linux-4.5.0-0.okd-2020-09-04-180756.tar.gz openshift-install | ||
#curl -sLO https://github.com/openshift/okd/releases/download/4.5.0-0.okd-2020-09-04-180756/openshift-client-linux-4.5.0-0.okd-2020-09-04-180756.tar.gz | ||
#tar -C /usr/bin -xzf openshift-client-linux-4.5.0-0.okd-2020-09-04-180756.tar.gz oc | ||
#ln -s /usr/bin/oc /usr/bin/kubectl | ||
echo -n " " >>install-config.yaml | ||
ssh-keygen -y -f /root/.ssh/id_rsa >>install-config.yaml | ||
openshift-install create cluster --log-level=debug | ||
mkdir /root/.kube | ||
cp /root/ocp4/auth/kubeconfig /root/.kube/config |