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//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 /root/web/

10] cd deploy/

11] oc create -f service_account.yaml

12] oc adm policy add-cluster-role-to-user cluster-admin -z web

13] oc create -f crds/web.operator.io_webs_crd.yaml

14] oc create -f operator.yaml

15] oc get deployment

16] oc get web

17] oc create -f crds/web.operator.io_v1_web_cr.yaml

18] oc projects | grep example

Can see new project created and resources create inside.



Follow the link for GO and OPERATOR-SDK installation.............................

Comments

Popular posts from this blog

Install Go [STEP-1]

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