Posts

Publishing Operators using Custom Operator Registry [STEP-4]

Image
  1. Download opm from the url given below             https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest-4.6/       Download file with name  opm-linux-*.tar.gz   [* version number] 2. Install opm     Go to the downloaded path,extract and install           tar xvf  opm-linux-4.6.52.tar.gz     mv opm /usr/local/bin/ 3. Generate custom service version.   cd /root/web  operator-sdk generate csv --csv-version 1.0.0 --interactive=true  Above command will ask for inputs. Will results in creating a directory  /root/web/deploy/olm-catalog 4. Copy resources files.     cp /root/web/deploy/service_account.yaml  /root/web/deploy/olm-catalog/web/manifests/     cp /root/web/deploy/role.yaml  /root/web/deploy/olm-catalog/web/manifests/     gedit /root/web/deploy/olm-catalog/web/manifests/role_b...

Creating a simple Web Operator using Operator SDK Ansible framework-[STEP-3]

 Creating a simple Web Operator using Operator SDK Ansible framework 1] cd /root 2] operator-sdk new web --kind=Web --api-version=web.operator.io/v1 --type=ansible 3] cd /root/web 4] gedit /root/web/roles/web/tasks/main.yml [ADD ansible content from the following GIT url: https://github.com/ anandpavithran / operator-yaml /main.yml ] 5] operator-sdk build quay.io/yourreponame/web --image-builder podman [Note :QUAYREPONAME] 6] List and push the Operator image to your QUAY repository [Note:Need a QUAY account] podman images podman login quay.io -u yourusername -p yourpassword podman push quay.io/yourreponame/web:latest Don't forget to make repovisibility PUBLIC in settings tab 7] Replace the Operator image with your imagename in "operator.yaml" file. Note: Require access to Openshift platform with admin privilege for the following steps. Command mode way of Operator Deployment ######################################## 8] oc new-project weboperator 9] cd /roo...

Install Operator-SDK on Linux-[STEP-2]

Install OPERATOR-SDK  Operator SDK source code to compile and install the SDK CLI.   Clone the  operator-sdk  repository: mkdir -p $GOPATH/src/github.com/operator-framework cd $GOPATH/src/github.com/operator-framework git clone https://github.com/operator-framework/operator-sdk cd operator-sdk Check out to branch: git checkout tags/v0.19.4 -b v0.19.4 Install "make" binary by using yum/dnf dnf install make Install the SDK CLI tool: make tidy make install Above command installs the CLI binary  operator- sdk  at  $GOPATH/bin .   Verify CLI tool was installed correctly: operator-sdk -h operator-sdk version NOTE: Please follow the link below before getting in to above steps. https://openshift-operator-intro.blogspot.com/2020/08/install-go.html

Install Go [STEP-1]

Install Go Login as root user  Go to the following link and download file https://golang.org/dl/ Extract tar file to / usr/ local directory tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz Set the PATH and GOPATH in /root/.bash_profile             export PATH=$PATH:/usr/local/go/bin           export GOPATH=/usr/local/go       5.  Execute following command.            source /root/.bash_profile           go           Verify the output [OPTIONAL]        6. Verify Installation -Execute following commands           1. Execute following to behave the GOPATH way even outside of GOPATH                   go env -w GO111MODULE=off              2. cd /root 3. vi hello.go #Add following content package main i...