📃
OpenShift
  • What is OpenShift?
  • Intro (Docs)
  • Training (Patform)
  • Install OpenShift Local
  • Architecture
  • Certification
    • DO280
    • DO288
    • DO425
  • DevOps with OpenShift
  • File Definitions
  • LAB
    • Ayuda:Traducir contenido
    • Labs Modules
Powered by GitBook
On this page
  • Requerimientos mínimos del sistema
  • Paso 1: instale los paquetes de software necesarios
  • Paso 2: instalar contenedores CodeReady
  • Paso 3: Implementar la máquina virtual CodeReady Containers.
  • Paso 4: Acceda a OpenShift Cluster
  • Paso 5: detener OpenShift Cluster
  • Deleting CodeReady Containers virtual machine
  • Referencia

Was this helpful?

Install OpenShift Local

Requerimientos mínimos del sistema

CodeReady Containers requiere los siguientes requisitos mínimos de hardware y sistema operativo.

  • 4 virtual CPUs (vCPUs)

  • 8 GB of memory

  • 35 GB of storage space

CodeReady Containers se puede ejecutar en Linux, Windows y macOS, pero esta configuración se ha probado en CentOS 7/8 y Fedora 31. CodeReady Containers se entrega como una máquina virtual Red Hat Enterprise Linux que admite hipervisores nativos para Linux, macOS y Microsoft. Windows 10.

Paso 1: instale los paquetes de software necesarios

CodeReady Containers requiere que los paquetes libvirt y NetworkManager estén instalados en el sistema host antes de su configuración.

------- Fedora ----------
$ sudo dnf install NetworkManager qemu-kvm libvirt virt-install
$ sudp systemctl enable --now libvirtd

------ CentOS 7 ---------
$ sudo yum -y install qemu-kvm libvirt virt-install bridge-utils NetworkManager
$ sudo systemctl enable --now libvirtd 

------ Ubuntu ----------
$ sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system network-manager

Paso 2: instalar contenedores CodeReady

Descargue el archivo binario más reciente para CRC desde la siguiente URL.

https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz

Extraiga el archivo CodeReady Containers descargado.

tar xvf crc-linux-amd64.tar.xz

Coloque el binario en su $PATH .

cd crc*/
sudo cp crc /usr/local/bin

Confirme la instalación comprobando la versión del software.

$ crc version
crc version: 1.2.0+c2e3c0f
OpenShift version: 4.2.8 (embedded in binary)

Para ver la página de ayuda de los comandos de crc, ejecute:

$ crc --help 
CodeReady Containers is a tool that manages a local OpenShift 4.x cluster optimized for testing and development purposes

Usage:
  crc [flags]
  crc [command]

Available Commands:
  config      Modify crc configuration
  console     Open the OpenShift Web Console in the default browser
  delete      Delete the OpenShift cluster
  help        Help about any command
  ip          Get IP address of the running OpenShift cluster
  oc-env      Add the 'oc' binary to PATH
  setup       Set up prerequisites for the OpenShift cluster
  start       Start the OpenShift cluster
  status      Display status of the OpenShift cluster
  stop        Stop the OpenShift cluster
  version     Print version information

Flags:
  -f, --force              Forcefully perform an action
  -h, --help               help for crc
      --log-level string   log level (e.g. "debug | info | warn | error") (default "info")

Paso 3: Implementar la máquina virtual CodeReady Containers.

Ejecute el comando crc setup para configurar su sistema operativo host para la máquina virtual CodeReady Containers.

$ crc setup

El instalador comprobará los requisitos de configuración antes de la instalación.

INFO Checking if running as non-root              
INFO Caching oc binary                            
INFO Setting up virtualization                    
INFO Setting up KVM                               
INFO Installing libvirt service and dependencies  
INFO Adding user to libvirt group                 
INFO Enabling libvirt                             
INFO Starting libvirt service                     
INFO Will use root access: start libvirtd service 
INFO Checking if a supported libvirt version is installed 
INFO Installing crc-driver-libvirt                
INFO Removing older system-wide crc-driver-libvirt 
INFO Setting up libvirt 'crc' network             
INFO Starting libvirt 'crc' network               
INFO Checking if NetworkManager is installed      
INFO Checking if NetworkManager service is running 
INFO Writing Network Manager config for crc       
INFO Will use root access: write NetworkManager config in /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf 
INFO Will use root access: execute systemctl daemon-reload command 
INFO Will use root access: execute systemctl stop/start command 
INFO Writing dnsmasq config for crc               
INFO Will use root access: write dnsmasq configuration in /etc/NetworkManager/dnsmasq.d/crc.conf 
INFO Will use root access: execute systemctl daemon-reload command 
INFO Will use root access: execute systemctl stop/start command 
INFO Unpacking bundle from the CRC binary

Una vez que se complete la configuración, ejecute el siguiente comando para iniciar el clúster de OpenShift en su computadora portátil.

$ crc start
INFO Checking if running as non-root              
INFO Checking if oc binary is cached              
INFO Checking if Virtualization is enabled        
INFO Checking if KVM is enabled                   
INFO Checking if libvirt is installed             
INFO Checking if user is part of libvirt group    
INFO Checking if libvirt is enabled               
INFO Checking if libvirt daemon is running        
INFO Checking if a supported libvirt version is installed 
INFO Checking if crc-driver-libvirt is installed  
INFO Checking if libvirt 'crc' network is available 
INFO Checking if libvirt 'crc' network is active  
INFO Checking if NetworkManager is installed      
INFO Checking if NetworkManager service is running 
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists 
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists 
? Image pull secret [? for help] *

Pegue el secreto de extracción cuando se le solicite, luego continuará la configuración del clúster.

https://api.crc.testing:6443

Los detalles de acceso y las credenciales se imprimen después de una configuración exitosa.

https://api.crc.testing:6443kubeadminUMeRe-hBQAi-JJ4Bi-8ynRD'crc console

Para poder acceder a su clúster, primero configure su entorno ejecutando.

crc oc-env

Ejecute los comandos impresos en su terminal o agréguelos a su archivo ~/.bashrc o ~/.zshrc, luego córrelos.

$ source ~/.bashrc 
-- or --
$ source ~/.zshrc

Confirme la configuración del clúster.

https://api.crc.testing:6443https://api.crc.testing:6443https://192.168.39.35:8443

Para ver los operadores de clúster:

$ oc get co
NAME                                       VERSION   AVAILABLE   PROGRESSING   DEGRADED   SINCE
authentication                             4.2.8     True        False         False      5d13h
cloud-credential                           4.2.8     True        False         False      5d13h
cluster-autoscaler                         4.2.8     True        False         False      5d13h
console                                    4.2.8     True        False         False      5d13h
dns                                        4.2.8     True        False         False      17m
image-registry                             4.2.8     True        False         False      5d13h
ingress                                    4.2.8     True        False         False      5d13h
insights                                   4.2.8     True        False         False      5d13h
kube-apiserver                             4.2.8     True        False         False      5d13h
kube-controller-manager                    4.2.8     True        False         False      5d13h
kube-scheduler                             4.2.8     True        False         False      5d13h
machine-api                                4.2.8     True        False         False      5d13h
machine-config                             4.2.8     True        False         False      5d13h
marketplace                                4.2.8     True        False         False      17m
monitoring                                 4.2.8     False       True          True       5d13h
network                                    4.2.8     True        False         False      5d13h
node-tuning                                4.2.8     True        False         False      17m
openshift-apiserver                        4.2.8     True        False         False      9h
openshift-controller-manager               4.2.8     True        False         False      9h
openshift-samples                          4.2.8     True        False         False      5d13h
operator-lifecycle-manager                 4.2.8     True        False         False      5d13h
operator-lifecycle-manager-catalog         4.2.8     True        False         False      5d13h
operator-lifecycle-manager-packageserver   4.2.8     True        False         False      17m
service-ca                                 4.2.8     True        False         False      5d13h
service-catalog-apiserver                  4.2.8     True        False         False      5d13h
service-catalog-controller-manager         4.2.8     True        False         False      5d13h
storage                                    4.2.8     True        False         False      5d13h

Paso 4: Acceda a OpenShift Cluster

Puede acceder al clúster de OpenShift implementado localmente desde la CLI o abriendo la consola OpenShift 4.x en su navegador web.

https://api.crc.testing:6443

Acceder como administrador:

https://api.crc.testing:6443

Para abrir la consola desde su navegador web predeterminado, ejecute:

$ crc console

Inicie sesión con las credenciales impresas anteriormente..

Ahí tienes un clúster en ejecución.

Paso 5: detener OpenShift Cluster

Para detener su clúster de OpenShift, ejecute el comando:

$ crc stop
Stopping the OpenShift cluster, this may take a few minutes...
Stopped the OpenShift cluster

La máquina virtual se puede iniciar en cualquier momento ejecutando el comando:

https://api.crc.testing:6443

Deleting CodeReady Containers virtual machine

Si desea eliminar una máquina virtual CodeReady Containers existente, ejecute:

$ crc delete

Este comando eliminará la máquina virtual CodeReady Containers..

Referencia

PreviousTraining (Patform)NextArchitecture

Last updated 4 years ago

Was this helpful?

Tenga en cuenta que se requiere un secreto de extracción de usuario de OpenShift válido durante la instalación. El secreto de extracción se puede copiar o descargar desde la sección Secreto de extracción del sobre la pagia .

Install on Laptop: Red Hat CodeReady Containers
cloud.redhat.com
CRC Documentation