{"id":367260,"date":"2021-11-15T16:00:26","date_gmt":"2021-11-15T13:00:26","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/"},"modified":"2021-11-15T16:00:26","modified_gmt":"2021-11-15T13:00:26","slug":"how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/","title":{"rendered":"#How to Get Started With DevSpace and Rapidly Develop Kubernetes Apps \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a29f3f3d9d46\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a29f3f3d9d46\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Modern_Development_Practices_for_Kubernetes\" >Modern Development Practices for Kubernetes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Installing_DevSpace\" >Installing DevSpace<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Creating_a_Project\" >Creating a Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Adding_an_Image\" >Adding an Image<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Adding_a_Deployment\" >Adding a Deployment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Using_Profiles\" >Using Profiles<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Using_Hot_Reload\" >Using Hot Reload<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Port_Forwarding\" >Port Forwarding<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Other_Features\" >Other Features<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Deployments_In_CICD_Pipelines\" >Deployments In CI\/CD Pipelines<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps-cloudsavvy-it\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Get Started With DevSpace and Rapidly Develop Kubernetes <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">App<\/a>s \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage aligncenter size-full wp-image-14691\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/f1367cd9.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/f1367cd9.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/f1367cd9.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"An illustration showing the DevSpace logo, a cloud with a terminal symbol inside\" width=\"1200\" height=\"675\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\">DevSpace<\/a> is an open-source tool that helps developers quickly deploy cloud-native applications to Kubernetes clusters. It abstracts away much of the traditional Kubernetes complexity so you can get back to writing code.<\/p>\n<p>DevSpace is platform-agnostic and works with clusters ranging from your local machine to popular managed public services. The tool is a CLI that automates operations using Kubernetes APIs. You don\u2019t need to install anything inside your cluster to use DevSpace.<\/p>\n<h2 id=\"modern-development-practices-for-kubernetes\"><span class=\"ez-toc-section\" id=\"Modern_Development_Practices_for_Kubernetes\"><\/span>Modern Development Practices for Kubernetes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DevSpace brings many aspects of the modern app programming experience to Kubernetes-based deployments. It lets you run your development environment on your cluster with support for automatic hot reloading. When a local file changes, DevSpace automatically updates your containers with the new content.<\/p>\n<p>Built-in port forwarding means you can use <code>localhost<\/code> to access your deployment. You don\u2019t need to open ports or setup HTTP Ingresses on development clusters, offering an improved developer experience and greater security.<\/p>\n<figure style=\"width: 1280px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14692\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/71c439ca.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"A diagram showing the DevSpace workflow\" width=\"1280\" height=\"720\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"imagecredit\">DevSpace<\/span><\/figcaption><\/figure>\n<p>DevSpace aids debugging too. It supports setting breakpoints using a Remote Debugger tool, offering live inspection of containerized applications in the cloud. It\u2019s also easy to view a container\u2019s logs or start a terminal session without running unwieldy Kubectl commands.<\/p>\n<p>A web interface running on <code>localhost<\/code> lets you monitor and interact with your running application. You can escape your terminal altogether if you prefer a more visual experience.<\/p>\n<h2 id=\"installing-devspace\"><span class=\"ez-toc-section\" id=\"Installing_DevSpace\"><\/span>Installing DevSpace<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DevSpace is distributed as a self-contained binary that works on Windows, Mac, and Linux systems. Several <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/getting-started\/installation\">installation options<\/a> are available. Here\u2019s the recommended command to download DevSpace for Linux and add the CLI to your path:<\/p>\n<pre>dev&#13;\nsudo install devspace \/usr\/local\/bin<\/pre>\n<p>Alternatively you can use npm, the Node package manager, to install and update DevSpace:<\/p>\n<pre>npm install -g devspace<\/pre>\n<p>This command will give you a functioning <code>devspace<\/code> in your path, provided you\u2019ve already got npm installed.<\/p>\n<p>DevSpace uses your active \u201c<code>KUBE_CONTEXT<\/code>\u201d in the same way as other ecosystem tools like Kubectl and Helm. Set <code>KUBECONFIG<\/code> to a Kubectl-compatible config file defining your cluster connection:<\/p>\n<pre>export KUBECONFIG=\/path\/to\/kubeconfig.yaml&#13;\n&#13;\n# Uses $KUBECONFIG&#13;\ndevspace deploy<\/pre>\n<h2 id=\"creating-a-project\"><span class=\"ez-toc-section\" id=\"Creating_a_Project\"><\/span>Creating a Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The first step in building with DevSpace is to initialize your project directory. This will create a <code>devspace.yaml<\/code> file that holds the DevSpace config for your repository.<\/p>\n<pre>devspace init<\/pre>\n<p>You\u2019ll be prompted to select the deployment routine you plan to use. DevSpace can work with Kubectl, Helm, or Kustomize when launching your app into your cluster.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-14694\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/1932aef7.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Screnshot of the &quot;devspace init&quot; command\" width=\"1168\" height=\"440\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The suggested <code>QUICKSTART<\/code> option is a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/component-chart\/docs\/introduction\">special chart<\/a> that lets you define components of your application, such as your frontend web server, backend API server, and database, instead of supplying manually created Helm charts or Kubectl manifests. Use this if you\u2019re building a system with a conventional structure and don\u2019t want to spent time creating your own Kubernetes resources.<\/p>\n<p>Follow the prompts to supply DevSpace with the path to your Dockerfile. You\u2019ll need to supply registry authentication and some basic information about your image, such as the port it listens on. DevSpace will automatically produce a ready to use config that lets you run <code>devspace deploy<\/code> to get your app live on Kubernetes.<\/p>\n<p>If you don\u2019t use the quickstart option, you\u2019ll need to supply the path to your Helm charts or Kubernetes manifests. Follow the prompts to build an initial configuration. Once you get out of the setup wizard, you can continue adding extra images and deployments by manually editing your <code>devspace.yaml<\/code> file.<\/p>\n<h2 id=\"adding-an-image\"><span class=\"ez-toc-section\" id=\"Adding_an_Image\"><\/span>Adding an Image<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DevSpace projects are built from one or more container images. To register an image in your project, add it under the <code>images<\/code> key in your <code>devspace.yaml<\/code>file:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">images<\/span>:<span class=\"co4\">\n  app<\/span>:<span class=\"co3\">\n    image<\/span><span class=\"sy2\">: <\/span>example.com\/example\/image:latest<span class=\"co3\">\n    dockerfile<\/span><span class=\"sy2\">: <\/span>.\/Dockerfile<span class=\"co4\">\n    build<\/span>:<span class=\"co3\">\n      disabled<\/span><span class=\"sy2\">: <\/span>true<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The <code>image<\/code> field defines the image tag name. The <code>dockerfile<\/code> field is optional; when set, it should reference the path to the image\u2019s Dockerfile in your project. Images with Dockerfiles will be built automatically by the <code>devspace build<\/code> and <code>devspace deploy<\/code> commands, unless <code>build.disabled<\/code> is <code>true<\/code> in the image\u2019s config.<\/p>\n<p>Images are <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/images\/basics\">built in parallel<\/a> to accelerate performance. The <code>--build-sequential<\/code> flag forces images to be built singly in the order they\u2019re specified instead. DevSpace will automatically push each image to its respective registry after a build completes.<\/p>\n<p>Images aren\u2019t rebuilt automatically unless DevSpace detects a change either in their Dockerfile or the files in their build context. You can force a rebuild of all configured images with the <code>--force-build<\/code> flag.<\/p>\n<h2 id=\"adding-a-deployment\"><span class=\"ez-toc-section\" id=\"Adding_a_Deployment\"><\/span>Adding a Deployment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The second piece of a <code>devspace.yaml<\/code> is your <code>deployments<\/code>. These define the resources that will be created inside your cluster.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">deployments<\/span>:<span class=\"co3\">\n  - name<\/span><span class=\"sy2\">: <\/span><span class=\"st0\">\"helm chart\"<\/span><span class=\"co4\">\n    helm<\/span>:<span class=\"co4\">\n      chart<\/span>:<span class=\"co3\">\n        name<\/span><span class=\"sy2\">: <\/span>example\/example-app<span class=\"co4\">\n      values<\/span>:<span class=\"co3\">\n        VARIABLE_OVERRIDE<\/span><span class=\"sy2\">: <\/span><span class=\"st0\">\"new-value\"<\/span><span class=\"co3\">\n  - name<\/span><span class=\"sy2\">: <\/span><span class=\"st0\">\"kubectl manifests\"<\/span><span class=\"co4\">\n    kubectl<\/span>:<span class=\"co4\">\n      manifests<\/span><span class=\"sy2\">:\n<\/span>        - .kube\/manifests<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This file defines two separate deployments, one using Helm and the other Kubectl. When you run <code>devspace deploy<\/code>, both the Helm chart and your Kubectl manifests will be installed in your cluster.<\/p>\n<p>Repeating the <code>deploy<\/code> command will update your deployments. DevSpace only redeploys the components that changed unless the <code>--force-deploy<\/code> flag is used.<\/p>\n<p>As DevSpace works across clusters, promoting your deployment from development to production is a case of changing your <code>KUBECONFIG<\/code> environment variable and re-running <code>devspace deploy<\/code>. This gives you a single consistent mechanism for managing multiple independent deployments of your system.<\/p>\n<h2 id=\"using-profiles\"><span class=\"ez-toc-section\" id=\"Using_Profiles\"><\/span>Using Profiles<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DevSpace supports profiles that let you modify <code>devspace.yaml<\/code> sections for each of your environments. Each named profile can <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/profiles\/basics\">replace, merge, and modify<\/a> fields within your config file.<\/p>\n<p>Profiles themselves are also defined in your <code>devspace.yaml<\/code>:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">images<\/span>:<span class=\"co4\">\n  api-server<\/span>:<span class=\"co3\">\n    image<\/span><span class=\"sy2\">: <\/span>example.com\/api-server:latest<span class=\"co4\">\n  web-server<\/span>:<span class=\"co3\">\n    image<\/span><span class=\"sy2\">: <\/span>example.com\/web-server:latest<span class=\"co4\">\n  debug<\/span>:<span class=\"co3\">\n    image<\/span><span class=\"sy2\">: <\/span>example.com\/debug-tool:latest\n<span class=\"co1\"># ... omitted<\/span><span class=\"co4\">\nprofiles<\/span>:<span class=\"co3\">\n  - name<\/span><span class=\"sy2\">: <\/span>production<span class=\"co4\">\n    patches<\/span>:<span class=\"co3\">\n      - op<\/span><span class=\"sy2\">: <\/span>remove<span class=\"co3\">\n        path<\/span><span class=\"sy2\">: <\/span>images.debug<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Profiles are activated by passing the <code>-p<\/code> or <code>--profile<\/code> flag to DevSpace commands. Here\u2019s how to start a deployment using the <code>production<\/code> profile defined above. The deployment won\u2019t include the <code>debug<\/code> image as it\u2019s removed by one of the profile\u2019s patches.<\/p>\n<pre>devspace deploy --profile production<\/pre>\n<h2 id=\"using-hot-reload\"><span class=\"ez-toc-section\" id=\"Using_Hot_Reload\"><\/span>Using Hot Reload<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The hot reload functionality is enabled by setting up file synchronization:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">dev<\/span>:<span class=\"co4\">\n  sync<\/span>:<span class=\"co3\">\n    - imageSelector<\/span><span class=\"sy2\">: <\/span>example.com\/api-server:latest<span class=\"co3\">\n      localSubPath<\/span><span class=\"sy2\">: <\/span>.\/api\/<span class=\"co3\">\n      containerPath<\/span><span class=\"sy2\">: <\/span>\/var\/www\/html<span class=\"co4\">\n      excludePaths<\/span><span class=\"sy2\">:\n<\/span>        - vendor\/<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Add the <code>dev<\/code> key as a top-level field in your <code>devspace.yaml<\/code>, then use <code>sync<\/code> to configure hot reload on a per-image basis. The <code>imageSelector<\/code> matches image tags to apply the hot reload rule to. Files from <code>localSubPath<\/code> in your working directory will be synchronized to <code>containerPath<\/code> in deployed container instances.<\/p>\n<p>Start a hot reload session by running <code>devspace dev<\/code> or <code>devspace sync<\/code>. The <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/development\/basics\">former command<\/a> starts all DevSpace\u2019s developer environment features, including port forwarding and live log streaming.<\/p>\n<p>Hot reload defaults to replacing files in existing containers. It\u2019s similar to using Docker volumes and bind mounts when working with local container instances. In some scenarios, you might want to start a new DevSpace deployment when your filesystem changes. This is achieved via the separate <code>autoReload<\/code> option:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">images<\/span>:<span class=\"co4\">\n  api<\/span>:<span class=\"co3\">\n    image<\/span><span class=\"sy2\">: <\/span>example.com\/api-server:latest<span class=\"co4\">\ndeployments<\/span>:<span class=\"co3\">\n  - name<\/span><span class=\"sy2\">: <\/span>api-deployment\n  <span class=\"co1\"># ... omitted<\/span><span class=\"co4\">\ndev<\/span>:<span class=\"co4\">\n  autoReload<\/span>:<span class=\"co4\">\n    paths<\/span><span class=\"sy2\">:\n<\/span>      - .\/kernel\/*<span class=\"co4\">\n    images<\/span><span class=\"sy2\">:\n<\/span>      - example.com\/api-server:latest<span class=\"co4\">\n    deployments<\/span><span class=\"sy2\">:\n<\/span>      - api-deployment<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This example will redeploy <code>api-deployment<\/code> whenever files in your local <code>kernel<\/code> directory change. This is ideal when you modify files that need to be run through a build process to make them useful to your containers.<\/p>\n<h2 id=\"port-forwarding\"><span class=\"ez-toc-section\" id=\"Port_Forwarding\"><\/span>Port Forwarding<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Port forwarding is configured via the <code>dev.ports<\/code> field in your <code>devspace.yaml<\/code>. Reverse forwarding is also supported, letting <code>localhost<\/code> addresses in your containers map to ports on your local machine.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><span class=\"co4\">dev<\/span>:<span class=\"co4\">\n  ports<\/span>:<span class=\"co3\">\n    - imageSelector<\/span><span class=\"sy2\">: <\/span>example.com\/api-server:latest<span class=\"co4\">\n      forward<\/span>:<span class=\"co3\">\n        - port<\/span><span class=\"sy2\">: <\/span>8080<span class=\"co3\">\n          remotePort<\/span><span class=\"sy2\">: <\/span>80<span class=\"co4\">\n      reverseForward<\/span>:<span class=\"co3\">\n        - port<\/span><span class=\"sy2\">: <\/span>9000<span class=\"co3\">\n          remote<\/span><span class=\"sy2\">: <\/span>9000<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This example sets up a forward from <code>localhost:8080<\/code> on your machine to port 80 in containers running the <code>example.com\/api-server<\/code> image. There\u2019s also a reverse forward which directs in-container traffic to <code>localhost:9000<\/code> back to port 9000 on your machine.<\/p>\n<h2 id=\"other-features\"><span class=\"ez-toc-section\" id=\"Other_Features\"><\/span>Other Features<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Besides the capabilities covered here, DevSpace also offers support for several other feature groups that let you monitor deployments, interact with containers, and configure advanced development workflows:<\/p>\n<ul>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/development\/terminal\"><strong>Automatic terminal launches<\/strong><\/a> let you start a remote shell session each time you run <code>devspace dev<\/code>.<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/development\/open-links\"><strong>Automatic URL opening<\/strong><\/a> starts websites and web apps in your browser when you enter development mode.<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/development\/log-streaming\"><strong>Configurable logging<\/strong><\/a> defines which containers should appear in the dev mode log stream.<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/commands\/basics\"><strong>Custom commands<\/strong><\/a> act as shortcuts to common actions, helping new team members interact with your deployments without needing to learn lengthy processes in Kubectl.<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/configuration\/hooks\/basics\"><strong>Hooks<\/strong><\/a> run commands during the deployment process, letting you manually configure containers or record new deployments to a centralized monitoring service.<\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/guides\/localhost-ui\"><strong>The user interface<\/strong><\/a> runs automatically in development mode with <code>devspace dev<\/code> and can be opened in your browser using <code>devspace ui<\/code>.<\/li>\n<\/ul>\n<p>DevSpace also offers <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/guides\/plugins\">plugins<\/a> that can add even more functionality to the system. The plugin API supports installation from remote URLs or local scripts and facilitates new commands, hooks, and variables. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/guides\/plugins#developing-a-custom-devspace-plugin\">Developing your own<\/a> plugin provides a way to standardize your use of DevSpace across multiple independent projects.<\/p>\n<h2 id=\"deployments-in-cicd-pipelines\"><span class=\"ez-toc-section\" id=\"Deployments_In_CICD_Pipelines\"><\/span>Deployments In CI\/CD Pipelines<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DevSpace can handle production deployments <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/guides\/ci-cd-integration\">as part of<\/a> your CI\/CD pipeline. It provides an <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hub.docker.com\/r\/devspacesh\/devspace\">official Docker image<\/a> and supports non-interactive use if you include explicit selectors such as <code>-l<\/code> for label in your commands.<\/p>\n<p>A deployment inside a CI pipeline could look like this:<\/p>\n<pre>echo $KUBECONFIG_CI_VARIABLE &gt; \/path\/to\/kubeconfig&#13;\nexport KUBECONFIG=\/path\/to\/kubeconfig&#13;\ndevspace deploy --profile production --timeout 60 --wait --skip-build<\/pre>\n<p>This will deploy your application using the <code>production<\/code> DevSpace profile. The <code>--skip-build<\/code> flag instructs DevSpace not to build your images. Builds should usually be handled as a separate stage earlier in your pipeline.<\/p>\n<p>The <code>--wait<\/code> flag forces DevSpace to wait for availability of the Pod count specified in your <code>devspace.yaml<\/code>, instead of terminating im<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/social-mediaa\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Social Media\" target=\"_blank\" rel=\"noopener\">media<\/a>tely after you run the command. This is more appropriate for a CI environment where you want confirmation that your workload is live. Allowing DevSpace to exit without waiting could mean your pipeline gets marked as successful even if there\u2019s a deployment issue.<\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>DevSpace is gaining traction as a developer-oriented Kubernetes deployment tool that provides useful abstractions for key operations. It reduces the amount of YAML needed to launch containers into a cluster, replacing it with simple config keys and terminal commands that define, build, and start images.<\/p>\n<figure style=\"width: 1392px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14697\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/5d02288b.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The DevSpace UI\" width=\"1392\" height=\"782\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/devspace.sh\/cli\/docs\/guides\/localhost-ui\">DevSpace<\/a><\/span><\/figcaption><\/figure>\n<p>As a platform- and environment-agnostic tool, DevSpace permits developers to worry less about the unique characteristics of individual clusters. Irrespective of deployment target, the overall experience is similar to building a traditional system on your local machine. This helps soften the Kubernetes learning curve by mapping the concepts back to more universally understood development practices.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/14690\/how-to-get-started-with-devspace-and-rapidly-develop-kubernetes-apps\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Get Started With DevSpace and Rapidly Develop Kubernetes Apps \u2013 CloudSavvy IT&#8221; DevSpace is an open-source tool that helps developers quickly deploy cloud-native applications to Kubernetes clusters. It abstracts away much of the traditional Kubernetes complexity so you can get back to writing code. DevSpace is platform-agnostic and works with clusters ranging from&#8230;<\/p>\n","protected":false},"author":1,"featured_media":367261,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/11\/f1367cd9.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-367260","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/367260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=367260"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/367260\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/367261"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=367260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=367260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=367260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}