Skip to content

luigiaparicio/openshift-install-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

openshift-install-lab

Primera parte como ROOT en el Bastion

sudo -i
echo ${GUID}

Install AWS CLI

# Download the latest AWS Command Line Interface
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip

# Install the AWS CLI into /bin/aws
./awscli-bundle/install -i /usr/local/aws -b /bin/aws

# Validate that the AWS CLI works
aws --version

# Clean up downloaded files
rm -rf /root/awscli-bundle /root/awscli-bundle.zip

OpenShift Version

OCP_VERSION=4.6.1

OpenShift Installer

wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_VERSION}/openshift-install-linux-${OCP_VERSION}.tar.gz
tar zxvf openshift-install-linux-${OCP_VERSION}.tar.gz -C /usr/bin
rm -f openshift-install-linux-${OCP_VERSION}.tar.gz /usr/bin/README.md
chmod +x /usr/bin/openshift-install

Openshift CLI

wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_VERSION}/openshift-client-linux-${OCP_VERSION}.tar.gz
tar zxvf openshift-client-linux-${OCP_VERSION}.tar.gz -C /usr/bin
rm -f openshift-client-linux-${OCP_VERSION}.tar.gz /usr/bin/README.md
chmod +x /usr/bin/oc

Check

ls -l /usr/bin/{oc,openshift-install}

OC bash completion

oc completion bash >/etc/bash_completion.d/openshift

Ctrl+d or exit

Segunda parte sin ROOT

AWS credentials

Create AWS credentials file

export AWSKEY=<YOURACCESSKEY>
export AWSSECRETKEY=<YOURSECRETKEY>

export REGION=us-east-2

mkdir $HOME/.aws
cat << EOF >>  $HOME/.aws/credentials
[default]
aws_access_key_id = ${AWSKEY}
aws_secret_access_key = ${AWSSECRETKEY}
region = $REGION
EOF

And test it ...

aws sts get-caller-identity

Create SSH key

ssh-keygen -f ~/.ssh/cluster-${GUID}-key -N ''

Install OCP

openshift-install create cluster --dir $HOME/cluster-${GUID}

Example answers:

  • SSH Public Key: $HOME/cluster-${GUID}/.ssh/cluster-492d-key.pub
  • Platform: aws
  • Region: us-east-2
  • sandbox392.opentlc.com
  • Cluster Name: cluster-492d
  • Pull Secret: Paste your pull secret here

Deploy OCS

Create OCS Nodes

export KUBECONFIG=$HOME/cluster-${GUID}/auth/kubeconfig
CLUSTERID=$(oc get machineset -n openshift-machine-api -o jsonpath='{.items[0].metadata.labels.machine\.openshift\.io/cluster-api-cluster}')
echo $CLUSTERID

curl -s https://raw.githubusercontent.com/luigiaparicio/openshift-install-lab/main/manifests/machinesets-ocs-us-east-2.yaml| sed -e "s/CLUSTERID/${CLUSTERID}/g" | oc apply -f -

Deploy OCS Operator

  • Login as cluster-admin in OpenShift Web Console
  • Operators -> OperatorHub -> Search for OpenShift Container Storage and install it with default settings and remember to "Enable operator recommended cluster monitoring on this namespace"
  • Installed Operators -> OpenShift Container Storage -> Storage Cluster -> Create OCS Cluster Service -> Select your OCS Nodes, disk size, and create

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages