<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khaly DeThylis</title>
    <description>The latest articles on DEV Community by Khaly DeThylis (@gaelleacas).</description>
    <link>https://dev.to/gaelleacas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F131479%2F3d5e39d2-4057-4b74-b011-7850cb3ee438.jpeg</url>
      <title>DEV Community: Khaly DeThylis</title>
      <link>https://dev.to/gaelleacas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gaelleacas"/>
    <language>en</language>
    <item>
      <title>GKE : use local domain (OSX)</title>
      <dc:creator>Khaly DeThylis</dc:creator>
      <pubDate>Wed, 18 Dec 2019 23:13:31 +0000</pubDate>
      <link>https://dev.to/gaelleacas/gke-use-local-domain-osx-1o6p</link>
      <guid>https://dev.to/gaelleacas/gke-use-local-domain-osx-1o6p</guid>
      <description>&lt;p&gt;I have a GKE cluster &amp;amp; I want to try ingress with a fake localhost dns like &lt;a href="https://main.local"&gt;https://main.local&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  set a local dns to your ingress external IP
&lt;/h2&gt;

&lt;p&gt;/etc/hosts :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost docker.for.mac.localhost
255.255.255.255 broadcasthost
::1             localhost

xx.xxx.xxx.xx   main.local
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Generate SSL cert with letsencrypt:
&lt;/h2&gt;

&lt;p&gt;e.g : ssl for &lt;a href="https://main.local"&gt;https://main.local&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl req -x509 -out main.crt -keyout main.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=main.local' -extensions EXT -config &amp;lt;( \
   printf "[dn]\nCN=main.local\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:main.local\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Secret TLS on your K8S cluster
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create secret tls tls-main --key main.key --cert main.crt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Put it in your Ingress
&lt;/h2&gt;

&lt;p&gt;here I use &lt;a href="https://projectcontour.io"&gt;Contour&lt;/a&gt; proxy&lt;/p&gt;

&lt;p&gt;main-route.yaml :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: main-httpproxy
  namespace: default
spec:
  virtualhost:
    fqdn: main.local
    tls:
      secretName: tls-main
  routes:
    - services:
        - name: myservice
          port: 80

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Set cert trust on OSX
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Launch Application/Utilities/Keychain Access.app &amp;amp; upload your main.crt&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;set trusted always&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;see &lt;a href="https://tosbourn.com/getting-os-x-to-trust-self-signed-ssl-certificates"&gt;tuto&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gke</category>
      <category>tls</category>
      <category>contour</category>
    </item>
  </channel>
</rss>
