Skip to content

Commit

Permalink
deploy: 70cf602
Browse files Browse the repository at this point in the history
  • Loading branch information
aghilish committed May 14, 2024
1 parent ebcf5a6 commit 8321310
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
25 changes: 24 additions & 1 deletion print.html
Original file line number Diff line number Diff line change
Expand Up @@ -4217,7 +4217,10 @@ <h2 id="using-our-functions-in-the-reconcile-loop"><a class="header" href="#usin
kubectl apply -f config/samples/blog_v1_ghost.yaml
</code></pre>
<p>We start to see our reconciliation logs showing up and our subresources being created. We can inspect them by running <code>k9s</code>.
We can perform a portforward on the service to see our ghost application in a browser.</p>
We can perform a portforward on the service to see our ghost application in a browser.
Let's have a look at our ghost resource as well.</p>
<pre><code class="language-shell">kubectl describe -n marketing ghosts.blog.example.com ghost-sample
</code></pre>
<h2 id="updating-the-ghost-resource"><a class="header" href="#updating-the-ghost-resource">Updating the ghost resource</a></h2>
<p>let us perform an update on our resource and use the <code>alpine</code> image tag instead of <code>latest</code>.
So, let us replace <code>config/samples/blog_v1_ghost.yaml</code> with the following and apply it.</p>
Expand All @@ -4241,6 +4244,26 @@ <h2 id="deleting-the-ghost-resource"><a class="header" href="#deleting-the-ghost
<p>We can see all the subresources are deleted.</p>
<pre><code class="language-shell">kubectl get all -n marketing
</code></pre>
<h2 id="deploying-the-operator-to-kubernetes"><a class="header" href="#deploying-the-operator-to-kubernetes">Deploying the Operator to Kubernetes</a></h2>
<p>Your operator is an application, so it needs to be packaged as a OCI compliant container image just like any other container you want to deploy.</p>
<p>We need to run the right make command to build our OCI image and then Deploy it.</p>
<p>Build</p>
<pre><code class="language-shell"># please use your own tag here! :D
export IMG=c8n.io/aghilish/ghost-operator:latest
make docker-build
</code></pre>
<p>Push</p>
<pre><code class="language-shell">make docker-push
</code></pre>
<p>Deploy</p>
<pre><code class="language-shell">make deploy
</code></pre>
<p>Undeploy</p>
<pre><code class="language-shell">make deploy
</code></pre>
<p>And we can look around and inspect the logs of our manager when we CRUD operations with our ghost API.</p>
<pre><code class="language-shell">kubectl get all -n ghost-operator-system
</code></pre>
<h1 id="serverless"><a class="header" href="#serverless">Serverless</a></h1>
<h1 id="100days-resources-25"><a class="header" href="#100days-resources-25">100Days Resources</a></h1>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

25 changes: 24 additions & 1 deletion tutorials/extending-k8s.html
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,10 @@ <h2 id="using-our-functions-in-the-reconcile-loop"><a class="header" href="#usin
kubectl apply -f config/samples/blog_v1_ghost.yaml
</code></pre>
<p>We start to see our reconciliation logs showing up and our subresources being created. We can inspect them by running <code>k9s</code>.
We can perform a portforward on the service to see our ghost application in a browser.</p>
We can perform a portforward on the service to see our ghost application in a browser.
Let's have a look at our ghost resource as well.</p>
<pre><code class="language-shell">kubectl describe -n marketing ghosts.blog.example.com ghost-sample
</code></pre>
<h2 id="updating-the-ghost-resource"><a class="header" href="#updating-the-ghost-resource">Updating the ghost resource</a></h2>
<p>let us perform an update on our resource and use the <code>alpine</code> image tag instead of <code>latest</code>.
So, let us replace <code>config/samples/blog_v1_ghost.yaml</code> with the following and apply it.</p>
Expand All @@ -960,6 +963,26 @@ <h2 id="deleting-the-ghost-resource"><a class="header" href="#deleting-the-ghost
</code></pre>
<p>We can see all the subresources are deleted.</p>
<pre><code class="language-shell">kubectl get all -n marketing
</code></pre>
<h2 id="deploying-the-operator-to-kubernetes"><a class="header" href="#deploying-the-operator-to-kubernetes">Deploying the Operator to Kubernetes</a></h2>
<p>Your operator is an application, so it needs to be packaged as a OCI compliant container image just like any other container you want to deploy.</p>
<p>We need to run the right make command to build our OCI image and then Deploy it.</p>
<p>Build</p>
<pre><code class="language-shell"># please use your own tag here! :D
export IMG=c8n.io/aghilish/ghost-operator:latest
make docker-build
</code></pre>
<p>Push</p>
<pre><code class="language-shell">make docker-push
</code></pre>
<p>Deploy</p>
<pre><code class="language-shell">make deploy
</code></pre>
<p>Undeploy</p>
<pre><code class="language-shell">make deploy
</code></pre>
<p>And we can look around and inspect the logs of our manager when we CRUD operations with our ghost API.</p>
<pre><code class="language-shell">kubectl get all -n ghost-operator-system
</code></pre>

</main>
Expand Down

0 comments on commit 8321310

Please sign in to comment.