<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mita</title>
    <description>The latest articles on DEV Community by mita (@omichiki1).</description>
    <link>https://dev.to/omichiki1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F447826%2F3855fe95-2570-4b35-ae37-24302f6506ee.jpg</url>
      <title>DEV Community: mita</title>
      <link>https://dev.to/omichiki1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/omichiki1"/>
    <language>en</language>
    <item>
      <title>[Kubernetes Operator] The point about the integration of operator-sdk and kubebuilder</title>
      <dc:creator>mita</dc:creator>
      <pubDate>Thu, 06 Aug 2020 12:39:36 +0000</pubDate>
      <link>https://dev.to/omichiki1/kubernetes-operator-the-point-about-the-integration-of-operator-sdk-and-kubebuilder-1m28</link>
      <guid>https://dev.to/omichiki1/kubernetes-operator-the-point-about-the-integration-of-operator-sdk-and-kubebuilder-1m28</guid>
      <description>&lt;h1&gt;
  
  
  Operator-sdk command structure changed from v0.19.0 (2020/7 release)
&lt;/h1&gt;

&lt;p&gt;Because the command structure of Go-based Operator is now along the lines of kubebuilder, existing commands are no longer passed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;operator-sdk new osushi-operator &lt;span class="nt"&gt;--repo&lt;/span&gt; github.com/iaoiui/osushi
Error: unknown flag: &lt;span class="nt"&gt;--repo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The version of operator-sdk is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;❯ operator-sdk version
operator-sdk version: &lt;span class="s2"&gt;"v0.19.2"&lt;/span&gt;, commit: &lt;span class="s2"&gt;"4282ce9acdef6d7a1e9f90832db4dc5a212ae850"&lt;/span&gt;, kubernetes version: &lt;span class="s2"&gt;"v1.18.2"&lt;/span&gt;, go version: &lt;span class="s2"&gt;"go1.14.5 darwin/amd64"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you check the Operatorframework documentation below, prior to v0.19.0, it was called “Legacy" and instructed to refer to a other document.&lt;/p&gt;

&lt;p&gt;There seems to be a lot of changes, but it seems that the subcommand to create the first template has been changed from “new" to “init" and there is an error that there is no --repo option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sdk.operatorframework.io/docs/golang/quickstart/"&gt;Golang Based Operator Quickstart&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I was able to handle it by replacing the “new"  with "init".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;operator-sdk init osushi-operator &lt;span class="nt"&gt;--repo&lt;/span&gt; github.com/iaoiui/osushi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;According to the release information for operator-sdk, v0.19.0 will be released in July, 2020, so almost all books will need to be replaced with new command structure of operator-sdk.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/operator-framework/operator-sdk/releases/tag/v0.19.0"&gt;https://github.com/operator-framework/operator-sdk/releases/tag/v0.19.0&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Background on Operator-sdk and kubebuilder's Go-based Operator integration
&lt;/h1&gt;

&lt;p&gt;There are two major frameworks for creating Kubernetes Operators, operator-sdk and kubebuilder, each of which has been maintained by different communities.&lt;/p&gt;

&lt;p&gt;Both tools could do operator scaffolding (template generation) using Go, and although the directories and files created were different, the purpose of what they could achieve was the same.&lt;/p&gt;

&lt;p&gt;Since we are doing the same thing with both tools, our motivation has been to reduce maintenance costs and speed up development by integrating them.&lt;/p&gt;

&lt;p&gt;In concrete terms, since operator SDK has various functions related to Go Operator, the contributor on operator SDK side will take the lead in merging those functions into kubebuilder side.&lt;/p&gt;

&lt;p&gt;In other words, I'm guessing it was settled in a way that smells a bit of politics, with kubebuilder as the upstream and operator sdk acting as a wrapper for kubebuilder.&lt;/p&gt;

&lt;p&gt;It will merge operator sdk documents to kubebuilder and maintain kubebuilder as well.&lt;/p&gt;

&lt;p&gt;Reference: &lt;a href="https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/integrating-kubebuilder-and-osdk.md"&gt;kubebuilder's design documentation on the integration of kubebuilder and operator-sdk&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The PR on the change of CLI in operator-sdk
&lt;/h1&gt;

&lt;p&gt;As indicated in operator-sdk's &lt;a href="%5Bhttps://github.com/operator-framework/operator-sdk/pull/3190%5D(https://github.com/operator-framework/operator-sdk/pull/3190)"&gt;PR(#3190)&lt;/a&gt;, &lt;strong&gt;Operator for Go is now in line with the Kubebuilder CLI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wbSjni_Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/94861/df4410ae-0623-1d0c-99bf-bcff88fbaf11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wbSjni_Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/94861/df4410ae-0623-1d0c-99bf-bcff88fbaf11.png" alt="Untitled.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For that reason, the command has changed since 0.19.0, and the previous command is Legacy  now.&lt;/p&gt;

&lt;p&gt;In particular, note that the files generated by the operator-sdk command have changed entirely and it would be faster to got the point by forgetting the legacy operator-sdk.&lt;/p&gt;

&lt;p&gt;It's safer to avoid specifying particular books, but I purchased the following books yesterday and will read it while taking into account the background on integration.&lt;br&gt;
&lt;a href="https://www.amazon.co.jp/%E5%AE%9F%E8%B7%B5%E5%85%A5%E9%96%80-Kubernetes%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC%E3%81%B8%E3%81%AE%E9%81%93-%E6%8A%80%E8%A1%93%E3%81%AE%E6%B3%89%E3%82%B7%E3%83%AA%E3%83%BC%E3%82%BA%EF%BC%88NextPublishing%EF%BC%89-%E7%A3%AF-%E8%B3%A2%E5%A4%A7/dp/4844378546"&gt;The Road to Custom Controller&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is also great book "&lt;a href="https://www.amazon.co.jp/%E2%BB%98%E2%BC%AD%E7%9C%9F%E4%B9%9F/dp/4295009792/ref=pd_sbs_14_4/358-3368657-0445345?_encoding=UTF8&amp;amp;pd_rd_i=4295009792&amp;amp;pd_rd_r=c596e921-6755-4482-8463-ccc5c1ef3ec5&amp;amp;pd_rd_w=V0iNB&amp;amp;pd_rd_wg=KKhVK&amp;amp;pf_rd_p=4acc31d7-eae8-4ee9-8e37-275fb9bc20c2&amp;amp;pf_rd_r=Q0E23M0BTBQEKAWSTTHY&amp;amp;psc=1&amp;amp;refRID=Q0E23M0BTBQEKAWSTTHY"&gt;Kubernetes perfect guide 2nd edition&lt;/a&gt;" which is the 2nd edition of kubernetes perfect guide, which I recently read.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;As the use of Kubernetes Operator becomes more and more widespread, the integration of similar frameworks will reduce the amount of time spent on choosing tools for first-time users, which is a very positive development trend.&lt;/li&gt;
&lt;li&gt;To be precise, it's not a complete integration of the operator creation for Helm and Ansible based Operator but Go-based.
It is clear that they want to make operator-sdk wrapper because the function relationship will be operator-sdk&amp;gt;kubebuilder.&lt;/li&gt;
&lt;li&gt;Anyway, it's a problem for the user side if the command changes many times, so we'll continue to keep a close eye on developments.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kubernetes</category>
      <category>operator</category>
      <category>kubebuilder</category>
      <category>operatorsdk</category>
    </item>
  </channel>
</rss>
