SlideShare a Scribd company logo
1 of 36
Download to read offline
Test your Kubernetes operator with OLM
Baiju Muthukadan Avni Sharma
May 15, 2019
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 1 / 36
About Us
Baiju is a Senior Software Engineer
Avni is an Associate Software Engineer
Both of us work on DevConsole Operator
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 2 / 36
Problem Statement
As a development team, we need to run end-to-end test for our operator. To
run end-to-end test, we need a mechanism to setup the infrastructure which
includes the operator deployment and other dependent resources (CRDs,
service account, role, and role binding).
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 3 / 36
Agenda
Introduction to Operator Framework
Setting up resources through Operator Lifecycle Manager (OLM) for e2e
testing
Running e2e test through OpenShift CI
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 4 / 36
DevConsole Operator
Provides a developer-focused view in OpenShift 4
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 5 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 6 / 36
Operator Framework
A toolkit to manage Kubernetes native applications, called Operators.
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 7 / 36
Example Operators
https://github.com/redhat-developer/devconsole-operator
https://github.com/openshift/tektoncd-pipeline-operator
https://github.com/operator-framework/operator-marketplace
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 8 / 36
Operator Framework Parts
https://github.com/operator-framework
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 9 / 36
Operator Lifecycle Manager (OLM)
Oversees operator:
Installation
Updates
Lifecycle
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 10 / 36
OLM CRDs
catalogsources.operators.coreos.com
clusterserviceversions.operators.coreos.com
installplans.operators.coreos.com
operatorgroups.operators.coreos.com
subscriptions.operators.coreos.com
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 11 / 36
Catalog Source
Repository of Cluster Service Version (CSV) files and CRDs
Two types
gRPC
Internal (based on ConfigMap)
Public repository: https://www.operatorhub.io
To create a custom gRPC use this base image:
quay.io/openshift/origin-operator-registry:latest
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 12 / 36
File: manifests/devconsole/0.1.0/devconsole-
operator.v0.1.0.clusterserviceversion.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
capabilities: Full Lifecycle
description: The operator that enables a developer-focused perspective
categories: "Developer Tools"
name: devconsole-operator.v0.1.0
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
...
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 13 / 36
Manifests directory structure
manifests/
└── devconsole
├── 0.1.0
│   ├── devconsole-operator.v0.1.0.clusterserviceversion.yaml
│   ├── devconsole_v1alpha1_component_crd.yaml
│   ├── devconsole_v1alpha1_gitsourceanalysis_crd.yaml
│   └── devconsole_v1alpha1_gitsource_crd.yaml
└── devconsole.package.yaml
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 14 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 15 / 36
Dockerfile to create registry
FROM quay.io/openshift/origin-operator-registry:latest
ARG image=quay.io/redhat-developer/devconsole-operator
ARG version=0.1.0
COPY manifests manifests
COPY deploy/crds/*.yaml manifests/devconsole/${version}/
USER root
RUN sed -e "s,REPLACE_IMAGE,${image}," -i
manifests/devconsole/${version}/devconsole-operator.v${version}.
clusterserviceversion.yaml
USER 1001
RUN initializer
CMD "registry-server", "--termination-log=log.txt"
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 16 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 17 / 36
Manifests directory structure
manifests/
└── devconsole
├── 0.1.0
│   ├── devconsole-operator.v0.1.0.clusterserviceversion.yaml
│   ├── devconsole_v1alpha1_component_crd.yaml
│   ├── devconsole_v1alpha1_gitsourceanalysis_crd.yaml
│   └── devconsole_v1alpha1_gitsource_crd.yaml
└── devconsole.package.yaml
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 18 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 19 / 36
CatalogSource
# Ref. https://github.com/operator-framework/operator-lifecycle-manager
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: my-catalog
namespace: openshift-operator-lifecycle-manager
spec:
sourceType: grpc
image: REPLACE_IMAGE
displayName: Community Operators
publisher: Red Hat
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 20 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 21 / 36
Subscription
Keep CSVs up to date by tracking a channel in a package.
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 22 / 36
File: manifests/devconsole/devconsole.package.yaml
packageName: devconsole
channels:
- name: alpha
currentCSV: devconsole-operator.v0.1.0
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 23 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 24 / 36
Subscription
# Ref. https://github.com/operator-framework/operator-lifecycle-manager
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: my-devconsole
namespace: openshift-operators
spec:
channel: alpha
name: devconsole
source: my-catalog
sourceNamespace: openshift-operator-lifecycle-manager
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 25 / 36
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 26 / 36
OpenShift CI
OpenShift CI automates and simplifies the process of building and testing
OpenShift component images
OpenShift CI is run using ci-operator (This is not a Kubernetes operator)
ci-operator is built using Kubernetes prow
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 27 / 36
Setup operator resources without OLM
Create a temporary namespace/project
Create all the CRDs
Create service account
Create role
Create role binding
Run the test
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 28 / 36
Setup operator resources without OLM
.PHONY: test-e2e-ci
test-e2e-ci: get-test-namespace ./vendor
$(Q)oc new-project $(TEST_NAMESPACE)
$(Q)-oc apply -f ./deploy/crds/devconsole_v1alpha1_component_crd.yaml
$(Q)-oc apply -f ./deploy/crds/devconsole_v1alpha1_gitsource_crd.yaml
$(Q)-oc apply -f ./deploy/crds/devconsole_v1alpha1_gitsourceanalysis_crd
$(Q)-oc apply -f ./deploy/service_account.yaml --namespace $(TEST_NAMESP
$(Q)-oc apply -f ./deploy/role.yaml --namespace $(TEST_NAMESPACE)
$(Q)sed -e 's|REPLACE_NAMESPACE|$(TEST_NAMESPACE)|g' ./deploy/test/role_
$(Q)sed -e 's|REPLACE_IMAGE|registry.svc.ci.openshift.org/$
{OPENSHIFT_BUILD_NAMESPACE}/stable:devconsole-operator|g'
./deploy/test/operator_test.yaml | oc apply -f - --namespace $(TEST_NA
$(eval DEPLOYED_NAMESPACE := $(TEST_NAMESPACE))
$(Q)operator-sdk test local ./test/e2e --namespace
$(TEST_NAMESPACE) --no-setup --go-test-flags "-v -timeout=15m"
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 29 / 36
Setup operator resources with OLM
Create catalog source
Create subscription
Run the test
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 30 / 36
Setup operator resources with OLM
.PHONY: test-e2e-olm-ci
test-e2e-olm-ci: ./vendor
$(Q)sed -e "s,REPLACE_IMAGE,registry.svc.ci.openshift.org/
${OPENSHIFT_BUILD_NAMESPACE}/stable:devconsole-operator-registry,"
./test/e2e/catalog_source_OS4.yaml | oc apply -f -
$(Q)oc apply -f ./test/e2e/subscription_OS4.yaml
$(Q)./hack/check-crds.sh
$(Q)operator-sdk test local ./test/e2e --no-setup
--go-test-flags "-v -timeout=15m"
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 31 / 36
OpenShift CI Configuration
base_images:
operator-registry:
name: "4.0"
namespace: ocp
tag: operator-registry
images:
- from: operator-registry
dockerfile_path: openshift-ci/Dockerfile.registry.intermediate
to: operator-registry-base
- from: operator-registry-base
dockerfile_path: openshift-ci/Dockerfile.registry.build
to: devconsole-operator-registry
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 32 / 36
File: openshift-ci/Dockerfile.registry.intermediate
FROM quay.io/openshift/origin-operator-registry:latest
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 33 / 36
File: openshift-ci/Dockerfile.registry.build
FROM quay.io/openshift/origin-operator-registry:latest
ARG version=0.1.0
COPY manifests manifests
COPY deploy/crds/*.yaml manifests/devconsole/${version}/
RUN sed -e "s,REPLACE_IMAGE,registry.svc.ci.openshift.org/
${OPENSHIFT_BUILD_NAMESPACE}/stable:devconsole-operator,"
-i manifests/devconsole/${version}/devconsole-operator.v${version}
.clusterserviceversion.yaml
RUN initializer
USER 1001
EXPOSE 50051
CMD "registry-server", "--termination-log=log.txt"
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 34 / 36
https://github.com/redhat-developer/devconsole-operator
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 35 / 36
Thank You!
bmuthuka@redhat.com
avsharma@redhat.com
Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 36 / 36

More Related Content

What's hot

Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10MagaliDavidCruz
 
kubernetes operators
kubernetes operatorskubernetes operators
kubernetes operatorsJuraj Hantak
 
Openshift: The power of kubernetes for engineers - Riga Dev Days 18
Openshift: The power of kubernetes for engineers - Riga Dev Days 18Openshift: The power of kubernetes for engineers - Riga Dev Days 18
Openshift: The power of kubernetes for engineers - Riga Dev Days 18Jorge Morales
 
Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...
Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...
Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...Red Hat Developers
 
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - PirosOpenbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - PirosOpenbar
 
Helm - Package Manager for Kubernetes
Helm - Package Manager for KubernetesHelm - Package Manager for Kubernetes
Helm - Package Manager for KubernetesKnoldus Inc.
 
Automated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesAutomated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesGraham Dumpleton
 
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Wojciech Barczyński
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
OpenShift and next generation application development
OpenShift and next generation application developmentOpenShift and next generation application development
OpenShift and next generation application developmentSyed Shaaf
 
Leveraging CI/CD to improve open stack operation
Leveraging CI/CD to improve open stack operationLeveraging CI/CD to improve open stack operation
Leveraging CI/CD to improve open stack operationMaría Angélica Bracho
 
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...Puppet
 
OpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformOpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformKangaroot
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel Red Hat Developers
 
OpenShift Taiwan Vol.1 Technology Overview
OpenShift Taiwan Vol.1 Technology OverviewOpenShift Taiwan Vol.1 Technology Overview
OpenShift Taiwan Vol.1 Technology OverviewJason Peng
 
Kubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkKubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkRed Hat Developers
 
Docker Meetup - Melbourne 2015 - Kubernetes Deep Dive
Docker Meetup - Melbourne 2015 - Kubernetes Deep DiveDocker Meetup - Melbourne 2015 - Kubernetes Deep Dive
Docker Meetup - Melbourne 2015 - Kubernetes Deep DiveKen Thompson
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 

What's hot (20)

Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10
 
kubernetes operators
kubernetes operatorskubernetes operators
kubernetes operators
 
Openshift: The power of kubernetes for engineers - Riga Dev Days 18
Openshift: The power of kubernetes for engineers - Riga Dev Days 18Openshift: The power of kubernetes for engineers - Riga Dev Days 18
Openshift: The power of kubernetes for engineers - Riga Dev Days 18
 
Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...
Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...
Developer joy for distributed teams with CodeReady Workspaces | DevNation Tec...
 
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - PirosOpenbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
 
Helm - Package Manager for Kubernetes
Helm - Package Manager for KubernetesHelm - Package Manager for Kubernetes
Helm - Package Manager for Kubernetes
 
Automated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesAutomated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and Kubernetes
 
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
OpenShift and next generation application development
OpenShift and next generation application developmentOpenShift and next generation application development
OpenShift and next generation application development
 
Leveraging CI/CD to improve open stack operation
Leveraging CI/CD to improve open stack operationLeveraging CI/CD to improve open stack operation
Leveraging CI/CD to improve open stack operation
 
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
 
OpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformOpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platform
 
OpenShift Enterprise
OpenShift EnterpriseOpenShift Enterprise
OpenShift Enterprise
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
 
DevOps @ OpenShift Online
DevOps @ OpenShift OnlineDevOps @ OpenShift Online
DevOps @ OpenShift Online
 
OpenShift Taiwan Vol.1 Technology Overview
OpenShift Taiwan Vol.1 Technology OverviewOpenShift Taiwan Vol.1 Technology Overview
OpenShift Taiwan Vol.1 Technology Overview
 
Kubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkKubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech Talk
 
Docker Meetup - Melbourne 2015 - Kubernetes Deep Dive
Docker Meetup - Melbourne 2015 - Kubernetes Deep DiveDocker Meetup - Melbourne 2015 - Kubernetes Deep Dive
Docker Meetup - Melbourne 2015 - Kubernetes Deep Dive
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 

Similar to Test your Kubernetes operator with Operator Lifecycle Management

Quo Vadis Netflix Stack?
Quo Vadis Netflix Stack?Quo Vadis Netflix Stack?
Quo Vadis Netflix Stack?Fabian Keller
 
Policy Enforcement on Kubernetes with Open Policy Agent
Policy Enforcement on Kubernetes with Open Policy AgentPolicy Enforcement on Kubernetes with Open Policy Agent
Policy Enforcement on Kubernetes with Open Policy AgentVMware Tanzu
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott AndrewsVMware Tanzu
 
SDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and ConcourseSDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and ConcourseVMware Tanzu
 
Mastering Microservices with Kong (CodeMotion 2019)
Mastering Microservices with Kong (CodeMotion 2019)Mastering Microservices with Kong (CodeMotion 2019)
Mastering Microservices with Kong (CodeMotion 2019)Maarten Mulders
 
Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019
Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019
Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019Codemotion
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoringOracle Korea
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringDonghuKIM2
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in DepthOPNFV
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)Tsuyoshi Miyake
 
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operatorsJS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operatorsDevOps_Fest
 
Simplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataSimplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataVMware Tanzu
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트Amazon Web Services Korea
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트) Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfAmazon Web Services
 
DevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps.com
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8sVMware Tanzu
 
Spring Cloud on Kubernetes
Spring Cloud on KubernetesSpring Cloud on Kubernetes
Spring Cloud on KubernetesVMware Tanzu
 
CNCF App-Delivery SIG Presentation - Litmus Chaos Engineering
CNCF App-Delivery SIG Presentation - Litmus Chaos EngineeringCNCF App-Delivery SIG Presentation - Litmus Chaos Engineering
CNCF App-Delivery SIG Presentation - Litmus Chaos EngineeringUmasankar Mukkara
 

Similar to Test your Kubernetes operator with Operator Lifecycle Management (20)

Quo Vadis Netflix Stack?
Quo Vadis Netflix Stack?Quo Vadis Netflix Stack?
Quo Vadis Netflix Stack?
 
Policy Enforcement on Kubernetes with Open Policy Agent
Policy Enforcement on Kubernetes with Open Policy AgentPolicy Enforcement on Kubernetes with Open Policy Agent
Policy Enforcement on Kubernetes with Open Policy Agent
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott Andrews
 
SDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and ConcourseSDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and Concourse
 
Mastering Microservices with Kong (CodeMotion 2019)
Mastering Microservices with Kong (CodeMotion 2019)Mastering Microservices with Kong (CodeMotion 2019)
Mastering Microservices with Kong (CodeMotion 2019)
 
Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019
Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019
Maarten Mulders - Mastering Microservices with Kong - Codemotion Amsterdam 2019
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in Depth
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
 
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operatorsJS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
JS Fest 2019. Peter Braun. DevOps in the Cluster: A deep dive into operators
 
Simplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataSimplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring Data
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트) Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
DevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast Track
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8s
 
Spring Cloud on Kubernetes
Spring Cloud on KubernetesSpring Cloud on Kubernetes
Spring Cloud on Kubernetes
 
CNCF App-Delivery SIG Presentation - Litmus Chaos Engineering
CNCF App-Delivery SIG Presentation - Litmus Chaos EngineeringCNCF App-Delivery SIG Presentation - Litmus Chaos Engineering
CNCF App-Delivery SIG Presentation - Litmus Chaos Engineering
 

Recently uploaded

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

Test your Kubernetes operator with Operator Lifecycle Management

  • 1. Test your Kubernetes operator with OLM Baiju Muthukadan Avni Sharma May 15, 2019 Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 1 / 36
  • 2. About Us Baiju is a Senior Software Engineer Avni is an Associate Software Engineer Both of us work on DevConsole Operator Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 2 / 36
  • 3. Problem Statement As a development team, we need to run end-to-end test for our operator. To run end-to-end test, we need a mechanism to setup the infrastructure which includes the operator deployment and other dependent resources (CRDs, service account, role, and role binding). Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 3 / 36
  • 4. Agenda Introduction to Operator Framework Setting up resources through Operator Lifecycle Manager (OLM) for e2e testing Running e2e test through OpenShift CI Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 4 / 36
  • 5. DevConsole Operator Provides a developer-focused view in OpenShift 4 Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 5 / 36
  • 6. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 6 / 36
  • 7. Operator Framework A toolkit to manage Kubernetes native applications, called Operators. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 7 / 36
  • 9. Operator Framework Parts https://github.com/operator-framework Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 9 / 36
  • 10. Operator Lifecycle Manager (OLM) Oversees operator: Installation Updates Lifecycle Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 10 / 36
  • 12. Catalog Source Repository of Cluster Service Version (CSV) files and CRDs Two types gRPC Internal (based on ConfigMap) Public repository: https://www.operatorhub.io To create a custom gRPC use this base image: quay.io/openshift/origin-operator-registry:latest Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 12 / 36
  • 13. File: manifests/devconsole/0.1.0/devconsole- operator.v0.1.0.clusterserviceversion.yaml apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: annotations: capabilities: Full Lifecycle description: The operator that enables a developer-focused perspective categories: "Developer Tools" name: devconsole-operator.v0.1.0 namespace: placeholder spec: apiservicedefinitions: {} customresourcedefinitions: ... Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 13 / 36
  • 14. Manifests directory structure manifests/ └── devconsole ├── 0.1.0 │   ├── devconsole-operator.v0.1.0.clusterserviceversion.yaml │   ├── devconsole_v1alpha1_component_crd.yaml │   ├── devconsole_v1alpha1_gitsourceanalysis_crd.yaml │   └── devconsole_v1alpha1_gitsource_crd.yaml └── devconsole.package.yaml Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 14 / 36
  • 15. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 15 / 36
  • 16. Dockerfile to create registry FROM quay.io/openshift/origin-operator-registry:latest ARG image=quay.io/redhat-developer/devconsole-operator ARG version=0.1.0 COPY manifests manifests COPY deploy/crds/*.yaml manifests/devconsole/${version}/ USER root RUN sed -e "s,REPLACE_IMAGE,${image}," -i manifests/devconsole/${version}/devconsole-operator.v${version}. clusterserviceversion.yaml USER 1001 RUN initializer CMD "registry-server", "--termination-log=log.txt" Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 16 / 36
  • 17. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 17 / 36
  • 18. Manifests directory structure manifests/ └── devconsole ├── 0.1.0 │   ├── devconsole-operator.v0.1.0.clusterserviceversion.yaml │   ├── devconsole_v1alpha1_component_crd.yaml │   ├── devconsole_v1alpha1_gitsourceanalysis_crd.yaml │   └── devconsole_v1alpha1_gitsource_crd.yaml └── devconsole.package.yaml Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 18 / 36
  • 19. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 19 / 36
  • 20. CatalogSource # Ref. https://github.com/operator-framework/operator-lifecycle-manager apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: my-catalog namespace: openshift-operator-lifecycle-manager spec: sourceType: grpc image: REPLACE_IMAGE displayName: Community Operators publisher: Red Hat Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 20 / 36
  • 21. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 21 / 36
  • 22. Subscription Keep CSVs up to date by tracking a channel in a package. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 22 / 36
  • 23. File: manifests/devconsole/devconsole.package.yaml packageName: devconsole channels: - name: alpha currentCSV: devconsole-operator.v0.1.0 Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 23 / 36
  • 24. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 24 / 36
  • 25. Subscription # Ref. https://github.com/operator-framework/operator-lifecycle-manager apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: my-devconsole namespace: openshift-operators spec: channel: alpha name: devconsole source: my-catalog sourceNamespace: openshift-operator-lifecycle-manager Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 25 / 36
  • 26. Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 26 / 36
  • 27. OpenShift CI OpenShift CI automates and simplifies the process of building and testing OpenShift component images OpenShift CI is run using ci-operator (This is not a Kubernetes operator) ci-operator is built using Kubernetes prow Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 27 / 36
  • 28. Setup operator resources without OLM Create a temporary namespace/project Create all the CRDs Create service account Create role Create role binding Run the test Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 28 / 36
  • 29. Setup operator resources without OLM .PHONY: test-e2e-ci test-e2e-ci: get-test-namespace ./vendor $(Q)oc new-project $(TEST_NAMESPACE) $(Q)-oc apply -f ./deploy/crds/devconsole_v1alpha1_component_crd.yaml $(Q)-oc apply -f ./deploy/crds/devconsole_v1alpha1_gitsource_crd.yaml $(Q)-oc apply -f ./deploy/crds/devconsole_v1alpha1_gitsourceanalysis_crd $(Q)-oc apply -f ./deploy/service_account.yaml --namespace $(TEST_NAMESP $(Q)-oc apply -f ./deploy/role.yaml --namespace $(TEST_NAMESPACE) $(Q)sed -e 's|REPLACE_NAMESPACE|$(TEST_NAMESPACE)|g' ./deploy/test/role_ $(Q)sed -e 's|REPLACE_IMAGE|registry.svc.ci.openshift.org/$ {OPENSHIFT_BUILD_NAMESPACE}/stable:devconsole-operator|g' ./deploy/test/operator_test.yaml | oc apply -f - --namespace $(TEST_NA $(eval DEPLOYED_NAMESPACE := $(TEST_NAMESPACE)) $(Q)operator-sdk test local ./test/e2e --namespace $(TEST_NAMESPACE) --no-setup --go-test-flags "-v -timeout=15m" Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 29 / 36
  • 30. Setup operator resources with OLM Create catalog source Create subscription Run the test Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 30 / 36
  • 31. Setup operator resources with OLM .PHONY: test-e2e-olm-ci test-e2e-olm-ci: ./vendor $(Q)sed -e "s,REPLACE_IMAGE,registry.svc.ci.openshift.org/ ${OPENSHIFT_BUILD_NAMESPACE}/stable:devconsole-operator-registry," ./test/e2e/catalog_source_OS4.yaml | oc apply -f - $(Q)oc apply -f ./test/e2e/subscription_OS4.yaml $(Q)./hack/check-crds.sh $(Q)operator-sdk test local ./test/e2e --no-setup --go-test-flags "-v -timeout=15m" Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 31 / 36
  • 32. OpenShift CI Configuration base_images: operator-registry: name: "4.0" namespace: ocp tag: operator-registry images: - from: operator-registry dockerfile_path: openshift-ci/Dockerfile.registry.intermediate to: operator-registry-base - from: operator-registry-base dockerfile_path: openshift-ci/Dockerfile.registry.build to: devconsole-operator-registry Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 32 / 36
  • 33. File: openshift-ci/Dockerfile.registry.intermediate FROM quay.io/openshift/origin-operator-registry:latest Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 33 / 36
  • 34. File: openshift-ci/Dockerfile.registry.build FROM quay.io/openshift/origin-operator-registry:latest ARG version=0.1.0 COPY manifests manifests COPY deploy/crds/*.yaml manifests/devconsole/${version}/ RUN sed -e "s,REPLACE_IMAGE,registry.svc.ci.openshift.org/ ${OPENSHIFT_BUILD_NAMESPACE}/stable:devconsole-operator," -i manifests/devconsole/${version}/devconsole-operator.v${version} .clusterserviceversion.yaml RUN initializer USER 1001 EXPOSE 50051 CMD "registry-server", "--termination-log=log.txt" Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 34 / 36
  • 35. https://github.com/redhat-developer/devconsole-operator Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 35 / 36
  • 36. Thank You! bmuthuka@redhat.com avsharma@redhat.com Baiju Muthukadan, Avni Sharma Test your Kubernetes operator with OLM May 15, 2019 36 / 36