<?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 Guilherme Garnier on Medium]]></title>
        <description><![CDATA[Stories by Guilherme Garnier on Medium]]></description>
        <link>https://medium.com/@ggarnier?source=rss-44d54b8c4377------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MwB9hFzTvN7EJQcd.jpg</url>
            <title>Stories by Guilherme Garnier on Medium</title>
            <link>https://medium.com/@ggarnier?source=rss-44d54b8c4377------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:45:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ggarnier/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[Configurando um ambiente de staging com Kubernetes e feature flags]]></title>
            <link>https://medium.com/jusbrasil-tech/configurando-um-ambiente-de-staging-com-kubernetes-e-feature-flags-5a201ce9bf6d?source=rss-44d54b8c4377------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a201ce9bf6d</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Guilherme Garnier]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 19:00:32 GMT</pubDate>
            <atom:updated>2020-06-05T19:00:32.855Z</atom:updated>
            <content:encoded><![CDATA[<p>Aqui no Jusbrasil temos uma cultura forte de desenvolvimento: todo código que é escrito passa por um processo de code review, e passa por muitos testes antes de ser liberado para nossos usuários. Mas mesmo após estas etapas, é importante fazer uma última validação antes de subir o código para produção (o ambiente que os usuários tem acesso). Por isso é importante termos um ambiente de staging.</p><p>O ambiente de staging é uma réplica do ambiente de produção. A ideia é que ele seja o mais parecido possível com este, pois no ambiente local, onde desenvolvemos e fazemos os primeiros testes, nem sempre conseguimos reproduzir o mesmo ambiente — alguns serviços são difíceis de executar localmente, outros possuem muitas dependências, e mesmo os que conseguimos executar localmente podem não funcionar da mesma forma em diferentes arquiteturas ou sistemas operacionais.</p><h3>Configurando a infra-estrutura</h3><p>Para criar um ambiente de staging, precisamos inicialmente preparar a infra-estrutura com configurações semelhantes às de produção. A arquitetura da nossa infra-estrutura, de forma simplificada, é como mostra a figura abaixo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*eF0PNb1ZVcYM-Wnv1QWlWg.png" /><figcaption>Arquitetura simplificada</figcaption></figure><p>Quando um usuário acessa jusbrasil.com.br, a requisição passa por um servidor <a href="https://nginx.org/">nginx</a> (que roda dentro de um cluster <a href="https://kubernetes.io/">Kubernetes</a>), e daí é encaminhada para um <a href="https://kubernetes.io/docs/concepts/services-networking/service/">Service</a>. Este componente seleciona os <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/">Pods</a> que respondem pela app, e encaminha a requisição para um deles, como um balanceador de carga.</p><p>A arquitetura que desejamos montar se assemelha à da figura a seguir:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*InNsBFJWmKIiAa7tLZ1sEQ.png" /><figcaption>Arquitetura com ambiente de staging</figcaption></figure><p>Podemos perceber na imagem que agora temos um segundo Service e um segundo conjunto de Pods. Estes novos recursos responderão pelo ambiente de staging. Segue um exemplo fictício de como criá-los:</p><h4>Deployment e Service da <strong>myapp-web</strong> em produção:</h4><pre>apiVersion: v1<br>kind: Deployment<br>metadata:<br>    <strong>name: myapp-web</strong><br>    labels:<br>        app: myapp<br>        <strong>env: production</strong><br>spec:<br>    <strong>replicas: 10</strong><br>    # ...<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>    <strong>name: myapp-web</strong><br>    labels:<br>        app: myapp<br>        <strong>env: production</strong><br>spec:<br>    selector:<br>        app: myapp<br>        <strong>env: production</strong><br>    ports:<br>    - port: 5000<br>    # ...</pre><h4>Deployment e Service da <strong>myapp-web</strong> em staging:</h4><pre>apiVersion: v1<br>kind: Deployment<br>metadata:<br>    <strong>name: myapp-web-staging</strong><br>    labels:<br>        app: myapp<br>        <strong>env: staging</strong><br>spec:<br>    <strong>replicas: 2</strong><br>    # ...<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>    <strong>name: myapp-web-staging</strong><br>    labels:<br>        app: myapp<br>        <strong>env: staging</strong><br>spec:<br>    selector:<br>        app: myapp<br>        <strong>env: staging</strong><br>    ports:<br>    - port: 5000<strong><br></strong>    # ...</pre><p>As diferenças entre os <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Deployments</a> de produção e staging estão destacadas em negrito nos YAMLs acima. Além dos nomes diferentes, adicionamos a label env com os valores production e staging em cada objeto. O uso dessa label no seletor dos Services permite distinguir as instâncias por ambiente.</p><p>Mudamos também o número de réplicas: como o ambiente de produção é acessado por todos os nossos usuários, precisa de um número maior de réplicas do que o de staging, que só é usado por nossos usuários internos, portanto recebe um tráfego muito menor.</p><p>Feitas as configurações acima, já conseguimos distinguir os dois ambientes: o Service myapp-web encaminha requisições para os Pods de produção, e o myapp-web-staging, para os Pods de staging. Agora precisamos expor o acesso a esses Services para fora do cluster Kubernetes.</p><p>Usamos o nginx para expor o acesso aos Services no Kubernetes. Uma opção seria criar uma URL diferente para o ambiente de staging, como um sub-domínio (algo como staging.meudominio.com.br, por exemplo). Porém, isso exigiria configurações mais complexas nos nossos serviços internos, como login, por exemplo. Por isso, optamos por seguir uma abordagem mais simples: mapear diferentes ambientes no mesmo domínio com o uso de <a href="https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Cookies">cookies</a>. Para que isso funcione, precisamos adicionar uma configuração como esta no nosso nginx:</p><pre>upstream myapp-web {<br>    server myapp-web:5000 max_fails=0;<br>}</pre><pre>upstream myapp-web-staging {<br>    server myapp-web-staging:5000 max_fails=0;<br>}</pre><pre>map $cookie_staging_env $myapp_upstream {<br>    default http://myapp-web;<br>    &quot;true&quot; http://myapp-web-staging;<br>}</pre><pre>server {<br>    listen 443;<br>    server_name meudominio.com.br;</pre><pre>    location /myapp {<br>        proxy_pass $myapp_upstream;<br>    }<br>}</pre><p>Na configuração acima, inicialmente definimos um upstream para cada Service — como o próprio nginx roda no mesmo cluster Kubernetes, ele consegue acessar os Services pelos seus nomes (myapp-web e myapp-web-staging). Em seguida, criamos uma variável $myapp_upstream, cujo valor depende do cookie staging_env: caso ele esteja definido e com o valor true, o conteúdo da variável será http://myapp-web-staging; caso contrário, http://myapp-web. Finalmente, passamos o valor dessa variável para um proxy pass, dentro da location /myapp.</p><p>Feita essa configuração, se acessarmos o path /myapp do nginx, a requisição será encaminhada por padrão para o ambiente de produção. Porém, se a requisição incluir o cookie staging_env=true, ela será encaminhada para staging. Podemos fazer esse teste usando a ferramenta curl:</p><pre># requisição para produção<br>curl https://meudominio.com.br/myapp</pre><pre># requisição para staging<br>curl <strong>-H &quot;Cookie: staging_env=true&quot;</strong> https://meudominio.com.br/myapp</pre><p>Para acessar staging via browser, precisamos abrir o inspector (disponível em todos os browsers modernos) e digitar essa linha no console:</p><pre>document.cookie = &quot;staging_env=true; domain=.meudominio.com.br; path=/&quot;;</pre><p>A partir desse momento, as requisições para https://meudominio.com.br/myapp serão direcionadas para o ambiente de staging. Ao remover esse cookie, as requisições posteriores serão direcionadas para produção. Mesma URL, dois ambientes diferentes!</p><h3>Acessando via browser</h3><p>Como acabamos de ver, agora basta usar um cookie para acessar o ambiente de staging. Porém, manipular cookies via console do browser não é prático, principalmente se o usuário não estiver habituado com esta ferramenta.</p><p>Para facilitar o acesso a staging por nossos usuários internos, criamos um item no menu do usuário para ligar ou desligar o acesso a esse ambiente via <a href="https://www.martinfowler.com/articles/feature-toggles.html"><em>feature flag</em></a>. Quando um usuário do Jusbrasil está logado como administrador da plataforma, ele tem acesso a um item Ambiente de staging no menu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*Sd2qDTwPBrPqwrCffH6UPA.png" /><figcaption>Feature flag para acessar o ambiente de staging</figcaption></figure><p>Ativando esta opção, o cookie é automaticamente injetado na página, e o usuário passa a acessar o ambiente de staging. Desativando esta opção, ele retorna ao ambiente de produção.</p><p>Um problema que acontecia eventualmente era alguns de nossos usuários internos ativarem o ambiente de staging e esquecerem se tinham desativado ou não — ou seja, não sabiam se estavam acessando produção ou staging. Para tornar visível qual é o ambiente atual, adicionamos um elemento na <em>topbar</em>, que só fica visível em staging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*-aUWnE9MiU0oBB9DZWLS4Q.png" /><figcaption>Ambiente de staging ativado</figcaption></figure><h3>Fazendo deploys para staging</h3><p>Finalmente, para facilitar o deploy de código para o ambiente de staging, configuramos um pipeline específico no nosso <a href="https://en.wikipedia.org/wiki/Continuous_integration">servidor de integração contínua</a> — o pipeline padrão faz deploy de todo código da branch master para produção. No novo pipeline, todo código enviado para a branch staging faz o deploy para este ambiente. Dessa forma, se quisermos testar um código de uma branch local em staging, precisamos fazer git push origin minha_branch:staging.</p><p>Com isso, conseguimos ter um ambiente para testar features antes de liberá-las em produção, de forma segura e simples.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a201ce9bf6d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jusbrasil-tech/configurando-um-ambiente-de-staging-com-kubernetes-e-feature-flags-5a201ce9bf6d">Configurando um ambiente de staging com Kubernetes e feature flags</a> was originally published in <a href="https://medium.com/jusbrasil-tech">Jusbrasil Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[tsuru 1.7.0 released]]></title>
            <link>https://medium.com/tsurupaas/tsuru-1-7-0-released-2b53ab21e0fa?source=rss-44d54b8c4377------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b53ab21e0fa</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[paas]]></category>
            <dc:creator><![CDATA[Guilherme Garnier]]></dc:creator>
            <pubDate>Mon, 01 Jul 2019 13:42:28 GMT</pubDate>
            <atom:updated>2019-07-01T13:42:28.930Z</atom:updated>
            <content:encoded><![CDATA[<p>We just released tsuru 1.7.0, with a lot of new features and bug fixes. Here are the most relevant ones — refer to the full release notes for more.</p><h3>Support to Open Service Broker API</h3><p>The concept of <a href="https://docs.tsuru.io/stable/services/index.html">services</a> in tsuru is already known. You can make any external service integrate with the <a href="https://docs.tsuru.io/stable/services/api.html">tsuru workflow</a> by implementing its <a href="https://docs.tsuru.io/stable/services/build.html">service API contract</a> and registering it in tsuru. But now there&#39;s a new way to integrate services: by registering a service broker.</p><p>Service brokers that follow the <a href="https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md">Open Service Broker API spec</a> can be registered in tsuru with tsuru service-broker-add command. After running this, the services exposed by that broker will be available in tsuru service-list command. If you run tsuru on AWS, for example, you can use this to integrate to <a href="https://aws.amazon.com/partners/servicebroker/">AWS Service Broker</a>. Check out <a href="https://docs.tsuru.io/stable/services/open-service-broker.html">tsuru docs on Open Service Broker</a> for more details and examples.</p><h3>Exposing multiple ports</h3><p>Before this release, every app process exposes port 8888. This can be customized in tsuru.conf file, but it&#39;s a global value. You couldn&#39;t configure a single app to expose a different port, or expose more than one port — or even no ports at all, like if you&#39;re running a worker. Now this is customizable per app process.</p><p>The configuration is made in tsuru.yaml file, in the new kubernetes section. For each process, you can list as many ports as you need, and for each port, you can set the protocol (TCP or UDP), the port (which will be set in the <a href="https://kubernetes.io/docs/concepts/services-networking/service/">Kubernetes service</a>) and the target port (the container port).</p><p>The ports configuration still has two limitations:</p><ul><li>The process <a href="https://docs.tsuru.io/1.7/using/tsuru.yaml.html#healthcheck">healthcheck</a> will use the first configured port</li><li>Only the first configured port of the web process (or the only process, in case there’s only one) will be exposed in the router — but you can access the other ports from other apps in the same cluster, using <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#services">Kubernetes DNS records</a>, like appname-processname.namespace.svc.cluster.local</li></ul><p>For more details on this, take a look at <a href="https://docs.tsuru.io/1.7/using/tsuru.yaml.html#kubernetes-specific-configs">ports configuration docs</a>.</p><h3>Support to TLS certificates hot reload</h3><p>Tsuru API now can check for TLS certificate changes and reload it automatically, allowing certificate updates without downtime. The new configuration key tls:auto-reload:interval in tsuru.conf file defines the reload interval.</p><h3>Allow dynamically created clusters</h3><p>In previous versions, if you used a Kubernetes cluster with tsuru, you needed to create the cluster yourself before registering it to tsuru, with tsuru cluster add command. Now this command can be used to dynamically create the cluster for you! It supports cloud providers like Google Kubernetes Engine, Amazon EKS and Azure Kubernetes Service.</p><h3>Support to Kubernetes external traffic policy local</h3><p>Kubernetes services support a configuration called external traffic policy. With the default value, which is Cluster, each kube-proxy instance can send the incoming traffic to any pod, even to other nodes. Now you can change it to Local, where kube-proxy will only send traffic to pods on the same node.</p><p>And there&#39;s more! Take a look at <a href="https://docs.tsuru.io/master/releases/tsurud/1.7.0.html">tsuru 1.7.0 release notes</a> for all new features and bugfixes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b53ab21e0fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tsurupaas/tsuru-1-7-0-released-2b53ab21e0fa">tsuru 1.7.0 released</a> was originally published in <a href="https://medium.com/tsurupaas">tsurupaas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[tsuru 1.6.0 released]]></title>
            <link>https://medium.com/tsurupaas/tsuru-1-6-0-released-a40994026116?source=rss-44d54b8c4377------2</link>
            <guid isPermaLink="false">https://medium.com/p/a40994026116</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Guilherme Garnier]]></dc:creator>
            <pubDate>Mon, 24 Sep 2018 14:17:39 GMT</pubDate>
            <atom:updated>2018-09-24T14:58:37.620Z</atom:updated>
            <content:encoded><![CDATA[<p>We just released <a href="https://github.com/tsuru/tsuru/releases/tag/1.6.0">tsuru 1.6.0</a>, with a lot of new features and bug fixes. Here are the most relevant ones — refer to the <a href="https://docs.tsuru.io/1.6/releases/tsurud/1.6.0.html">full release notes</a> for more.</p><h3>Platform versioning</h3><p>A <a href="https://docs.tsuru.io/1.6/understanding/concepts.html#platforms">platform</a> in tsuru consists of a docker image and a script that runs on each app deploy. Before this release, every time a platform was updated, the new image overrode the previous one, and the new image was used as base for every app using that platform. That means an update could break clients, and there was no way to use the previous image — unless you updated the platform again, setting the previous image.</p><p>Now, every time a platform is updated, tsuru tags a new version of it. The list of versions for a specific platform can be seen with:</p><pre>$ tsuru platform info python<br>Name: python<br>Status: enabled<br>Images:<br> - my-registry.example.com/tsuru/python:v2<br> - my-registry.example.com/tsuru/python:v1</pre><p>By default, every python app in this example will use the latest version, which is my-registry.example.com/tsuru/python:v2. But suppose that, in the update to python platform v2, <a href="https://pypi.org/project/pip/">pip</a> version was updated from 9 to 10. This version stopped exposing pip internal packages. If you had an app that depended on these packages, its deploys wouldn&#39;t work anymore with python platform v2. A possible solution to this is updating the app to lock it to python platform v1:</p><pre>$ tsuru app update -a myapp --platform python:v1<br>App &quot;myapp&quot; has been updated!</pre><p>After you run this command, this app won&#39;t receive any more platform updates. These updates could include security fixes and other improvements, so locking an app to a specific platform version should be used just as a temporary solution for apps that break after an update.</p><h3>Team tokens</h3><p>In previous tsuru versions, if you wanted to configure a CI server to make deploys to your apps, you needed to use your own tsuru user token. This is not ideal, because that token is associated to that specific user, which could eventually leave the team and lose permission to deploy those apps. Also, that user could have too many permissions; a security breach in the CI server could be very dangerous.</p><p>Now it&#39;s possible to create a token associated to a team, not a user. To create it:</p><pre>$ tsuru token create \<br>    --id my-ci-token \<br>    --team myteam \<br>    --description &quot;CI token&quot;<br>Token &quot;my-ci-token&quot; created: b3bc4ded93dd9a799874b564835d362aa1274be0e9511f29d3f78dc8517af176</pre><p>By default, team tokens don&#39;t expire, but you could set an expiration for it, with the flag --expires 24h, for instance.</p><p>Now you can set the permissions that token will have (assuming you have created a role called deployer that has permission to deploy apps):</p><pre>$ tsuru role assign deployer my-ci-token<br>Role successfully assigned!</pre><p>The permissions a team token can get are limited to the roles of the user running this command.</p><p>To list all tokens (output truncated for better readability):</p><pre>$ tsuru token list<br>+-------------+--------+-------------+--------------+------------+<br>| Token ID    | Team   | Description | Value        | Roles      |<br>+-------------+--------+-------------+--------------+------------+<br>| my-ci-token | myteam | CI token    | b3bc49325... | deployer() |<br>|             |        |             |              |            |<br>+-------------+--------+-------------+--------------+------------+</pre><p>For more details on team tokens, check the <a href="https://docs.tsuru.io/1.6/using/team-tokens.html">documentation</a>.</p><h3>Event webhooks</h3><p>Webhooks allow triggering a request every time a specific kind of event happens on tsuru. You could use this feature to be notified when your app deploy fails, or when a unit add event is successful, for example.</p><p>A practical example would be notifying a Slack channel every time an app is deployed:</p><pre>$ tsuru event-webhook-create my-webhook \<br>    <a href="https://hooks.slack.com/services/...">https://hooks.slack.com/services/...</a> \<br>    -d &quot;all successful deploys&quot; \<br>    -t &lt;my-team&gt; \<br>    -m POST \<br>    -H Content-Type=application/x-www-form-urlencoded \<br>    -b &#39;payload={&quot;text&quot;: &quot;[{{.Kind.Name}}]: {{.Target.Type}} {{.Target.Value}}&quot;}&#39; \<br>    --success-only \<br>    --kind-name app.deploy</pre><p>Event filters could be include other fields, and the hook request also supports other configurations. The request payload can be customized to include any field from the event. Refer to <a href="https://docs.tsuru.io/1.6/managing/event-webhooks.html">tsuru docs</a> for more details.</p><h3>OpenAPI specification</h3><p>From now on, tsuru API is being documented with <a href="https://www.openapis.org/">OpenAPI</a> v2 specification. It&#39;s not complete yet, but we’re constantly updating it to add missing API calls. You can check <a href="https://app.swaggerhub.com/apis/tsuru/tsuru/1.6">tsuru API documentation in swaggerhub</a>.</p><p>We&#39;re also generating a <a href="https://github.com/tsuru/go-tsuruclient">tsuru go client</a> from the specs, which may be useful for Go apps that need to use tsuru API.</p><h3>Improved Kubernetes support</h3><p>Since version 1.3, <a href="https://blog.tsuru.io/tsuru-1-3-0-released-with-kubernetes-support-576783cc4f88">tsuru supports Kubernetes</a> as an app provisioner. This release includes a couple of important improvements and bugfixes, like:</p><ul><li><a href="https://github.com/tsuru/tsuru/issues/1978">More reliable image build and deploy</a>, by using a sidecar with <a href="https://github.com/tsuru/deploy-agent">deploy-agent</a> to build the image</li><li>Added support for deploy <a href="https://github.com/tsuru/tsuru/issues/2030">cancelation</a> and <a href="https://github.com/tsuru/tsuru/issues/1938">rollback</a></li><li>Improved <a href="https://github.com/tsuru/tsuru/issues/2045">healthcheck config options</a></li><li>Added support to building <a href="https://github.com/tsuru/tsuru/issues/1838">apps</a> and <a href="https://github.com/tsuru/tsuru/issues/2006">platforms</a> in Kubernetes pools</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a40994026116" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tsurupaas/tsuru-1-6-0-released-a40994026116">tsuru 1.6.0 released</a> was originally published in <a href="https://medium.com/tsurupaas">tsurupaas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and sharing tsuru app images]]></title>
            <link>https://medium.com/tsurupaas/building-and-sharing-tsuru-app-images-5a44c4f4933f?source=rss-44d54b8c4377------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a44c4f4933f</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Guilherme Garnier]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 19:29:24 GMT</pubDate>
            <atom:updated>2018-06-18T19:29:24.231Z</atom:updated>
            <content:encoded><![CDATA[<p>Since version 1.5.0, tsuru supports a new command that allows building app images and using them with different apps.</p><h3>A typical app deploy with tsuru</h3><p>When you deploy an app with tsuru app-deploy command, tsuru follows these steps:</p><ol><li>tsuru client generates a .tar.gz file with all the files passed in the command line arguments</li><li>tsuru client sends the .tar.gz file on a POST request to tsuru API</li><li>tsuru API builds a Docker image with the app contents (using as base either the platform image or the previous app image)</li><li>tsuru API pushes the image to its image registry, tagged with an incremental version number and a builder suffix (something like registry.example.com/tsuru/app-myapp:v8-builder)</li><li>tsuru runs a container from this image, injects the environment variables defined for the app and runs the app <a href="https://docs.tsuru.io/stable/using/tsuru.yaml.html#deployment-hooks">deployment hooks</a></li><li>tsuru builds a new image from this container and also pushes it, labeled with the same version number but without the suffix (registry.example.com/tsuru/app-myapp:v8)</li><li>tsuru starts new units from this image</li></ol><p>Deploys with git push are very similar, except for steps 1 and 2.</p><p>The problem with this approach is when you have many different tsuru apps for each environment — typically dev, qa, staging and production. Devs usually create apps like myapp-dev, myapp-qa, myapp-staging and myapp-prod to represent this. In a common development pipeline, devs deploy their code to the dev app; if everything works, they deploy this same code to qa, then staging and finally to production.</p><p>By default, when you do this, tsuru will create different images for each environment — their contents may be exactly equal, but the image names will be different — registry.example.com/tsuru/app-myapp-dev:v1, registry.example.com/tsuru/app-myapp-qa:v1, etc. If you could share an image among these apps — at least the builder images, without the environment variables, which may be specific per env — , the deploys would be faster (it wouldn&#39;t need to repeat steps 1 to 4 above, only steps 5 to 7), besides saving storage in the image registry (only one image would be pushed). And if you test the same image in every environment, you have more confidence it will work on the other environments.</p><p>The new tsuru app-build command allows sharing an image among different apps. You can also use this same image to run your app locally. Here&#39;s an example:</p><p>tsuru app-build -t mytag -a myapp &lt;files&gt;</p><p>This command will do the steps 1 to 4 from above, and display the address of the new image — something like registry.example.com/tsuru/app-myapp:mytag. Now you can deploy it to other apps using tsuru app-deploy -a otherapp -i registry.example.com/tsuru/app-myapp:mytag, or run in your local machine with Docker: docker run registry.example.com/tsuru/app-myapp:mytag.</p><p>This screencast shows tsuru app-build command in action:</p><figure><a href="https://asciinema.org/a/158885"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A7uq97-VgRlZHDFfASEn8w.png" /></a><figcaption>app build in action</figcaption></figure><p>The app-build command is available since tsuru 1.5.0. To check other features of this version, take a look at the <a href="https://docs.tsuru.io/stable/releases/tsurud/1.5.0.html">release notes</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a44c4f4933f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tsurupaas/building-and-sharing-tsuru-app-images-5a44c4f4933f">Building and sharing tsuru app images</a> was originally published in <a href="https://medium.com/tsurupaas">tsurupaas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[tsuru 1.4.0 released, with volumes, improved Kubernetes support and more!]]></title>
            <link>https://medium.com/tsurupaas/tsuru-1-4-0-released-with-volumes-improved-kubernetes-support-and-more-4cb5bba1321c?source=rss-44d54b8c4377------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cb5bba1321c</guid>
            <category><![CDATA[paas]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Guilherme Garnier]]></dc:creator>
            <pubDate>Tue, 06 Feb 2018 19:25:12 GMT</pubDate>
            <atom:updated>2018-02-06T19:25:12.902Z</atom:updated>
            <content:encoded><![CDATA[<p>With tsuru 1.3.0, we added <a href="https://blog.tsuru.io/tsuru-1-3-0-released-with-kubernetes-support-576783cc4f88">experimental support to Kubernetes</a> as a provisioner for running your apps. In the development of tsuru 1.4.0, we kept focusing on this feature. We fixed a couple of bugs and made Kubernetes support much more stable. Now we consider it production-ready!</p><h3>Volumes</h3><p>A new, exciting feature of tsuru 1.4.0 is the support to volumes. Suppose you need to share a directory among your app units and keep it in sync. Or maybe you want to use HTTPS and, for some reason, you need to terminate the TLS connection in the app units. For that to work, you would need the certificate in every unit. But keeping a production certificate in your code repository is not a good idea, so you would probably need to make your deploy process fetch the certificate somewhere and put it inside the units. But if you do that before generating the app image, the certificate would be added to the app image, which may be a security issue. That problem could be solved with volumes:</p><pre># Assuming you have a nfs volume plan enabled, create a new volume called &quot;share&quot;<br>$ tsuru volume create share nfs -o capacity=1Gi -o server=nfs.example.com -o path=/path/to/dir</pre><pre># Bind the new volume to an app, mounting it to /mnt/mountpoint<br>tsuru volume bind share /mnt/mountpoint -a appname</pre><p>Volumes are supported only with Kubernetes and Swarm provisioners. For more details, check the <a href="https://docs.tsuru.io/master/managing/volumes.html">volumes documentation</a>.</p><h3>Forcing app image reset</h3><p>Another new feature is the support to force an image reset for the next deploy of an app. When you start an app deploy, tsuru uses the image from the previous deploy as base, to save both disk and time — usually, the difference between two app deploys is not that big, which makes the diff layer smaller than building a fresh, new image from the <a href="https://github.com/tsuru/platforms">app platform image</a>. But there&#39;s a situation where we may need a fresh image: when there&#39;s something wrong with the previous deploy image (like referencing an unknown dependency), the image build for the next deploy will also fail. To solve this problem, now you can run the command tsuru app update -a appname --image-reset. This will force the next deploy — be it via tsuru app deploy or git push — to use the app platform image as base.</p><p>Besides those, there are other features and bug fixes in this release. For more details, take a look at the <a href="https://docs.tsuru.io/stable/releases/tsurud/1.4.0.html">release notes</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cb5bba1321c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tsurupaas/tsuru-1-4-0-released-with-volumes-improved-kubernetes-support-and-more-4cb5bba1321c">tsuru 1.4.0 released, with volumes, improved Kubernetes support and more!</a> was originally published in <a href="https://medium.com/tsurupaas">tsurupaas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[tsuru 1.3.0 released, with Kubernetes support!]]></title>
            <link>https://medium.com/tsurupaas/tsuru-1-3-0-released-with-kubernetes-support-576783cc4f88?source=rss-44d54b8c4377------2</link>
            <guid isPermaLink="false">https://medium.com/p/576783cc4f88</guid>
            <category><![CDATA[docker-swarm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[paas]]></category>
            <dc:creator><![CDATA[Guilherme Garnier]]></dc:creator>
            <pubDate>Thu, 31 Aug 2017 17:37:45 GMT</pubDate>
            <atom:updated>2017-08-31T17:37:45.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*MYvHrG7mN3L5YapU4ha4RQ.png" /></figure><p>We recently released tsuru version 1.3.0. This version adds experimental support to using <a href="https://kubernetes.io/">Kubernetes</a> as a provisioner.</p><p>Until version 1.1.x, tsuru only supported one provisioner: <a href="https://www.docker.com/">Docker</a>. That means we could only run apps on top of Docker clusters. In version 1.2.0, we started supporting <a href="https://docs.docker.com/engine/swarm/">Swarm</a> clusters. Each pool is associated to a provisioner, so you could have a Docker pool and a Swarm pool at the same time. And now, tsuru also supports Kubernetes.</p><p>Kubernetes is a container orchestration solution that&#39;s been growing very fast. It&#39;s already one of the <a href="https://www.linuxfoundation.org/blog/successful-open-source-projects-common/">most active open source projects</a>, and <a href="https://kubernetes.io/case-studies/">it&#39;s being used by many companies</a>, like <a href="https://githubengineering.com/kubernetes-at-github/">Github</a>, <a href="https://kubernetes.io/case-studies/wikimedia/">Wikimedia</a> and <a href="https://cloudplatform.googleblog.com/2016/09/bringing-Pokemon-GO-to-life-on-Google-Cloud.html">Niantic (creator of Pokemon Go)</a>. It was an obvious solution to decide supporting it as a provisioner. If you <a href="https://blog.tsuru.io/tsuru-paas-on-google-cloud-platform-21640abb4386">run your tsuru installation in Google Cloud Platform</a>, you could use <a href="https://cloud.google.com/container-engine/">Google Container Engine (GKE)</a> to start a Kubernetes cluster and register it in tsuru.</p><h3>Why not replace tsuru with Kubernetes?</h3><p>A question we hear a lot is: why should I use tsuru and not Kubernetes? Our answer is: why not use both?</p><p>Kubernetes is an amazing solution for container scheduling and orchestration. It&#39;s production ready, and it&#39;s getting better each day. But managing your own Kubernetes cluster directly can be very hard.</p><p>Developers that already use tsuru to manage their apps know how easy it is to create apps, make deploys, check logs, manage services, etc. Kubernetes introduce a lot of other concepts and abstractions. What we did was mapping these concepts to the current tsuru architecture — actually, we created a new concept of cluster, which is also used with Swarm.</p><p>This means that, as a tsuru user, nothing changes in the way you manage your apps. tsuru takes care of the details and complexities for you, and you get all the benefits from Kubernetes.</p><p>Notice that Kubernetes support is still experimental. If you decide to try it, be aware that you may find bugs. If you do, please <a href="https://github.com/tsuru/tsuru/issues">open a new issue in tsuru</a>.</p><p>There are other important new features in this release. For more details, check the full <a href="https://docs.tsuru.io/stable/releases/tsurud/1.3.0.html">release notes</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=576783cc4f88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tsurupaas/tsuru-1-3-0-released-with-kubernetes-support-576783cc4f88">tsuru 1.3.0 released, with Kubernetes support!</a> was originally published in <a href="https://medium.com/tsurupaas">tsurupaas</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>