<?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 cloud @viadee on Medium]]></title>
        <description><![CDATA[Stories by cloud @viadee on Medium]]></description>
        <link>https://medium.com/@cloud-viadee?source=rss-7d8374791fdd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rQKhlXsXY_DZVReTCc0_og.jpeg</url>
            <title>Stories by cloud @viadee on Medium</title>
            <link>https://medium.com/@cloud-viadee?source=rss-7d8374791fdd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 20 Jun 2026 10:08:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cloud-viadee/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[REST-API-Roundtrip with SpringDoc and OpenAPI Generator]]></title>
            <link>https://cloud-viadee.medium.com/rest-api-roundtrip-with-springdoc-and-openapi-generator-30bd27ccf698?source=rss-7d8374791fdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/30bd27ccf698</guid>
            <category><![CDATA[springdoc]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[openapi-generator]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[open-api]]></category>
            <dc:creator><![CDATA[cloud @viadee]]></dc:creator>
            <pubDate>Tue, 16 Feb 2021 20:52:54 GMT</pubDate>
            <atom:updated>2021-06-12T05:26:06.173Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mRuH_5DBqABz2MQK.jpg" /></figure><p>It is a no-brainer to provide JSON REST endpoints in a Spring Boot application, just like many state-of-the-art frameworks. Just include the Spring Boot Web Starter as a dependency, define a class annotated with @RestController, and implement at least one method annotated with @RequestMapping (or a specific annotation) as a handler for HTTP requests.</p><p>However, in a full API lifecycle, there is more to be done. In this article, we introduce an <strong>automated tool chain</strong> that helps <strong>professionalize Spring Boot </strong><a href="https://www.viadee.de/seminar/api-design-und-management"><strong>REST API development</strong></a><strong> and automates a lot of manual efforts</strong>.</p><h4>Code-First But with a specification</h4><p>In the API community, much like any traditional type of interface, it is often discussed whether to start with an interface specification and implement the rendering API afterwards (API-Design-First) or to generate the specification from the implementation (Code-First). Both approaches are justifiable. In this article, we will focus on the use cases with a <strong>code-first approach</strong>, as is often done with Spring Boot.</p><p>The figure below illustrates that with a code-first approach, first, a Spring Boot application is set up (1), then, REST endpoints and implicitly an API is created (2). Sometimes an API documentation is written, for example, according to the OpenAPI standard (3) and occasionally an API client is created as well (4).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/0*QOf9N0Vyuq5g-JaO.png" /></figure><h4>Example: User API</h4><p>As an case for this article, we provide a User API example project. This services as a reference for the presented tool chain and will likely support you in setting up the tool chain for your own context.</p><p>The API allows to create, update, and query users. For this purpose, REST operations are provided in an HTTP compliant manner using GET, POST, PUT or DELETE.</p><p>While relevant code snippets are included below, the code for the complete case is publicly available on GitHub: <a href="https://github.com/viadee/api-roundtrip-spring-boot">https://github.com/viadee/api-roundtrip-spring-boot</a></p><h3>API-Roundtrip — The Full-Service-Package</h3><p>In this article, we refer to an API roundtrip as the <strong>development of a complete API package</strong> including the following artifacts:</p><ul><li><em>REST-API</em><br>The API itself</li><li><em>API-Documentation</em><br>An API documentation as an OpenAPI specification</li><li><em>API-Client</em><br>A client for using the API that can be easily integrated in an application</li><li><em>Integration Tests</em><br>That automatically test the functionality of the API after deployment, for instance, in a test environment</li></ul><h4>Status Quo</h4><p>It is fairly established for other interface types such as SOAP or CORBA to provide documentation (WSDL) and pre-built clients. However, such artifacts are far from being common for REST APIs. A significant reason for this is the lack of established automation - or at least the established automation not being commonly known.</p><p>Nowadays, tools such as Postman, SOAP UI or REST Assured are often used for integration tests. They all have allowances for sending JSON requests to a REST API.</p><p>Because of a necessity of creating and maintaining JSON requests as well as checks for the resulting JSON responses, this often results in high manual effort compared to the original API development.</p><p><strong>Often, even a small adjustment in the Spring boot application involves a high manual and often annoying effort considering the overall package.</strong></p><h4>Automation thanks to SpringDoc and OpenApi Generator</h4><p>For an effective REST API development improving the status quo, an automated tool chain providing capabilities, at least known from using SOAP and CORBA, is desirable. On one hand, this <strong>automates repetitive manual tasks</strong>, on the other hand, this <strong>resolves the media break in the integration test development</strong>.</p><p>The latter is achieved when integration tests are <strong>implemented in Java</strong>, like the Spring Boot application itself.</p><p>The following illustration provides an overview of the tool chain we describe in this article.</p><p>First, an OpenAPI documentation is generated using SpringDoc based on the Spring Boot REST API implementation. In the second step, appropriate client code and integration test code is generated with OpenAPI Generator facilitating the API documentation.</p><p>Of course, implementing the actual test logic still requires manual effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/0*WDKh06_PMY5URXJH.png" /></figure><p>In detail, the tool chain consists of the following components:</p><ul><li><a href="https://www.viadee.de/seminar/spring-core-und-boot-schulung/"><em>Spring Boot</em></a><em><br></em>Implements the REST-API (1)</li><li><em>SpringDoc<br></em>Generates the API documentation as an OpenAPI specification and a Swagger UI facilitating the Spring Boot application infrastructure. (2)</li><li><em>OpenAPI<br></em>Generates the code for API client(s) and integration tests from the OpenAPI specification generated by SpringDoc. (3)</li><li><em>Maven<br></em>Orchestrates and executes the tools respectively with their concurring plugins. Of course, a similar chain can be built with Gradle.</li><li><em>Integration Tests<br></em>The integration test execution depends on the concrete environment. In this article, we provide an example, where integration tests are triggered with Maven within a deployment pipeline after the deployment itself. (4)</li></ul><h3>API-Roundtrip — The Tool Chain in a Nutshell</h3><h4>Spring Boot API Implementation</h4><p>The User API is defined by an interface with corresponding spring annotations. The method names should be chosen with care. By default, they will be used as operationID in the OpenAPI Spec and through this, define the method names of the generated API clients.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a997a7bf3ea3b50ed4280ba8897f4929/href">https://medium.com/media/a997a7bf3ea3b50ed4280ba8897f4929/href</a></iframe><p>It is recommended to explicitly <strong>specify a @ResponseStatus</strong> as this will automatically result in a cleaner OpenAPI generation later.</p><p>The API interface is implemented by a Spring @RestController. For the sake of simplicity, we implemented the storage of the user data with a non-persistent HashMap.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acb0693604d9d5c8e18cede44a174b71/href">https://medium.com/media/acb0693604d9d5c8e18cede44a174b71/href</a></iframe><p>Finally, Maven dependencies must be added in the pom file and a @SpringBootApplication must be created and started. This is necessary to send a first request to the API via <a href="http://localhost:8080/api/users">http://localhost:8080/api/users</a> .</p><p>Up to this point, this is a simple Spring Boot infrastructure. The actual tool chain for our API roundtrip starts from here.</p><h4>API Documentation Generation</h4><p>With SOAP Web Services, it is quite common to provide a WSDL and get it automatically generated by the web service infrastructure. However, this is not yet available out-of-the-box for REST APIs.</p><p><strong>SpringDoc fills this gap</strong> by automatically generating an OpenAPI specification and Swagger-UI online documentation by processing the Spring Boot infrastructure and providing additional configuration capabilities.</p><p>To be able to process SpringDoc in your own application, the following Maven-Dependency is sufficient as it indirectly refers the SpringDoc core as well:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bdc778ac731ac6892daa7bfd10d2eef/href">https://medium.com/media/2bdc778ac731ac6892daa7bfd10d2eef/href</a></iframe><p>This means that a Swagger UI can be reached immediately after a (new) start of the Spring Boot application: <a href="http://localhost:8080/swagger-ui.html">http://localhost:8080/swagger-ui.html</a></p><p>An OpenAPI specification can also be retrieved: <a href="http://localhost:8080/v3/api-docs">http://localhost:8080/v3/api-docs</a></p><p>Both types of documentation can be extensively configured and supplemented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*H3kHVz_UotnSHPp7.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/0*41iaB06b_FXPm-Sc.png" /></figure><p>SpringDoc provides various annotations, such as the @OpenAPIDefinition, for enriching the content of the API documentation as shown in the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbcc5536f2b1cbaff5addb476fd5dc33/href">https://medium.com/media/dbcc5536f2b1cbaff5addb476fd5dc33/href</a></iframe><p>It is recommendation to add the server specification at this point. Later, during the OpenAPI file generation, the API will be started on a random free port and without explicitly specifying it here, a rather unfamiliar PORT specification will end up in the API specification.</p><p>Of course, if the final URL of the API endpoint is already known, it should be entered here.</p><p>If the JSON of the OpenAPI specification need to be formatted by a “pretty-printer” with indentations and line breaks, the following configuration should be added in the Spring Boot application.properties or yaml file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/16acca7bdbe7d186e917eede1689de8c/href">https://medium.com/media/16acca7bdbe7d186e917eede1689de8c/href</a></iframe><p>If needed, the URLs of the Swagger UI and the OpenAPI documentation can be set under the actuator or any other context.</p><p>Finally, the OpenAPI specification must be stored as a local file to make it accessible for the client code generation later. SpringDoc comes with a Maven plugin for this step and through this, it provides more convenience compared to similar tools such as Spring Fox.</p><p>In a typical Spring Boot configuration, entire dependencies are loaded and resolved at runtime only and thus, a running application is needed by the SpringDoc Maven plugin. The plugin downloads the OpenAPI specification from the URL mentioned above.</p><p>To get this working, the SpringDoc Maven plugin is configured in the Maven “integration test” phase as shown in the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ed6ac1b1335210b75cdaa55d35eb70a/href">https://medium.com/media/0ed6ac1b1335210b75cdaa55d35eb70a/href</a></iframe><p>In addition to the URL for downloading the OpenAPI specification, the target file can also be defined via outputFileName and outputDir parameters. We omitted these parameters in the example, so the file is written by default to target/openapi.json.</p><p>To ensure that the Spring Boot application can successfully be launched for the “integration test” phase, we first determine a free port using the codehaus build-helper-maven-plugin. The free port is then configured in the spring-boot-maven-plugin in the “pre-integration-test” phase to start the Spring Boot application (&lt;goal&gt;start&lt;/goal&gt;) and stop it during the “post-integration-test” phase (&lt;goal&gt;stop&lt;/goal&gt;).</p><p>The dynamic port selection ensures that the Maven tool chain works, even if an application is already running on the standard port 8080.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4258e92734d44e64e4d8e52860a42b86/href">https://medium.com/media/4258e92734d44e64e4d8e52860a42b86/href</a></iframe><p>Now, the first step of generating an API documentation is done. Next, we will focus on generating the code for the API client and integration tests.</p><h4>API Client And Integrationstest Generation</h4><p>OpenAPI specifications provide a detailed interface description which is sufficient to implement valid requests to the API endpoints. OpenAPI Generator is an quite active and mature open-source tool for generating code and other artifacts based on these specifications. We use it in the roundtrip tool chain for generating code that encapsulates the REST API calls as easy-to-use Java interfaces.</p><p>OpenAPI Generator was derived (forked) from the Swagger Code Gen project aiming at a significantly lighter and faster development. The versions released so far, and the active community of the OpenAPI Generator conform to the founder’s goal.</p><p>Meanwhile, there are over 130 different code generators, for both client and server implementations, as well as for documentation and other API and data formats such as GraphQL or protobuf.</p><p>OpenAPI comes with a Maven plugin, so the code generation can be integrated in the overall workflow straight away. A plugin for Gradle is available, too. The following example shows a concurrent Maven plugin configuration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e15ab096c77e005f6fdb205e50822e9f/href">https://medium.com/media/e15ab096c77e005f6fdb205e50822e9f/href</a></iframe><p>This example shows a plugin configuration using the Java code generator with the java8 DateLibrary option, generating date data fields as java.util.LocalDate.</p><p>In addition, the various packages for the target code are set and the generator is configured to generate only the client source code and no further documentation or Gradle and Maven artifacts.</p><p>Unfortunately, in the current version of OpenAPI Generator, the infrastructure classes to be generated still need to be specified because a feature request for a “Client Code only” setting is still open.</p><p>To combine the code generation with the previous generation of the OpenAPI specification, there are two things to consider:</p><ol><li>In the parent maven module, the api sub-module must be placed in before the client/integration test sub-modules</li><li>The code generator’s path of the OpenAPI specification (&lt;inputSpec&gt;) must refer to the previously downloaded specification</li></ol><p>To compile a Java client code generated with the “native” OpenAPI Generator setting, a few dependencies are required.</p><p>We provide a minimal configuration for this as a part of the example application on GitHub: <a href="https://github.com/viadee/api-roundtrip-spring-boot/blob/main/client/pom.xml#L24">https://github.com/viadee/api-roundtrip-spring-boot/blob/main/client/pom.xml</a></p><h4>Integration test Execution</h4><p>If the integration tests are generated in addition to the pure client code, one valid strategy is to implement them as unit tests, but running them separately with the Maven failsafe and not with the classic surefire plugin. The whole setup becomes even more practical if the integration tests are in a separate maven module, which specifies extra rules such as not bundling integration tests with the overall application.</p><p>The failsafe plugin is a part of the well-established surefire plugin but its runs in the Maven integration-tests phase by default.</p><p>By default, the failsafe plugin comes with a name filter specifying the unit test classes to be executed. The following code example extends the name filter for the integration tests according to the pattern “*IntegrationTest.java”:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/faa51771345e5d6edb2bdcdfb5ab0971/href">https://medium.com/media/faa51771345e5d6edb2bdcdfb5ab0971/href</a></iframe><p>Additionally, the following Maven configuration ensures that the integration tests are not run by the surefire plugin during the normal testing phase and the integration test code is neither deployed nor installed in the Maven repository.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/79d1a1f1045f592f5842a41de74b821a/href">https://medium.com/media/79d1a1f1045f592f5842a41de74b821a/href</a></iframe><p>In the sample project provided on GitHub, we have encapsulated the integration test execution in a separate profile to gain even more control when we want to run it within a deployment pipeline.</p><h3>Conclusion</h3><p>REST APIs have been adopted widely because of their simplicity. However, this simplicity also comes with many challenges, especially for maintenance and sustainability.</p><p>The OpenAPI standard pushed REST API development and management to a new level and the generators and integrations based on it, promise ways out of the maintenance dilemma.</p><p>The tool chain presented in the article is <strong>entirely based on free and standard tools</strong> and takes advantage of the sophisticated Spring Boot infrastructure for REST APIs. Similar automations can also be created with frameworks such as Quarkus and Micronaut, as well as for clients in other languages such as JavaScript or Python.</p><p>For those who actively want to extend their <strong>professional expertise in API development and API management</strong>, we think it’s worth looking at OpenAPI, SpringDoc, and OpenAPI Generator.</p><p><strong>Modern APIs are standalone products that significantly enable completely new digital business models and processes</strong>. The increasingly conscious handling of high-quality APIs helps to tap this great potential.</p><p>Similarly, automation, such as the tool chain presented in the article, helps to develop new quality standards with significantly less manual effort.</p><p>Furthermore, <a href="https://www.viadee.de/seminar/api-design-und-management"><strong>OpenAPI specifications</strong></a><strong> provide the base for many other use cases such as </strong><a href="https://www.viadee.de/seminarkategorie/cloud/"><strong>public or private API directories</strong></a><strong> or API quality analysis</strong> for better, more homogeneous API products.</p><p><em>Are your striving to professionalize your API development? I am happy to discuss your thoughts and questions with you. Just write me an </em><a href="mailto:benjamin.klatt@viadee.de"><em>email</em></a><em> or get in touch on </em><a href="https://www.linkedin.com/in/dr-benjamin-klatt-4680081/"><em>LinkedIn</em></a><em>.</em></p><figure><img alt="Dr. Benjamin Klatt, viadee" src="https://cdn-images-1.medium.com/max/1024/1*6VyGd49T-Ia998wyLtXilg.jpeg" /></figure><p><a href="mailto:benjamin.klatt@viadee.de">Dr. Benjamin Klatt</a> is an Integration Architect and Agile Coach.</p><p>His focus is on the digitization of Products and <a href="https://www.viadee.de/en/solutions/business-process-management">Processes</a>, <a href="https://www.viadee.de/en/solutions/java/">Integration Architectures</a> and <a href="https://www.viadee.de/en/solutions/agile-methods/">Agile Methods</a>.</p><p><em>Originally published at </em><a href="https://blog.viadee.de/en/rest-api-roundtrip"><em>https://blog.viadee.de</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30bd27ccf698" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring the Docker Hub Rate Limit with Prometheus (Guide)]]></title>
            <link>https://cloud-viadee.medium.com/monitoring-the-docker-hub-rate-limit-with-prometheus-ba35fc0eaf52?source=rss-7d8374791fdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba35fc0eaf52</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-monitoring]]></category>
            <dc:creator><![CDATA[cloud @viadee]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 13:44:50 GMT</pubDate>
            <atom:updated>2020-11-26T13:50:32.650Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*92UkxV0pHY_XSNLy.jpg" /></figure><p>Recently, Docker introduced rate-limiting for the Docker Hub image registry. It restricts unauthenticated docker pull requests to 100 requests per 6-hour timeframe and authenticated requests from a free account to 200 requests per 6-hour timeframe (see <a href="https://www.docker.com/increase-rate-limits">here</a>).</p><p>While there are plenty of ways to mitigate the impact of these limits on your development lifecycle and infrastructure, we still need a way to monitor the available requests for our infrastructure. Gitlab published a lightweight solution in their <a href="https://about.gitlab.com/blog/2020/11/18/docker-hub-rate-limit-monitoring/">blogpost</a>.</p><p>We took their work one step further and created a <strong>Docker image and Helm chart based on their script</strong>. Both allow you to easily install the docker-hub-rate-limit-exporter script into your Kubernetes cluster.</p><p>By the way, it’s Open Source and<a href="https://github.com/viadee/docker-hub-rate-limit-exporter"> you can find all code on GitHub</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_ccRoju5Ip0IQwFPVq0CQ.png" /></figure><p>The helm chart supports the monitoring of unauthenticated requests and authenticated request to Docker Hub and offers an easy integration with the Prometheus Kubernetes operator. If you follow the guide described here, you will be rewarded with a Grafana-Dashboard that lets you monitor your remaining docker-hub pull requests as can be seen in the image above.</p><h3>The Problem</h3><p>If you exceed your Docker Hub rate limit quota, you will be greeted with one of the following errors messages the next time you attempt a docker pull request:</p><p><strong>ERROR: toomanyrequests: Too Many Requests.</strong></p><p>or</p><p><strong>You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: </strong><a href="https://www.docker.com/increase-rate-limits."><strong>https://www.docker.com/increase-rate-limits.</strong></a></p><p>To avoid getting caught by surprise by those error messages, we suggest using a monitoring solution as described below.</p><h3>Prerequisites</h3><p>This guide assumes that you have a running Kubernetes cluster with the Prometheus Operator and Grafana installed. Moreover, you need sufficient privileges to create Helm releases in your Kubernetes cluster.</p><h3>Installing the Helm chart</h3><p>To install the Helm chart into your cluster, you simply run the following commands:</p><pre>$ git clone <a href="https://github.com/viadee/docker-hub-rate-limit-exporter.git">https://github.com/viadee/docker-hub-rate-limit-exporter.git</a></pre><pre>$ helm install docker-hub-rate-limit-exporter/chart --namespace=&lt;desired namespace&gt;</pre><p>This creates a Helm release with the given name in the designated namespace. You can verify that everything works smoothly by port-forwarding the pod that was created:</p><pre>$ kubectl port-forward 8080:80 -n &lt;namespace&gt;</pre><p>Once the port-forward is configured, you can open your browser and navigate to <a href="http://localhost/">http://localhost:8080</a>. Here you will find a set of default metrics along with two metrics that correspond to your Docker Hub rate limit. These are:</p><ul><li><strong>max_requests_total:</strong> The maximum number of requests you are allowed to do within the 6-hour timeframe.</li><li><strong>remaining_requests_total:</strong> The remaining requests based on your limit and the already sent requests. If this number reaches zero, you are rate-limited in the current timeframe.</li></ul><h3>Configuring the Prometheus Service Monitor</h3><p>Next, we need to tell our Prometheus instance to scrap the metrics which are exposed by the deployment in the Helm chart. To do so, we can make use of the ServiceMonitor Custom resource that comes with the Kubernetes Prometheus operator:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa635b786d584b6926cfe36f2fb25fd9/href">https://medium.com/media/aa635b786d584b6926cfe36f2fb25fd9/href</a></iframe><p>Save the above code snipped into a file called serviceMonitor.yaml and apply it to your Kubernetes cluster with the following command:</p><pre>$ kubectl apply -f serviceMonitor.yaml -n &lt;your namespace&gt;</pre><p>If you choose to install the ServiceMonitor into the same namespace as your Helm release, you can omit the namespaceSelector blog in the manifest. If not, you additionally have to provide the namespace into which your Helm release was installed. Moreover, you may need to add further labels to your ServiceMonitor depending on your Prometheus configuration.</p><h3>Configure Docker Hub Credentials</h3><p>If you have a Docker Hub account and use it to pull images from the registry, you need to configure the Helm chart with those credentials, too. Otherwise, only the unauthenticated rate limit from your IP address will be monitored and not the limit of your Docker Hub account. You can configure the Helm chart to use your Docker credentials by providing additional parameters:</p><pre>$ helm upgrade docker-hub-rate-limit-exporter/chart --namespace=&lt;desired namespace&gt; --install \<br>--set config.dockerhubUsername=&lt;you dockerhub username&gt; \<br>--set config.dockerhubPassword=&lt;Your dockerhub access token&gt;</pre><p>Alternatively, you can create a values.yaml file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f440179697500e7b2914c59fa2db4759/href">https://medium.com/media/f440179697500e7b2914c59fa2db4759/href</a></iframe><p>and install the Helm release into your cluster with the following command:</p><pre>$ helm upgrade docker-hub-rate-limit-exporter/chart -f values.yaml --namespace=&lt;desired namespace&gt; --install</pre><h3>Creating the Grafana Dashboard</h3><p>Lastly, we need to configure a Grafana Dashboard to visualize the remaining Docker Hub rate limit. Gitlab created a nice-looking dashboard for that purpose which can be used here. You can find the configuration of that dashboard <a href="https://gitlab.com/gitlab-com/marketing/corporate_marketing/developer-evangelism/code/docker-hub-limit-exporter/-/blob/main/example/docker-compose/example-data/dashboards/docker-hub-rate-limits-dashboard.json">here</a>.</p><p>Simply copy the contents of the linked file and create a new Grafana dashboard. You can do so by following the following steps:</p><ol><li>Navigate to your Grafana instance.</li><li>Click on Dashboards and then import.</li><li>Paste the copied Dashboard json and click on Load.</li></ol><p>Congratulations, you are ready to monitor your Docker Hub rate limit! Feel free to <a href="https://github.com/viadee/docker-hub-rate-limit-exporter"><strong>visit the GitHub repository</strong></a> and get involved. It’s Open Source and ready to help everyone out there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*7V43RStjBv1lm2iChvMDLA.jpeg" /></figure><p><a href="mailto:marius.stein@viadee.de">Marius Stein</a> is IT consultant at viadee and is part of the competence center <a href="https://www.viadee.de/en/solutions/cloud"><em>Cloud Architectures</em></a>. He is focused on developing and operating scalable, reliable and secure cloud native solutions.</p><p><em>Originally published at </em><a href="https://blog.viadee.de/en/monitoring-the-docker-hub-rate-limit-with-prometheus"><em>https://blog.viadee.de</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba35fc0eaf52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitOps for IT-Architects: Transparent and Secure Kubernetes deployments]]></title>
            <link>https://cloud-viadee.medium.com/gitops-for-it-architects-6312e7822819?source=rss-7d8374791fdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6312e7822819</guid>
            <category><![CDATA[it-architecture]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[cloud @viadee]]></dc:creator>
            <pubDate>Wed, 04 Nov 2020 14:24:12 GMT</pubDate>
            <atom:updated>2020-11-04T14:24:12.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Ko5dRlvjfNUOJ0cVHCLMQ.png" /></figure><p>Agile Software Development principles have gained more and more attention in recent years. They help making product teams more flexible and productive. However, to fully leverage the potential of agility in software development projects, you also need an agile operations model and embrace DevOps principles. GitOps follows modern DevOps principles and allows for secure, fast and reliable deployments.</p><p><strong>DevOps is not about losing control</strong></p><p>Our work with various clients tells us that many IT-Architects wrongly believe that following DevOps principles leads to a loss of control, especially regarding how IT operations are done. More often than not we hear that the operation and development teams need to be strictly separated. Automation along this interface (e.g. Continuous Delivery / Deployment) appears to be difficult because it topples security and neglects auditing and approval requirements.</p><p>In this blogpost, we will demonstrate how GitOps can be used to automate deployments while still maintaining approval processes and auditing mechanisms and allowing for a high degree of security.</p><p><strong>Continuous Integration and Delivery to implement DevOps paradigms</strong></p><p>Before we delve deeper into the concept of GitOps, it is crucial to understand what DevOps actually is. The term DevOps is a combination of the terms <em>Development</em> and <em>Operations</em>, emphasizing the close collaboration between the two tasks — a requirement for a flexible and agile software development lifecycle. <strong>The core idea of DevOps is to enable a fast, yet flexible process for the development, integration and deployment of applications. </strong>To achieve such a process, heavy automation along each step of the software development lifecycle is crucial. Continuous Integration and Continuous Delivery / Deployment are two principles to achieve this kind of automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*7se8_pf9bNFqN8P6rBDYMw.png" /></figure><p>The principle of <strong><em>Continuous Integration (CI)</em> </strong>suggests that code is automatically built and tested as soon as a commit is pushed to the applications repository. Thus, <strong>CI enables the software development team to find bugs early by failing tests or builds in the CI pipeline</strong>. CI is a well adopted approach and there is a myriad of tools supporting it.</p><p><strong><em>Continuous Delivery / Deployment</em> (CD) relates to automation along the release and deployment process of the software development lifecycle.</strong> Although often taken for the same, there is a slight yet important difference between Continuous Delivery and Continuous Deployment. <br><em>Continuous Delivery</em> describes the state of being ready to release a certain version of your application to production (or any other environment) at any time by just the single click of a button. On the contrary, <em>Continuous Deployment </em>describes the process of automatically deploying each commit, which results in a successful build, to a certain environment (which can be the development, QA or production environment).</p><p><strong>Are you already using CD pipelines?</strong></p><p>Although we find that CI mechanisms are widely adopted, we see that CD mechanisms are frowned upon by many IT-Architects for the reasons mentioned above. Large organizations make heavy use of CI yet fall back on a manual process for the deployment to QA and production environments. Not only does this introduce human errors in the deployment process but it also slows down the process. To avoid these impediments, we propose GitOps to stay in control of automatic deployments to any environment while allowing for a custom approval process and seamless auditability.</p><p><strong>GitOps to improve transparency</strong></p><p><strong>GitOps allows to operate deployments to a Kubernetes cluster only by commits to a git repository.</strong> The git repository (also called state repository) acts as the single source of truth for the state of your application landscape. Whenever your application landscape is to be changed, this is done through one or more commits to the state repository. By utilizing Merge / Pull Request features that come with most commonly used source control systems, it is possible to implement any approval process required in a company. Once the approval is given for the changes, GitOps suggests automatic deployments to the desired environment.</p><p>By using git as the single source of truth for the application landscape, every change is automatically recorded in the git history. This allows for <strong>seamless auditability</strong> with regard to who made what changes at what time. Furthermore, having your application landscape historized allows for <strong>quick rollbacks to previous versions</strong> of your landscape. Going back is as easy as reverting to a previous git commit and pushing that change to the state repository of your application.</p><p><strong>CNCF recommends Flux</strong></p><p>If you are orchestrating your application landscape through Kubernetes,<strong> </strong><a href="https://justgetflux.com/"><strong>Flux CD</strong></a><strong> is a daemon that runs inside your Kubernetes cluster and is responsible for synchronizing a GitOps state repository with the cluster.</strong> Whenever Flux CD detects a discrepancy between the current state of your Kubernetes cluster and the state that is defined in the state repository, it will update the cluster to eliminate the difference. The figure below illustrates the GitOps operations model with Flux CD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*fgf_vlL5au3xjXzXkowOlA.png" /><figcaption>GitOps operations model with Flux CD (https://github.com/fluxcd/flux )</figcaption></figure><p>With GitOps, a developer commits the configuration of a Kubernetes cluster (Kubernetes .yaml files) to the state repository instead of applying it directly to the Kubernetes cluster. This allows for <strong>approval processes via Merge / Pull Requests </strong>and historizes every state of the Kubernetes cluster to enable seamless auditing. Next, Flux CD is responsible for picking up the changes from the state repository and applying it to the cluster.</p><p>One important difference to other operation models is that Flux CD, which runs inside the Kubernetes cluster, actually pulls the changes from the state repository instead of the state repository pushing changes to the cluster. This allows for a <strong>higher level of security</strong> since we do not need to give administrative privileges to the state repository outside of the cluster. In fact, we could disallow any write operation to the Kubernetes cluster from outside of the cluster. It would even be possible to further maximize security by not exposing the Kubernetes API endpoint at all.</p><p>Another benefit of Flux CD is that it allows you to <strong>synchronize one state repository with any number of Kubernetes clusters</strong>. Thus, the GitOps model allows to manage an IT landscape compromised of many Kubernetes clusters by one or more state repositories. Moreover, as the whole configuration of your application landscape is defined in git, it is easy to redeploy your landscape to a new Kubernetes cluster in case there are issues with the current one.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fo_io7zhG52U%3Fstart%3D2%26feature%3Doembed%26start%3D2&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Do_io7zhG52U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fo_io7zhG52U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/29c2b0b56ea9d034772f672841143188/href">https://medium.com/media/29c2b0b56ea9d034772f672841143188/href</a></iframe><p><strong>Take away</strong></p><p><strong>All in all, GitOps is a modern CD principle that fulfils the requirements for auditing, approval processes and security.</strong> If you want to learn more about GitOps, check out our <a href="https://justgetflux.com/">recorded Websession</a> where we go into more detail with the concept of DevOps, CI / CD, GitOps and Flux CD — including a live demonstration that showcases a typical GitOps workflow.</p><p><em>Are your using GitOps in your organization or planning to do so? I am happy to discuss your thoughts and questions with you. Just write me an </em><a href="mailto:marius.stein@viadee.de"><em>email</em></a><em> or get in touch on </em><a href="https://www.linkedin.com/in/marius-stein-2074bb137/"><em>LinkedIn</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*7V43RStjBv1lm2iChvMDLA.jpeg" /></figure><p><a href="mailto:marius.stein@viadee.de">Marius Stein</a> is IT consultant at viadee and is part of the competence center <a href="https://www.viadee.de/en/solutions/cloud"><em>Cloud Architectures</em></a>. He is focused on developing and operating scalable, reliable and secure cloud native solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6312e7822819" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>