<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sharath Vutpala on Medium]]></title>
        <description><![CDATA[Stories by Sharath Vutpala on Medium]]></description>
        <link>https://medium.com/@sharathvutpala?source=rss-c42b0473401e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lURUEeGc0l-B0DYl.jpg</url>
            <title>Stories by Sharath Vutpala on Medium</title>
            <link>https://medium.com/@sharathvutpala?source=rss-c42b0473401e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 05:29:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sharathvutpala/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I automated BuildConfigs and ImageStreams in OpenShift]]></title>
            <link>https://levelup.gitconnected.com/how-i-automated-buildconfigs-and-imagestreams-in-openshift-dd9745c4ea8f?source=rss-c42b0473401e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd9745c4ea8f</guid>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[buildconfig]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sharath Vutpala]]></dc:creator>
            <pubDate>Fri, 03 Nov 2023 13:07:38 GMT</pubDate>
            <atom:updated>2023-11-15T13:50:58.371Z</atom:updated>
            <content:encoded><![CDATA[<p>OpenShift Container Platform supports the BuildConfig object which can be used to transform input parameters or source code into a runnable image by using the Build objects and different build strategies.</p><p>There are three primary build strategies available:</p><ul><li>Docker build</li><li>Source-to-Image(S2I) build</li><li>Custom build</li></ul><p>For Docker and S2I builds, the resulting objects are runnable images, and for the Custom builds we can specify the resulting object.</p><p>In this story, I would like to focus on only Docker Builds and how I automated rolling out deployments to an application that requires an Image built from two different Git repositories.</p><h4>Application Overview</h4><p>We are using GitHub self-hosted runners on the OpenShift Container Platform for an Opensource project, and we are using a Helm Chart to deploy these runners. A different BitBucket private repository is being used to track changes related to the helm chart and custom configuration required for self-hosted runner deployment on OCP.</p><p>There are two different Dockerfiles — one in GitHub which contains application-specific dependencies and another one in BitBucket with all custom configurations required to make the Docker Image as a Self-Hosted runner on OpenShift Platform.</p><h4>BuildConfig for Application Dockerfile</h4><p>As the application Dockerfile is in a public repository in GitHub, I have created a BuildConfig with the following configuration.</p><p>Before creating the BuildConfig, we need to create the following objects in OpenShift.</p><ol><li>An Image stream in the same namespace, with the name app-image</li></ol><pre>kind: ImageStream<br>apiVersion: image.openshift.io/v1<br>metadata:<br>  name: app-image<br>  namespace: github-self-hosted-runners</pre><p>2. A secret in OpenShift which we need to use in constructing the webhook URL</p><pre>kind: Secret<br>apiVersion: v1<br>metadata:<br>  name: github-webhook-secret<br>  namespace: github-self-hosted-runners<br>data:<br>  WebHookSecretKey: &lt;BASE64_ENCODED_SECRET_VALUE&gt;<br>type: Opaque<br></pre><p>We can either create these objects using the web UI or from the oc command line tool</p><p>Once we create these objects, we can create BuildConfig with the below configuration</p><p>oc apply -f app-buildconfig.yaml</p><pre>#app-buildconfig.yaml<br>kind: BuildConfig<br>apiVersion: build.openshift.io/v1<br>metadata:<br>  name: app-image<br>  namespace: github-self-hosted-runners<br>spec:<br>  output:<br>    to:<br>      kind: ImageStreamTag<br>      name: &#39;app-image:latest&#39;<br>  resources: {}<br>  successfulBuildsHistoryLimit: 5<br>  failedBuildsHistoryLimit: 5<br>  strategy:<br>    type: Docker<br>    dockerStrategy: {}<br>  postCommit: {}<br>  source:<br>    type: Git<br>    git:<br>      uri: &gt;-<br>        https://github.com/&lt;GITHUB_ORG&gt;/&lt;GITHUB_REPO&gt;<br>      ref: &lt;GITHUB_BRANCH&gt;<br>  triggers:<br>    - type: ConfigChange<br>    - type: GitHub<br>      github:<br>        secretReference:<br>          name: github-webhook-secret<br>  runPolicy: Serial</pre><p>Since the repo is public, I did not use any password/access_token in the URI field, but if the repo is private, the URI looks like this:</p><p><a href="https://sharathvutpala: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@github.com/Crypto-TII/claasp"><em>https://&lt;USERNAME&gt;:&lt;ACCESS_TOKEN&gt;@github.com/&lt;GITHUB_ORG&gt;/&lt;</em></a><em>GITHUB_REPO&gt;</em></p><p>As we are using Docker as our Build Strategy, this config will look for a Dockerfile at the root of the repository and start building the image by executing the instructions specified in the Dockerfile</p><p><strong>Triggers</strong></p><p>I used two triggers in this BuildConfig</p><ol><li>ConfigChange — this will trigger a new build when the BuildConfig is created for the first time</li><li>GitHub — This will trigger the BuildConfig as per the webhook we define in our GitHub repository. We can control what type of events will trigger a new build</li></ol><p><strong>Creating a WebHook in GitHub</strong></p><p>I have created a webhook in the GitHub repository</p><ul><li>Payload URL: After creating the BuildConfig, a webhook URL is created and we can retrieve it using the below command</li></ul><p>oc describe buildconfig app-image</p><p>It looks like this: <a href="https://api.ocp.crypto.tii.ae:6443/apis/build.openshift.io/v1/namespaces/github-runner-tii-claasp/buildconfigs/claasp-image/webhooks/">https://&lt;OPENSHIFT_API_ENDPOINT/apis/build.openshift.io/v1/namespaces/NAMESPACE&gt;/buildconfigs/app-image/webhooks/</a>&lt;secret&gt;/github</p><blockquote>NOTE: Replace the &lt;secret&gt; with the secret value that we created in the first step</blockquote><ul><li>Content type: application/json</li><li>Secret — We can leave this blank as this is used for verifying the authenticity of the payload</li><li>Enable SSL Verification — By default SSL certificates are verified when delivering payloads, we can disable this when using Self-Signed Certificates</li><li>Events — We need to select what events can trigger the webhook</li></ul><h4>BuildConfig for GitHub Runner Dockerfile</h4><p>In the second stage, I created another BuildConfig object for building a Docker Image for the GitHub Self-Hosted runner pod. A new build for this configuration is triggered whenever there is a new application image is built.</p><p>Similar to the previous BuildConfig, we need to create an ImageStream, to use in the spec.output section.</p><pre>kind: ImageStream<br>apiVersion: image.openshift.io/v1<br>metadata:<br>  name: runner-image<br>  namespace: github-self-hosted-runners</pre><p>I used another trigger type, ImageChange in this BuildConfig to run a build when an image is pushed to app-image:latest Imagestream</p><p>As the source repository for this BuildConfig is a Private BitBucker repo, I created a secret with a BitBucket username/password.</p><p><em>We can also use another authentication mechanism like SSH keys, and Access Tokens, but I used a username/password</em></p><pre>kind: Secret<br>apiVersion: v1<br>metadata:<br>  name: bitbucket-repo-access<br>  namespace: github-self-hosted-runners<br>data:<br>  password: &lt;BASE64_ENCODED_PASSWORD&gt;<br>  username: &lt;BASE64_ENCODED_USERNAME&gt;<br>type: kubernetes.io/basic-auth</pre><pre>kind: BuildConfig<br>apiVersion: build.openshift.io/v1<br>metadata:<br>  name: runner<br>  namespace: github-self-hosted-runners<br>spec:<br>  output:<br>    to:<br>      kind: ImageStreamTag<br>      name: &#39;runner-image:latest&#39;<br>  resources: {}<br>  successfulBuildsHistoryLimit: 5<br>  failedBuildsHistoryLimit: 5<br>  strategy:<br>    type: Docker<br>    dockerStrategy:<br>      from:<br>        kind: ImageStreamTag<br>        name: &#39;app-image:latest&#39;<br>  source:<br>    type: Git<br>    git:<br>      uri: &gt;-<br>        https://&lt;BITBUCKET_USERNAME&gt;@bitbucket.org/&lt;BITBUCKET_PROJECT&gt;/&lt;BITBUCKET_REPO&gt;.git<br>    contextDir: /<br>    sourceSecret:<br>      name: bitbucket-repo-access<br>  triggers:<br>    - type: ImageChange<br>      imageChange: {}<br>  runPolicy: Serial<br></pre><p>As mentioned earlier, ImageChange trigger is used to detect the change in the source image, in this case app-image:latest</p><p>Since my second Docker Image( Runner Image ) depends on the first Docker Image( Application Image )built in the previous step, I left imageChange field as {}</p><blockquote>The most important part of this trigger is that the base image in our Dockerfile definition should be app-image:latest . If our FROM in Dockerfile is a custom Imagestream, we need to define it like this:</blockquote><pre>triggers:<br>  - type: ImageChange<br>    imageChange:<br>      from:<br>        kind: &quot;ImageStreamTag&quot;<br>        name: &quot;custom-image:latest&quot;</pre><h4>Updating Application Container Image automatically</h4><p>This was the most time-consuming part of the whole flow. I faced several issues while making automatic rollover of the deployment whenever the Imagestream for the application was changed.</p><p><strong>Updating the lookup policy of Imagestream</strong></p><ul><li>To userunner-image:latest as an image in the deployment manifest file, first, we need to update the lookup policy of the Imagestream. <br> oc set image-lookup runner-image</li></ul><p>If we don’t set this lookup policy, deployment tries to pull the image from its list of secure registries and cannot pull the Imagestream present in the same namespace</p><ul><li>We can validate the lookup policies of all the Imagestreams in the current namespace with the command mentioned below<br> oc set image-lookup imagestream --list</li></ul><p><strong>Updating the Image Pull Secret in the Service Account</strong></p><p>When an application is using the default service account in a namespace, it can pull Imagestreams from the same namespace as it comes with the default docker config secret ( Image Pull Secret ).</p><p>But, in my application, I was using a non-default service account and deployment could not pull the Imagestream even though it was in the same namespace. In that situation, we need to find out the Default Docker Config Secret and add it to the Service Account manifest file.</p><p>This secret usually looks like default-dockercfg-XXXXX</p><pre>kind: ServiceAccount<br>apiVersion: v1<br>metadata:<br>  name: self-hosted-runner-sa<br>  namespace: github-self-hosted-runners<br>imagePullSecrets:<br>  - name: default-dockercfg-zfnr8</pre><h4>Setting the Image Trigger on OpenShift Deployment Resource</h4><p>As a last step, I updated the Deployment to trigger a RollOut whenever a new Imagestream is created.</p><p>oc set triggers deploy/runner-deployment --from-image=runner-image:latest -c runner</p><h4>Conclusion</h4><p>OpenShift BuildConfigs and Builds offer a robust and flexible solution for building and maintaining containerized applications within the ecosystem. It simplifies the development and deployment process and supports continuous integration and continuous deployment practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd9745c4ea8f" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-i-automated-buildconfigs-and-imagestreams-in-openshift-dd9745c4ea8f">How I automated BuildConfigs and ImageStreams in OpenShift</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing and Configuring Grafana in OpenShift 4.12]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devops.dev/installing-and-configuring-grafana-in-openshift-4-12-f6d725970d65?source=rss-c42b0473401e------2"><img src="https://cdn-images-1.medium.com/max/877/1*cwLkSgEyNLppN2a1w-IYbQ.png" width="877"></a></p><p class="medium-feed-snippet">OpenShift Container Platform installation by default includes a set of monitoring tools for monitoring core OpenShift Container Platform&#x2026;</p><p class="medium-feed-link"><a href="https://blog.devops.dev/installing-and-configuring-grafana-in-openshift-4-12-f6d725970d65?source=rss-c42b0473401e------2">Continue reading on DevOps.dev »</a></p></div>]]></description>
            <link>https://blog.devops.dev/installing-and-configuring-grafana-in-openshift-4-12-f6d725970d65?source=rss-c42b0473401e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6d725970d65</guid>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Sharath Vutpala]]></dc:creator>
            <pubDate>Thu, 26 Oct 2023 13:20:43 GMT</pubDate>
            <atom:updated>2023-10-30T19:03:22.274Z</atom:updated>
        </item>
    </channel>
</rss>