<?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: xinacod</title>
    <description>The latest articles on DEV Community by xinacod (@xenacod).</description>
    <link>https://dev.to/xenacod</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%2F926287%2Fe5c66f18-3cf7-4c21-b835-c74feeffc34b.jpg</url>
      <title>DEV Community: xinacod</title>
      <link>https://dev.to/xenacod</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xenacod"/>
    <language>en</language>
    <item>
      <title>Auto Deploying Apps Using AWS + Kustomize</title>
      <dc:creator>xinacod</dc:creator>
      <pubDate>Wed, 14 Feb 2024 12:41:19 +0000</pubDate>
      <link>https://dev.to/aws-builders/auto-deploying-apps-using-aws-kustomize-d2i</link>
      <guid>https://dev.to/aws-builders/auto-deploying-apps-using-aws-kustomize-d2i</guid>
      <description>&lt;p&gt;Kustomize is a tool for customizing Kubernetes configurations, simplifying the rollout and deployment of applications into clusters. It has the following features to manage application configuration files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generating resources from other sources&lt;/li&gt;
&lt;li&gt;setting cross-cutting fields for resources&lt;/li&gt;
&lt;li&gt;composing and customizing collections of resources_
In this scenario, you'll learn how to use Kustomize Bases and Overlays to deploy 3 different versions (Baseline, Staging, and Production) of the same sample web application into a provided Kubernetes cluster.  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Blog Objectives:&lt;/strong&gt;&lt;br&gt;
Upon completion of this article, you should be able to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use Kustomize to deploy a basic web application which has been packaged already into a docker image (hosted on DockerHub). &lt;/li&gt;
&lt;li&gt;Understand how to use configure and work with Kustomize Bases and Overlays&lt;/li&gt;
&lt;li&gt;Use Kustomize to generate 3 different enviroment specific deployments:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Baseline - the baseline deployment version of the webapp&lt;/li&gt;
&lt;li&gt;Staging - uses a Kustomize overlay to change the baseline deployment settings&lt;/li&gt;
&lt;li&gt;Production - uses a Kustomize overlay to change the baseline deployment settings
Test and validate the Base, Staging, and Production deployed cluster resources using the curl command and your workstations browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be comfortable with basic Linux command line administration&lt;/li&gt;
&lt;li&gt;Be comfortable with basic Kubernetes and Container based concepts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AWS Management Console is a web control panel for managing all your AWS resources, from EC2 instances to SNS topics. The console enables cloud management for all aspects of the AWS account, including managing security credentials and even setting up new IAM Users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instructions&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the AWS Management Console search bar, enter EC2, and click the EC2 result under Services:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxxrd9rf6tu4b6r5g44a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxxrd9rf6tu4b6r5g44a.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click on Instances. Wait for the ide.cloudacademy.platform.instance EC2 instance to be launched, and then select it, and locate and copy the assigned IPv4 Public IP address. An example IPv4 address number is 54.69.21.244&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The web-based CloudAcademy IDE has been configured on port 80. Using your browser, navigate to the IDE hosted on the ide.cloudacademy.platform.instance EC2 instance using the public IP address you just copied: &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remember to use the public IP address assigned to your ide.cloudacademy.platform.instance. &lt;/li&gt;
&lt;li&gt;It takes approximately 1-2 minutes for the web-based CloudAcademy IDE service to startup on the ide.cloudacademy.platform.instance EC2 instance - try refreshing the browser page request until access is successful - please be patient.&lt;/li&gt;
&lt;li&gt;It has been configured to listen on port 80&lt;/li&gt;
&lt;li&gt;An example URL would be &lt;a href="http://35.91.56.109%C2%A0" rel="noopener noreferrer"&gt;http://35.91.56.109 &lt;/a&gt;   where "35.91.56.109" is the public IP from the last instruction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4pmypf2z9t7od2lk4qq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4pmypf2z9t7od2lk4qq.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this Lab Step, you'll use Kustomize to perform a baseline deployment of the sample web application into the provided Kubernetes cluster. Kustomize is now natively built into the standard kubectl command, which you'll use to drive the deployment. You'll then use your browser to confirm that the baseline version of the sample web application is indeed correctly deployed and configured.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instructions&lt;/strong&gt;  &lt;br&gt;
1. Expand the Files tree view by clicking on the Files tab on the left handside menu, and then open the project/code/kustomize/base directory:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3r1oclw8qm8u02fvmu9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3r1oclw8qm8u02fvmu9g.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The base directory contains the following 4 manifest files which are used to create a basic sample web application within the cluster. Open each of the following files within the editor view and then review their contents.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;configmap.yaml&lt;/li&gt;
&lt;li&gt;deployment.yaml&lt;/li&gt;
&lt;li&gt;service.yaml&lt;/li&gt;
&lt;li&gt;ingress.yaml&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhj4xfutzasp7ovrct58a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhj4xfutzasp7ovrct58a.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The base directory also contains a kustomization.yaml file, which consists of the following configuration:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

commonLabels:

 app: webapp

 env: base

 version: "1.02"

 org: cloudacademy.com

 team: devops.labs

 developer: jeremy.cook



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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

resources:

- configmap.yaml

- deployment.yaml

- service.yaml

- ingress.yaml 


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

&lt;/div&gt;

&lt;p&gt;The commonLabels section defines common metadata labels which get copied into each of the 4 manifest files declared in the resources section when Kustomize is executed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start a new terminal session by right clicking on the kustomize directory within the Files tree view and then selecting the Open in Terminal option:
6. Confirm that you are in the /home/project/code/kustomize directory. In the terminal execute the following command:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;**Copy code&lt;br&gt;
`cd /home/project/code/kustomize &amp;amp;&amp;amp; ls -la&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpidgo4wg9gitv5acg7s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpidgo4wg9gitv5acg7s.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;. Use Kustomize to generate and output the set of API resources as declared within the kustomization.yaml file within the base directory. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;kubectl kustomize base&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6m6hrk654y4skckpsict.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6m6hrk654y4skckpsict.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Now use Kustomize to deploy the same baseline set of resources into the provided Kubernetes cluster. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F118lov7h0vz731vnm3nu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F118lov7h0vz731vnm3nu.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Confirm that all cluster resources were created successfully. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Kubectl get all&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fipeeoj6la333czocfb8l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fipeeoj6la333czocfb8l.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sample web application should now be ready to serve Internet based traffic via its assigned FQDN host declared within the base/ingress.yaml file. Display the contents of the base/ingress.yaml file. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwyw031kwr16trj2tr6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwyw031kwr16trj2tr6w.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For your convenience the same FQDN host has been stored in the WEBAPP_URL_BASE environment variable. It can be retrieved by running the following command within the terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgcke18aum9wv5l1mdlp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgcke18aum9wv5l1mdlp.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take note of the "Base" text and yellow background colour of the rendered web page. These settings are declared within the base/configmap.yaml file, which is itself referenced by the base/deployment.yaml file:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
In this Lab Step, you'll use Kustomize to perform the staging deployment of the sample web application into the provided Kubernetes cluster.  You'll then use your browser to confirm that the staging version of the sample web application is indeed correctly deployed and configured.&lt;br&gt;
 &lt;br&gt;
&lt;strong&gt;Instructions&lt;/strong&gt;  &lt;br&gt;
1. Expand the Files tree view by clicking on the Files tab on the left handside menu, and then open the project/code/kustomize/overlays/staging directory:&lt;/p&gt;

&lt;p&gt;The staging directory contains 2 x k8s manifest files and 1 x kustomize config file. The k8s manifest files contain updated settings which will be used to create the staging sample web application resources within the k8s cluster. Open each of the following files within the editor view and review their contents.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;configmap.yaml - note the updated message and bgcolor values&lt;/li&gt;
&lt;li&gt;ingress.yaml - note the updated host value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9ihehyv7etyf005gw6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9ihehyv7etyf005gw6r.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The staging directory contains a kustomization.yaml file with the following configuration:&lt;br&gt;
&lt;strong&gt;Copy code&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
namePrefix: stg-&lt;/p&gt;

&lt;p&gt;commonLabels:&lt;/p&gt;

&lt;p&gt;env: staging&lt;/p&gt;

&lt;p&gt;commonAnnotations:&lt;/p&gt;

&lt;p&gt;note: staging deployment of cloudacademy lab webapp&lt;/p&gt;

&lt;p&gt;bases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;../../base&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
patchesStrategicMerge:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;configmap.yaml&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ingress.yaml&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Notes&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;namePrefix defines a string that is added to the start of all resource names&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;commonLabels defines metadata labels that are added to all resources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;commonAnnotations defines metadata annotations that are added to all resources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;bases defines the base directory which is to be merge patched with the resources declared in the patchesStrategicMerge section&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start a new terminal session by right clicking on the staging directory within the Files tree view and then selecting the Open in Terminal option:&lt;br&gt;
Confirm that you are in the /home/project/code/kustomize/overlays/staging directory. In the terminal execute the following command:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;cd /home/project/code/kustomize/overlays/staging &amp;amp;&amp;amp; ls -la&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Use Kustomize to generate and output the set of API resources as declared within the kustomization.yaml file within the staging (current) directory. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
Copy code&lt;br&gt;
kubectl kustomize .&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx39ni8c6ndnjvcq214so.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx39ni8c6ndnjvcq214so.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41lujco9k2uvfqtqwms9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41lujco9k2uvfqtqwms9.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;. Now use Kustomize to deploy the staging generated set of resources into the Kubernetes cluster. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;code&gt;&lt;/code&gt;kubectl apply -k .&lt;/p&gt;

&lt;p&gt;The staging sample web application should now be ready to serve Internet based traffic via its assigned FQDN host declared within the staging/ingress.yaml file. Display the contents of the staging/ingress.yaml file. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;Copy code&lt;br&gt;
cat ingress.yaml&lt;/p&gt;

&lt;p&gt;For your convenience the same FQDN host has been stored in the WEBAPP_URL_STAGING environment variable. It can be retrieved by running the following command within the terminal:&lt;/p&gt;

&lt;p&gt;**Copy code&lt;br&gt;
&lt;code&gt;export | grep WEBAPP_URL_STAGING&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30u240e4oivb8354xqsm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30u240e4oivb8354xqsm.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9azrd6hip6xexigjqhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9azrd6hip6xexigjqhk.png" alt="AWS+Kustomise"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using your own web browser, browse to the URL stored in the WEBAPP_URL_STAGING environment variable and confirm that the staging sample web application renders successfully:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take note of the "Staging" text and the orange background colour of the rendered web page. These settings are declared within the staging/configmap.yaml file, which is itself referenced by the base/deployment.yaml file:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Copy code&lt;br&gt;
apiVersion: v1&lt;/p&gt;

&lt;p&gt;kind: ConfigMap&lt;/p&gt;

&lt;p&gt;metadata:&lt;/p&gt;

&lt;p&gt;name: webapp-cfg&lt;/p&gt;

&lt;p&gt;data:&lt;/p&gt;

&lt;p&gt;message: "Staging"&lt;/p&gt;

&lt;p&gt;bgcolor: "orange"&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Close all currently open files within the editor.&lt;/li&gt;
&lt;li&gt;Close the currently opened terminal session (bottom) pane - leaving the IDE open.
  
The production directory contains 3 x k8s manifest files and 1 x kustomize config file. The k8s manifest files contain updated settings which will be used to create the production sample web application within the cluster. Open each of the following files within the editor view and review their contents.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;configmap.yaml - note the updated message and bgcolor values&lt;/li&gt;
&lt;li&gt;deployment.yaml - note the updated replicas value&lt;/li&gt;
&lt;li&gt;ingress.yaml - note the updated host value&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;The production directory contains a kustomization.yaml file with the following configuration:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Copy code&lt;br&gt;
namePrefix: prod-&lt;/p&gt;

&lt;p&gt;commonLabels:&lt;/p&gt;

&lt;p&gt;env: prod&lt;/p&gt;

&lt;p&gt;commonAnnotations:&lt;/p&gt;

&lt;p&gt;note: production deployment of cloudacademy lab webapp&lt;/p&gt;

&lt;p&gt;bases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;../../base&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;patchesStrategicMerge:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;configmap.yaml&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;deployment.yaml&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ingress.yaml &lt;br&gt;
&lt;strong&gt;Notes&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;namePrefix defines a string that is added to the start of all resource names&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;commonLabels defines metadata labels that are added to all resources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;commonAnnotations defines metadata annotations that are added to all resources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;bases defines the base directory which is to be merge patched with the resources declared in the patchesStrategicMerge section&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start a new terminal session by right clicking on the production directory within the Files tree view and then selecting the Open in Terminal option:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5. A new terminal session is presented in the bottom pane:&lt;/p&gt;

&lt;p&gt;6. Confirm that you are in the /home/project/code/kustomize/overlays/production directory. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;code&gt;cd /home/project/code/kustomize/overlays/production &amp;amp;&amp;amp; ls -la&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
7. Use Kustomize to generate and output the set of API resources as declared within the kustomization.yaml file within the production (current) directory. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;code&gt;kubectl kustomize .&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;8. Now use Kustomize to deploy the production generated set of resources into the Kubernetes cluster. In the terminal execute the following command:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;code&gt;kubectl apply -k .&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Confirm that all production cluster resources were created successfully. In the terminal execute the following command:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;code&gt;kubectl get all -l env=prod&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The production sample web application should now be ready to serve Internet based traffic via its assigned FQDN host declared within the production/ingress.yaml file. Display the contents of the production/ingress.yaml file. In the terminal execute the following command:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*&lt;em&gt;Copy code&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;code&gt;cat ingress.yaml&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For your convenience the same FQDN host has been stored in the WEBAPP_URL_PROD environment variable. It can be retrieved by running the following command within the terminal:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;**Copy code&lt;br&gt;
`export | grep WEBAPP_URL_PROD&lt;br&gt;
12. Using your own web browser, browse to the URL stored in the WEBAPP_URL_PROD environment variable and confirm that the production sample web application renders successfully:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take note of the "Production" text and the cyan background colour of the rendered web page. These settings are declared within the production/configmap.yaml file, which is itself referenced by the base/deployment.yaml file:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Copy code&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

apiVersion: v1

kind: ConfigMap

metadata:

  name: webapp-cfg

data:

  message: "Production"

  bgcolor: "cyan"



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

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Recourses&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/xenacode-art/Kustomize" rel="noopener noreferrer"&gt;https://github.com/xenacode-art/Kustomize&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>AWS + DevSecops</title>
      <dc:creator>xinacod</dc:creator>
      <pubDate>Mon, 19 Sep 2022 12:28:25 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-devsecops-432i</link>
      <guid>https://dev.to/aws-builders/aws-devsecops-432i</guid>
      <description>&lt;h2&gt;
  
  
  DevSecops Defined
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DevSecOps&lt;/strong&gt; is the practice of integrating security testing at every stage of the software development process. It includes tools and processes that encourage collaboration between developers, security specialists, and operation teams to build software that is both efficient and secure. DevSecOps brings cultural transformation that makes security a shared responsibility for everyone who is building the software.&lt;/p&gt;

&lt;p&gt;What does DevSecOps stand for?&lt;/p&gt;

&lt;p&gt;DevSecOps stands for development, security, and operations. It is an extension of the DevOps practice. Each term defines different roles and responsibilities of software teams when they are building software applications.&lt;br&gt;
Development &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Development&lt;/strong&gt; is the process of planning, coding, building, and testing the application.&lt;br&gt;
Security&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt; means introducing security earlier in the software development cycle. For example, programmers ensure that the code is free of security vulnerabilities, and security practitioners test the software further before the company releases it. &lt;br&gt;
Operations&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The operations&lt;/strong&gt; team releases, monitors, and fixes any issues that arise from the software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DevSecOps&lt;/strong&gt; aims to help development teams address security issues efficiently. It is an alternative to older software security practices that could not keep up with tighter timelines and rapid software updates. To understand the importance of DevSecOps, we will briefly review the software development process.&lt;/p&gt;

&lt;p&gt;Software development lifecycle&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The software development lifecycle (SDLC)&lt;/strong&gt; _is a structured process that guides software teams to produce high-quality applications. Software teams use the SDLC to reduce costs, minimize mistakes, and ensure the software aligns with the project's objectives at all times. The software development life cycle takes software teams through these stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Requirement analysis&lt;/li&gt;
&lt;li&gt;    Planning&lt;/li&gt;
&lt;li&gt;    Architectural design&lt;/li&gt;
&lt;li&gt;    Software development&lt;/li&gt;
&lt;li&gt;    Testing&lt;/li&gt;
&lt;li&gt;    Deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DevSecOps in the SDLC [software development life cycle]&lt;/p&gt;

&lt;p&gt;In conventional software development methods, security testing was a separate process from the SDLC. The security team discovered security flaws only after they built the software. The DevSecOps framework improves the SDLC by detecting vulnerabilities throughout the software development and delivery process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What are the benefits of DevSecOps?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several benefits of practicing DevSecOps.&lt;br&gt;
Catch software vulnerabilities early &lt;/p&gt;

&lt;p&gt;Software teams focus on security controls through the entire development process. Instead of waiting until the software is completed, they conduct checks at each stage. Software teams can detect security issues at earlier stages and reduce the cost and time of fixing vulnerabilities. As a result, users experience minimal disruption and greater security after the application is produced.&lt;br&gt;
Reduce time to market&lt;/p&gt;

&lt;p&gt;With DevSecOps, software teams can automate security tests and reduce human errors. It also prevents the security assessment from being a bottleneck in the development process. &lt;br&gt;
Ensure regulatory compliance&lt;/p&gt;

&lt;p&gt;Software teams use DevSecOps to comply with regulatory requirements by adopting professional security practices and technologies. They identify data protection and security requirements in the system. For example, software teams use AWS Security Hub to automate security checks against industry standards. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build a security-aware culture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Software teams become more aware of security best practices when developing an application. They are more proactive in spotting potential security issues in the code, modules, or other technologies for building the application. &lt;br&gt;
Develop new features securely&lt;/p&gt;

&lt;p&gt;DevSecOps encourages flexible collaboration between the development, operation, and security teams. They share the same understanding of software security and use common tools to automate assessment and reporting. Everyone focuses on ways to add more value to the customers without compromising on security. &lt;br&gt;
**&lt;br&gt;
How DevSecOps work?**&lt;/p&gt;

&lt;p&gt;To implement DevSecOps, software teams must first implement DevOps and continuous integration.&lt;br&gt;
DevOps&lt;/p&gt;

&lt;p&gt;DevOps culture is a software development practice that brings development and operations teams together. It uses tools and automation to promote greater collaboration, communication, and transparency between the two teams. As a result, companies reduce software development time while still remaining flexible to changes. &lt;br&gt;
Continuous integration&lt;/p&gt;

&lt;p&gt;Continuous integration and continuous delivery (CI/CD) is a modern software development practice that uses automated build-and-test steps to reliably and efficiently deliver small changes to the application. Developers use CI/CD tools to release new versions of an application and quickly respond to issues after the application is available to users. For example, AWS CodePipeline is a tool that you can use to deploy and manage applications.&lt;br&gt;
DevSecOps&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DevSecOps introduces security to the DevOps practice by integrating security assessments throughout the CI/CD process. It makes security a shared responsibility among all team members who are involved in building the software. The development team collaborates with the security team before they write any code. Likewise, operations teams continue to monitor the software for security issues after deploying it. As a result, companies deliver secure software faster while ensuring compliance. &lt;/p&gt;

&lt;p&gt;DevSecOps compared to DevOps &lt;/p&gt;

&lt;p&gt;DevOps focuses on getting an application to the market as fast as possible. In DevOps, security testing is a separate process that occurs at the end of application development, just before it is deployed. Usually, a separate team tests and enforces security on the software. For example, security teams set up a firewall to test intrusion into the application after it has been built.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;DevSecOps, on the other hand, makes security testing a part of the application development process itself. Security teams and developers collaborate to protect the users from software vulnerabilities. For example, security teams set up firewalls, programmers design the code to prevent vulnerabilities, and testers test all changes to prevent unauthorized third-party access.&lt;/p&gt;

&lt;p&gt;Successful implementation of the DevSecOps practice consists of the following components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code analysis&lt;/strong&gt; is the process of investigating the source code of an application for vulnerabilities and ensuring that it follows security best practices.&lt;br&gt;
Change management&lt;/p&gt;

&lt;p&gt;Software teams use change management tools to track, manage, and report on changes related to the software or requirements. This prevents inadvertent security vulnerabilities due to a software change. &lt;br&gt;
Compliance management&lt;/p&gt;

&lt;p&gt;Software teams ensure that the software complies with regulatory requirements. For example, developers can use AWS CloudHSM to demonstrate compliance with security, privacy, and anti-tamper regulations such as HIPAA, FedRAMP, and PCI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Threat modeling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevSecOps teams investigate security issues that might arise before and after deploying the application. They fix any known issues and release an updated version of the application. &lt;br&gt;
Security training&lt;/p&gt;

&lt;p&gt;Security training involves training software developers and operations teams with the latest security guidelines. This way, the development and operations teams can make independent security decisions when building and deploying the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components of DevSecOps?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Code analysis&lt;/p&gt;

&lt;p&gt;Code analysis is the process of investigating the source code of an application for vulnerabilities and ensuring that it follows security best practices.&lt;br&gt;
Change management&lt;/p&gt;

&lt;p&gt;Software teams use change management tools to track, manage, and report on changes related to the software or requirements. This prevents inadvertent security vulnerabilities due to a software change.&lt;br&gt;
Compliance management&lt;/p&gt;

&lt;p&gt;Software teams ensure that the software complies with regulatory requirements. For example, developers can use AWS CloudHSM to demonstrate compliance with security, privacy, and anti-tamper regulations such as HIPAA, FedRAMP, and PCI.&lt;br&gt;
Threat modeling&lt;/p&gt;

&lt;p&gt;DevSecOps teams investigate security issues that might arise before and after deploying the application. They fix any known issues and release an updated version of the application.&lt;br&gt;
Security training&lt;/p&gt;

&lt;p&gt;Security training involves training software developers and operations teams with the latest security guidelines. This way, the development and operations teams can make independent security decisions when building and deploying the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DevSecops Best Pratices&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shift left&lt;/li&gt;
&lt;li&gt;Shift left is the process of checking for vulnerabilities in the earlier stages of software development. By following the process, software teams can prevent undetected security issues when they build the application. For example, developers create secure code in a DevSecOps process.&lt;/li&gt;
&lt;li&gt;Shift right&lt;/li&gt;
&lt;li&gt;Shift right indicates the importance of focusing on security after the application is deployed. Some vulnerabilities might escape earlier security checks and become apparent only when customers use the software. &lt;/li&gt;
&lt;li&gt;Use automated security tools&lt;/li&gt;
&lt;li&gt;DevSecOps teams might need to make multiple revisions in a day. To do that, they need to integrate security scanning tools into the CI/CD process. This prevents security evaluations from slowing down development. &lt;/li&gt;
&lt;li&gt;Promote security awareness&lt;/li&gt;
&lt;li&gt;Companies make security awareness a part of their core values when building software. Every team member who plays a role in developing applications must share the responsibility of protecting software users from security threats.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=video&amp;amp;cd=&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=2ahUKEwjb9_6M66D6AhXbh_0HHbMQBskQtwJ6BAgCEAI&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkzYQleQbgk4&amp;amp;usg=AOvVaw1GJdiJhYNLoNuo7cDUxIfF"&gt;Watch video&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://spacelift.io/blog/what-is-devsecops"&gt;Read more&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>security</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
