<?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 Brian Mayrose on Medium]]></title>
        <description><![CDATA[Stories by Brian Mayrose on Medium]]></description>
        <link>https://medium.com/@brianmayrose?source=rss-14c00d2e6b4c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l_M3lV7I0hJAWR99m9Z_vA.jpeg</url>
            <title>Stories by Brian Mayrose on Medium</title>
            <link>https://medium.com/@brianmayrose?source=rss-14c00d2e6b4c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:25:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brianmayrose/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[AWS EKS Helm deployment Cheat Sheet]]></title>
            <link>https://medium.com/@brianmayrose/aws-eks-helm-deployment-cheat-sheet-5896c50f8bc8?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5896c50f8bc8</guid>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 21:08:52 GMT</pubDate>
            <atom:updated>2025-07-24T21:08:52.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_pRiKiel3bwrF9rMip64A.jpeg" /></figure><h4>List all of the EKS clusters in a specific region</h4><pre>eksctl get cluster --region us-east-1</pre><p>Each row in the output gives a quick snapshot of a cluster living in the specified region. The <strong>NAME</strong> column displays the label associated with the cluster. You will often find environment references like dev, test, or prod here, but names can follow any convention. <strong>REGION</strong> confirms the geographical area where the cluster is operating, which matters if latency or compliance is a concern. The <strong>EKSCTL CREATED</strong> column serves as your flag. True indicates that the cluster was spun up usingeksctl, while False indicates it was created through another method, such as Terraform.</p><pre>testUser@Bash% eksctl get cluster --region us-west-1<br>NAME    REGION  EKSCTL CREATED<br>dev-cluster  us-west-1 True<br>test-cluster  us-west-1 True<br>prod-cluster  us-west-1 True<br>dev-cluster-3 us-west-1 False<br>dev-cluster-4  us-west-1 False</pre><p>This information is useful in determining which tools were originally designed for which cluster. This can be important in deciding how to update, tear down, or replicate deployments. eksctl Created clusters are generally easier to manage using eksctl commands. When the flag isFalse, those clusters might push back if you try using eksctl for edits or deletes.</p><p>If you are juggling multiple AWS profiles or managing clusters across different AWS accounts, consider using the --profile flag.</p><pre>eksctl get cluster --region us-west-1 --profile dev-admin</pre><h4>Describe a cluster:</h4><pre>aws eks describe-cluster --name dev-cluster --region us-west-1</pre><p>This command reaches out to the cloud and pulls back a full snapshot of the cluster’s contents, including everything from the endpoint URL it listens on to the VPC it is connected to. The response appears as a JSON block, dense with key-value pairs that provide a glimpse into the underlying structure.</p><ul><li>endpoint — The URL to which your workloads and tooling connect.</li><li>version — The specific version of Kubernetes it’s running.</li><li>status — Tells you whether the cluster is active, rolling out, or in a pending state.</li><li>resourcesVpcConfig — A map of how it’s wired into your network setup, including subnets and security groups.</li><li>identity — Handy if you’re dealing with IAM or federated users and need to check who has access.</li></ul><p>The JSON payload output can be overwhelming, especially if you are only looking for a single piece of information, such as an endpoint or Kubernetes version. You can filter it down by using jq :</p><pre>aws eks describe-cluster --name dev-cluster --region us-west-1 | jq &#39;.cluster.endpoint&#39;</pre><p>Or if you want to grab multiple fields and stitch them together in a readable way:</p><pre>aws eks describe-cluster --name dev-cluster --region us-west-1 | jq &#39;.cluster | {name: .name, version: .version, status: .status}&#39;</pre><p>This trims the noise and lets you focus on the handful of details that actually matter.</p><h4>Verify which AWS identity you are currently using</h4><pre>aws sts get-caller-identity</pre><p>This command verifies your credentials and returns a digital name tag. You will see a short JSON block that spells out three things:</p><ul><li>UserId — The internal AWS representation of your identity, useful behind the scenes but rarely something you type out manually.</li><li>Account — The 12-digit number tied to your AWS account. If you’re juggling sandbox, staging, and production environments, this tells you which one’s currently live under your fingertips.</li><li>Arn — The long, uniquely structured name that AWS uses to track permissions and access. If you’re assuming a role, it’ll be indicated here; it&#39;ll point to your IAM user or federated identity.</li></ul><pre>{<br>    &quot;UserId&quot;: &quot;AIDB7DST3JNGSIY&quot;,<br>    &quot;Account&quot;: &quot;76278999976555&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:iam::76278999976555:user/test.user@gmail.com&quot;<br>}</pre><p>This check is your <em>whoami</em> for AWS. It clarifies which credentials are active, which is very useful when switching between roles, different named profiles, or accounts in a shared development environment. This simple command can save you from accidentally causing changes in the wrong account.</p><p>This command can be added to a script as a sanity check:</p><pre>echo &quot;You&#39;re using account: $(aws sts get-caller-identity --query &#39;Account&#39; --output text)&quot;</pre><h4>Show current kubeconfig contexts and which one is active</h4><pre>kubectl config get-contexts<br>kubectl config current-context</pre><p>These two commands help you avoid deleting something from the wrong cluster.</p><ul><li>The get-context command lists every context your kubeconfig file knows about. Each context is a combination of a cluster, a user credential, and a default namespace.</li><li>The current-context command highlights the currently active context. That’s the cluster your next command will affect, whether you’re applying a manifest or scaling a deployment.</li></ul><pre>testUser@Bash% kubectl config get-contexts<br>CURRENT   NAME                       CLUSTER                                        AUTHINFO                       NAMESPACE<br>          dev-cluster   arn:aws:eks:us-west-1:76278999976555:cluster/dev-cluster   test.user@gmail.com<br>*         prod-cluster               prod-cluster                          test.user@gmail.com<br>          test-cluster               test-cluster                        test.user@gmail.com<br>          default                    default                                       default<br>          minikube                   minikube                                      minikube                        default<br>testUser@Bash% kubectl config current-context<br>prod-cluster</pre><p>If you spot that you are pointing at the wrong cluster, you can change it with this command:</p><pre>kubectl config use-context dev-cluster</pre><p>This will change your current session over to the dev-cluster environment.</p><p>You can also save some time by avoiding having to repeatedly set -n my-namespace Every single time by binding a namespace directly to a context:</p><pre>kubectl config set-context dev-cluster --namespace=my-namespace</pre><p>Next time you switch to dev-clusterIt’ll default to that namespace.</p><h4>Get the basic cluster info and API endpoints</h4><pre>kubectl cluster-info</pre><p>This command will tap into your current Kubernetes context and return the key URLs, which are essentially the addresses where the control plane and system services are listening.</p><pre>testUser@Bash% kubectl cluster-info<br>Kubernetes control plane is running at https://7682636FG7987.gr4.us-west-1.eks.amazonaws.com<br>CoreDNS is running at https://7682636FG7987.gr4.us-west-1.eks.amazonaws.com/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy<br><br>To further debug and diagnose cluster problems, use &#39;kubectl cluster-info dump&#39;.</pre><ul><li>Control Plane URL: This is the endpoint where your API requests are directed, whether you are creating pods, checking deployments, or inspecting logs.</li><li>CoreDNS URL: This one handles name resolution inside the cluster. It’s the address that resolves service names to IP addresses behind the scenes when one pod tries to communicate with another.</li></ul><h4>Output the entire cluster state information to a file</h4><pre>kubectl cluster-info &gt; cluster-dump.json</pre><p>If things seem off or you&#39;re troubleshooting and need more than surface-level information, try this command. This will output a massive chunk of raw diagnostic data. Details from the API server, system component logs, events, configs, and more. It’s the Kubernetes version of popping the hood and checking every wire and fluid level at once. Great for debugging or for piping into a support ticket when you don’t know what’s broken, but something definitely is.</p><p>Be aware that the dump output can be extensive, and some parts might include sensitive tokens or configuration details. Be cautious where you paste it and double-check before sharing it in public channels or forums.</p><h4>See all Nodes and their status</h4><pre>kubectl get nodes -o wide</pre><p>This command lays out all your worker nodes. Every machine, whether virtual or physical, which carries the weight of your Kubernetes workloads. The -o wide flag adds bonus columns that provide a deeper look at what each node is running, how long it has been around, and how it fits into the bigger picture.</p><ul><li>NAME — The internal hostname of the node. AWS assigns these, and they’re usually not very user-friendly, but they&#39;re useful for tracking logs and matching them up with EC2 instance IDs.</li><li>STATUS — This indicates whether the node is ready to run pods. You’re looking for “Ready”. Anything else, like NotReady, SchedulingDisabled, or Unknown, might be a red flag worth chasing down.</li><li>ROLES — Control plane nodes are often labeled asmaster, but in EKS setups, this field is frequently empty. Still, custom roles can appear here if you’ve manually labeled nodes.</li><li>AGE — Tells you how long the node’s been part of the cluster. A cluster where nodes are constantly joining and leaving may be experiencing autoscaling, or it may be unstable.</li><li>VERSION — The Kubernetes version running on the node. All nodes in production should be on the same version unless you’re in the middle of a rolling upgrade.</li><li>INTERNAL-IP / EXTERNAL-IP — These show how the node is reached inside the cluster vs. from outside. Internal IPs are used by pods and services for communication, while external IPs are more relevant for public endpoints or SSH access.</li><li>OS-IMAGE / KERNAL-VERSION — These give away what kind of system you’re running under the hood. Amazon Linux 2 is commonly used for EKS, but these fields can serve as a quick heads-up if someone has snuck in something unexpected.</li><li>CONTAINER-RUNTIME — Most modern clusters use containerd, but older setups might still run Docker. The runtime affects logging behavior, security boundaries, and sometimes even bug behavior.</li></ul><pre>testUser@Bash% kubectl get nodes -o wide<br>NAME                                           STATUS   ROLES    AGE   VERSION                INTERNAL-IP      EXTERNAL-IP     OS-IMAGE         KERNEL-VERSION                  CONTAINER-RUNTIME<br>ip-192-168-4-434.us-west-1.compute.internal    Ready    &lt;none&gt;   13d   v1.27.16-eks-aeac579   192.168.4.434   4.44.545.234    Amazon Linux 2   5.10.236-228.935.amzn2.x86_64   containerd://1.8.38<br>ip-192-168-5-545.us-west-1.compute.internal    Ready    &lt;none&gt;   13d   v1.27.16-eks-aeac579   192.168.5.545    4.44.545.235   Amazon Linux 2   5.10.236-228.935.amzn2.x86_64   containerd://1.8.38<br>ip-192-168-6-656.us-west-1.compute.internal    Ready    &lt;none&gt;   13d   v1.27.16-eks-aeac579   192.168.6.656   4.44.545.236    Amazon Linux 2   5.10.236-228.935.amzn2.x86_64   containerd://1.8.38<br></pre><ul><li>Mixed versions across nodes can cause weird behaviour, especially if newer APIs are being used by workloads, but some nodes haven’t caught up yet.</li><li>Node status not “Ready” can hint at issues like resource exhaustion, plugin failure, or control plane communication loss.</li><li>No external IP? This is normal for private clusters or internal-only setups, but it means you won’t be able to SSH in without a VPN.</li></ul><h4>Get detailed info for a specific node</h4><pre>kubectl describe node &lt;node-name&gt;</pre><p>This command retrieves the details of a specific node, providing a detailed status report, system vitals, and a list of currently running processes on the node.</p><ul><li><strong>Name</strong> — confirms you are viewing the correct node</li><li><strong>Labels</strong> — These are key-value pairs that help the scheduler decide where to run pods. Maybe it’s labeled zone=us-west-1 or type=gpu that is useful for targeting workloads with nodeSelector or affinity rules.</li><li><strong>Conditions</strong> — Think of this as the node’s self-reported health check. It’ll list things like Ready, MemoryPressure, DiskPressure, and PIDPressure. If something’s False when it should be True or vice versa, it is worth investigating.</li><li><strong>Addresses</strong> — These display both internal and external IP addresses, as well as DNS names. Handy if you’re tracing a connection issue or mapping traffic flow.</li><li><strong>Capacity vs. Allocation</strong> — The first shows total resources (CPU, memory), while the second shows what’s actually available for pods to use after system overhead is subtracted.</li><li><strong>System Info</strong> — Kernel version, OS image, and container runtime. You’ll want consistency across your fleet unless you’re intentionally testing out upgrades.</li><li><strong>Pods</strong> — Lists everything currently assigned to that node. If it appears overloaded or oddly underutilized, it could indicate that the scheduler is biased in one direction or a taint is influencing pod placement everywhere.</li><li><strong>Allocated Resources </strong>— Tells you how much of the node’s available CPU and memory is already spoken for. Great for spotting nodes that are barely working or on the verge of being overwhelmed.</li><li><strong>Events</strong> — This is your rolling log of what’s been going on, things like kubelet errors, container failures, network flakiness, or other behind-the-scenes issues.</li></ul><p>This command is ideal for debugging scheduling issues, understanding crashes, and fine-tuning resource allocation.</p><p>Here is a good shortcut to compare resources and pods in each node.</p><pre>for node in $(kubectl get nodes -o name); do<br>  echo &quot;======== $node ========&quot;<br>  kubectl describe $node | grep -A 50 &quot;Non-terminated Pods:&quot;<br>done</pre><h4>List all namespaces</h4><pre>kubectl get namespaces</pre><p>This command lists the distinct compartments into which your cluster is divided. Think of namespaces as invisible walls that separate workloads. Each one has its own sandbox, containing resources, access controls, and service scopes.</p><p>Namespaces are more than labels; they shape how workloads behave:</p><ul><li>Resource isolation — You can limit CPU and memory per namespace using LimitRange and ResourceQuota objects.</li><li>Access control — RBAC can lock down specific namespaces, allowing team or service accounts to interact only with what they’re authorized to.</li><li>Scoped names — Services, secrets, and config maps with the same name can exist in different namespaces without clashing. Think: dev, staging, and prod each with their own app-config.</li></ul><pre>testUser@Bash% kubectl get namespaces<br>NAME              STATUS   AGE<br>default           Active   14d<br>kube-public       Active   14d<br>kube-system       Active   14d</pre><ul><li>default — This is where your workloads go if you don’t specify otherwise. It’s the Kubernetes equivalent of tossing something in the main hallway when you’re not sure where it should live.</li><li>kube-system — Reserved for core components and services that keep the cluster ticking, like kube-dns, kube-proxy, and others. You usually don’t mess with this unless you’re debugging cluster internals.</li><li>kube-public — A special read-only space mostly used for bootstrapping and cluster-level visibility. Most people don’t access this much, but it’s there if you need public information shared across the cluster.</li></ul><h4>List all pods across a specific namespace</h4><pre>kubectl get pods -n  &lt;namespace name&gt;</pre><p>This command examines the specified namespace and lists all pods residing within it. It’s your go-to snapshot for checking whether things are humming, stalled, or quietly crashing in the background.</p><p>This command is crucial for verifying whether a new rollout was successful, checking if pods are healthy, or detecting memory crashes or networking issues. Look for repeated restarts or non-running statuses.</p><pre>testUser@Bash% kubectl get pods -n kube-system<br>NAME                                 READY   STATUS    RESTARTS   AGE<br>aws-node-77kbn                       2/2     Running   0          14d<br>coredns-737hy-fdgdfhhhffgh           1/1     Running   0          6d<br>eks-pod-identity-agent-777gh         1/1     Running   0          6d<br>kube-proxy-6thr4                     1/1     Running   0          6d<br>metrics-server-345ghtnghg5-45gtdf    1/1     Running   0          14d</pre><ul><li><strong>NAME</strong> — The pod’s full identifier usually includes part of the Deployment or DaemonSet name plus a unique suffix.</li><li><strong>READY</strong> — A fraction showing how many containers inside the pod are up and healthy. If it says 2/2, both containers are alive and passing health checks.</li><li><strong>STATUS</strong> — Could be Running, Pending, CrashLoopBackOff, ImagePullBackOff, or something else entirely. It’s the current heartbeat of that pod.</li><li><strong>RESTARTS</strong>— Tells you how many times containers inside the pod have failed and been automatically restarted. This number is creeping up, which could signal that something deeper is going wrong.</li><li><strong>AGE</strong> — How long the pod has been around. If pods keep getting recreated, this number resets, and that could indicate instability in the workload or its configuration.</li></ul><h4>Get Everything Living Inside A Namespace</h4><pre>kubectl get all -n &lt;namespace name&gt;</pre><p>This command pulls together a wide-angle snapshot of what’s running in a given namespace. There is no need to ask about pods, deployments, or services separately. It’s one of those “just show me everything” moments, especially useful during triage, audits, or rollout checks.</p><p>This can be extremely useful during rollouts to verify that your new deployment has created the expected pods and services and that they’re actually running. Or if a pod’s stuck in a CrashLoopBackOff, this command will tell you where it fits in the hierarchy and what else might be affected. It can also give you a sense of what parts of the default Kubernetes system have been modified versus what has been added manually.</p><pre>testUser@Bash% kubectl get all -n kube-system<br>NAME                                     READY   STATUS    RESTARTS   AGE<br>pod/kube-proxy-t4t4t                     1/1     Running   0          6d<br>pod/metrics-server-rgrgs434g4-43g3g      1/1     Running   0          14d<br><br>NAME                                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE<br>service/kube-dns                    ClusterIP   10.100.0.10     &lt;none&gt;        53/UDP,53/TCP,9153/TCP   14d<br><br>NAME                                    DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR              AGE<br>daemonset.apps/kube-proxy               3         3         3       3            3           &lt;none&gt;                     14d<br><br>NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE<br>deployment.apps/coredns              2/2     2            2           14d<br><br>NAME                                           DESIRED   CURRENT   READY   AGE<br>replicaset.apps/coredns-5664gg443sfg4          2         2         2       6d<br>replicaset.apps/metrics-server-5tgd3rgr4g      2         2         2       14d<br></pre><ul><li>Pods — Each running workload, usually created by a higher-level controller like a deployment or daemonset.</li><li>Services — These provide stable network access to pods. If a pod is recreated or moved, the service ensures that traffic continues to flow.</li><li>DaemonSets- One Pod per node, typically used for system-level stuff like networking agents or log collectors. kube-proxy is a classic example.</li><li>Deployments — The brains behind many stateless apps. They manage ReplicaSets and keep pods in the desired state.</li><li>ReplicaSets — The muscle behind deployments. You don’t usually interact with these directly, but they keep the right number of pod replicas alive.</li></ul><h4>Describe a pod in a specific namespace</h4><pre>kubectl describe pod &lt;podname&gt; -n &lt;namespace name&gt;</pre><p>This command opens the pod, similar to a patient chart, complete with metadata, container configuration, running state, volume mounts, and a log of recent events.</p><p>This command is useful if a pod gets stuck in CrashLoopBackOff or refuses to start. the Events sections, often where you can find the root of the issues. It is also useful if you want to double-check a container image tag, port, or mounted secret. The restart counter in the container info indicates whether the pod is healthy or simply adept at rebooting.</p><p>What you will see:</p><ul><li><strong>Name / Name</strong> — Just a sanity check confirming that you are looking at the right pod in the right place.</li><li><strong>Node </strong>— Tells you which worker node the pod is actually running on. Useful if you’re tracking down resource issues or node-specific errors.</li><li><strong>Labels and Annotations </strong>— These tags help Kubernetes organize and select pods. Labels are like folders, and annotations are more like sticky notes.</li><li><strong>IP Addresses</strong> — You’ll see the pod IP, and sometimes the host IP. These can be particularly helpful when debugging network issues or tracing service paths.</li><li><strong>Container Details</strong> — This section provides comprehensive coverage, including image names, restart counts, resource limits and requests, and environment variables. If a pod is misbehaving, this is where you would start your investigation.</li><li><strong>Volumes and Mounts</strong> — Whether it’s mounting ConfigMaps, Secrets, or PVCs, this part shows where data’s coming from and where it lands inside the container.</li><li><strong>Readiness and Liveness Probes </strong>— If your pod is marked as Running but isn’t getting traffic, check the readiness probe. Liveness probes can also explain unexpected restarts.</li><li><strong>Events</strong> — This is your activity log. You’ll see things like image pull failures, container crashes, scheduling delays, or even eviction notices if the node runs out of memory.</li></ul><h4>Show all installed CRDs</h4><pre>kubectl get crds | grep &lt;keyword&gt;</pre><p>This command lists every custom building block that’s been added to your Kubernetes cluster. These are CRDs, Custom Resource Definitions. They are the rulebooks for resources that Kubernetes doesn’t understand out of the box, but can manage once someone teaches it how to do so.</p><pre>testUser@Bash% kubectl get crds | grep elastic<br>agents.agent.k8s.elastic.co                            2025-06-12T17:28:24Z<br>apmservers.apm.k8s.elastic.co                          2025-06-12T17:28:24Z<br>beats.beat.k8s.elastic.co                              2025-06-12T17:28:24Z<br>elasticmapsservers.maps.k8s.elastic.co                 2025-06-12T17:28:24Z<br>elasticsearchautoscalers.autoscaling.k8s.elastic.co    2025-06-12T17:28:24Z<br>elasticsearches.elasticsearch.k8s.elastic.co           2025-06-12T17:28:24Z<br>enterprisesearches.enterprisesearch.k8s.elastic.co     2025-06-12T17:28:24Z<br>kibanas.kibana.k8s.elastic.co                          2025-06-12T17:28:24Z<br>logstashes.logstash.k8s.elastic.co                     2025-06-12T17:28:24Z<br>stackconfigpolicies.stackconfigpolicy.k8s.elastic.co   2025-06-12T17:28:24</pre><p>Each line represents a new kind of object you can interact with using kubectl, just like you would with pods, services, or deployments.</p><p>CRDs let you define and work with completely new types of resources like Elasticsearch, Kibana, or Logstash using native Kubernetes tooling. It is how tools like the Elastic Operator plug themselves into your cluster and extend its vocabulary. Once these are installed, you can do things like:</p><pre>kubectl get elasticsearch<br>kubectl describe kibana kibana-instance<br>kubectl apply -f the-deployment.yml</pre><p>All of that works because the CRDs above were installed and now act as blueprints for those custom objects.</p><h4>List Elasticsearch clusters&#39; custom resources</h4><pre>kubectl get elasticsearch -n &lt;namespace&gt;</pre><p>This command gives you a snapshot of any Elasticsearch clusters defined via the Elastic Operator in a specific namespace. You’re not just running pods, you are looking at the top-level object the Operator manages and reconciles continuously.</p><p>This is your Operator-friendly control panel. If you’re managing multiple environments across namespaces, this command instantly shows which clusters are healthy, which are scaling, and which might be stuck. It can help to spot mismatched versions, confirm if nodes are scaling up and down as expected, and catch health issues without needing to log into Kibana or run a curl against the _cluster/health endpoint.</p><p>The output given:</p><ul><li>NAME — This is the name of your Elasticsearch custom resource, which typically maps to a set of StatefulSets and Pods running in your cluster.</li><li>HEALTH — Tells you the status of the Elasticsearch cluster. You’re aiming for green (fully allocated shards, everything running smoothly), though yellow may appear if replicas haven’t fully initialized yet. red is not so great.</li><li>Nodes — Shows how many Elasticsearch nodes are active. These could be spread across data, ingest, master, or coordinating roles depending on your config.</li><li>VERSION — Reflects the Elasticsearch version declared in your CR spec. This is managed by the Operator and can be automatically upgraded if configured.</li><li>PHASE — This represents the Operator’s lifecycle tracking. Ready indicates that the cluster is healthy and all expected components are operational. You might also see ApplyingChanges, Error, or Upgrading depending on what’s happening behind the scenes.</li><li>AGE — How long ago the resource was created. Useful for tracing back to deployments or updates.</li></ul><h4>List StatefulSets</h4><pre>kubectl get statefulsets -n &lt;namespace&gt;</pre><p>This command returns a list of StatefulSets, which are Kubernetes workloads tailored for applications that need stable network IDs, persistent storage, and predictable pod ordering. Unlike Deployments, which create interchangeable pods, StatefulSets assign each pod a unique, persistent identity and retain that name across restarts.</p><p>StatefulSets are useful for creating data storage consistency by giving each pod a persistent volume that will not get recycled or reassigned to another pod, even if it is deleted.</p><p>Pods in a StatefulSet are updated one at a time, through rolling updates, with careful orchestration to avoid taking the whole service offline.</p><p>This command is particularly helpful when managing clustered data services, such as Elasticsearch. Checking whether scaling worked as expected, and when you are watching a rollout or restart and want to verify the updated process is moving forward.</p><pre>testUser@Bash% kubectl get statefulsets -n elastic-system<br>NAME                           READY   AGE<br>elastic-operator               1/1     12d<br>elasticsearch-dev-default   3/3     5d10h</pre><h4>Inspect EKS Operator logs</h4><pre>kubectl logs -n elastic-system sts/elastic-operator</pre><p>This captures the raw output directly from the Elastic Operator running in your cluster, which is useful when trying to understand what the Operator is doing or not doing, especially during cluster provisioning, upgrades, or troubleshooting stuck resources.</p><p>The Elastic Operator is the brain managing your Elasticsearch, Kibana, APM, and Beats resources inside Kubernetes. If something seems off, stuck phases, missing nodes, or no scaling. You will want to check what the Operator thinks is happening.</p><p>The logs will indicate when reconciliation starts and ends, the namespace and custom resource being acted upon, whether enterprise-only features are being ignored, and the version of the Operator, along with its iteration counter.</p><p>These logs are valuable during real-world scenarios, like when a new Elasticsearch cluster never reaches Ready phase. The Operator logs often explain why the cluster is not ready, like a wrong volume type, missing image, or a broken nodeSet config</p><pre>{&quot;log.level&quot;:&quot;info&quot;,&quot;@timestamp&quot;:&quot;2025-06-25T03:17:34.103Z&quot;,&quot;log.logger&quot;:&quot;stackconfigpolicy-controller&quot;,&quot;message&quot;:&quot;Starting reconciliation run&quot;,&quot;service.version&quot;:&quot;3.0.0+89a41511&quot;,&quot;service.type&quot;:&quot;eck&quot;,&quot;ecs.version&quot;:&quot;1.4.0&quot;,&quot;iteration&quot;:&quot;696&quot;,&quot;namespace&quot;:&quot;elastic-test&quot;,&quot;policy_name&quot;:&quot;test&quot;}<br>{&quot;log.level&quot;:&quot;info&quot;,&quot;@timestamp&quot;:&quot;2025-06-25T03:17:34.104Z&quot;,&quot;log.logger&quot;:&quot;stackconfigpolicy-controller&quot;,&quot;message&quot;:&quot;StackConfigPolicy is an enterprise feature. Enterprise features are disabled&quot;,&quot;service.version&quot;:&quot;3.0.0+89a41511&quot;,&quot;service.type&quot;:&quot;eck&quot;,&quot;ecs.version&quot;:&quot;1.4.0&quot;,&quot;iteration&quot;:&quot;696&quot;,&quot;namespace&quot;:&quot;elastic-test&quot;,&quot;policy_name&quot;:&quot;test&quot;}<br>{&quot;log.level&quot;:&quot;info&quot;,&quot;@timestamp&quot;:&quot;2025-06-25T03:17:34.112Z&quot;,&quot;log.logger&quot;:&quot;stackconfigpolicy-controller&quot;,&quot;message&quot;:&quot;Ending reconciliation run&quot;,&quot;service.version&quot;:&quot;3.0.0+89a41511&quot;,&quot;service.type&quot;:&quot;eck&quot;,&quot;ecs.version&quot;:&quot;1.4.0&quot;,&quot;iteration&quot;:&quot;696&quot;,&quot;namespace&quot;:&quot;elastic-test&quot;,&quot;policy_name&quot;:&quot;test&quot;,&quot;took&quot;:0.009096932}</pre><p>Works great with filters:</p><p>Grep for errors or warnings:</p><pre>kubectl logs -n elastic-system sts/elastic-operator | grep -i error</pre><p>Live view while triggering changes:</p><pre>kubectl logs -n elastic-system -f sts/elastic-operator</pre><h4>View Available StorageClasses</h4><pre>kubectl get storageclass</pre><p>This command displays the list of configured StorageClasses, which Kubernetes uses when dynamically creating persistent volumes. These definitions specify the type of underlying storage to use (such as AWS EBS, GCE PD, or Ceph), how volumes are provisioned, and how they behave when deleted or resized.</p><p>This command is useful for debugging why a PVC is stuck in a Pending state. The problem might be that no matching StorageClass exists, or the default is misconfigured. Or if you want to know if your volumes are automatically deleted or hanging around after use, this command will tell you. Also, being able to see both in-tree (kubernetes.io/aws-ebs) and CSI-based (ebs.csi.aws.com) provisioners can help determine whether you’re ready to deprecate older storage paths.</p><pre>testUser@Bash% kubectl get storageclass<br>NAME              PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE<br>gp2 (default)     kubernetes.io/aws-ebs   Delete          WaitForFirstConsumer   false                  14d<br>gp2-csi-aws-ebs   ebs.csi.aws.com         Delete          WaitForFirstConsumer   false                  12d</pre><ul><li>NAME — identifier for the StorageClass. The one marked (default) is used if a PVC doesn’t explicitly ask for a class.</li><li>PROVISIONER — This defines what plugin (or CSI driver) handles volume creation. Legacy provisioners like kubernetes.io/aws-ebs are gradually being replaced by CSI drivers like ebs.csi.aws.com</li><li>RECLAIMPOLICY — This determines what happens to a volume once its claim is deleted. Delete means the volume will be wiped; Retain leaves it intact for manual cleanup or reuse.</li><li>VOLUMEBINDINGMODE — Controls when volume provisioning and binding occur. Immediate means it happens on claim creation, WaitForFirstConsumer waits until a pod is scheduled, useful in multi-zone clusters to avoid cross-zone attachment issues.</li><li>ALLOWVOLUMEEXPANSION — If set to true, you can resize PVCs that use this class.</li></ul><p>You can get more information about a specific StorageClass</p><pre>kubectl describe storageclass gp2</pre><p>This will show parameters like volume type ( gp2, gp3, io1 ), encryption settings, zone awareness, and everything else the provisioned uses to build a volume.</p><p>Another useful command that allows you to see which PVCs are using which StorageClass:</p><pre>kubectl get pvc --all-namespaces -o custom-columns=&quot;NAMESPACE:.metadata.namespace,NAME:.metadata.name,STORAGECLASS:.spec.storageClassName,STATUS:.status.phase&quot;</pre><h4>Check PersistentVolumeClaims in a specific namespace</h4><pre>kubectl get pvc -n elastic-system</pre><p>This command lists all PersistentVolumeClaims (PVCs) in the specified namespace. A PVC is a request for storage made by a pod; it asks for a certain size, access mode, and a specific StorageClass. If a matching PersistentVolume (PV) is available or a StorageClass can dynamically create one, the claim is bound, and the pod is assigned its disk.</p><p>This command is useful in diagnosing stuck PVCs, checking for reclaim issues when a PVC is deleted, but PVs weren’t cleaned up, you might see leftover or Released volumes and to track usage across services.</p><p>The output will contain:</p><ul><li>NAME — The name of the PVC. Often, this is auto-generated when using an operator for a Helm chart.</li><li>STATUS — Shows whether the claim is Pending, Bound, or Lost. If it’s Pending, the volume hasn’t been provisioned or matched yet.</li><li>VOLUME — The name of the PersistentVolume this claim is attached to.</li><li>CAPACITY — The amount of storage requested and granted.</li><li>ACCESS MODES — Such as RWO (ReadWriteOnce), ROX (ReadOnlyMany), or RWX (ReadWriteMany). These determine how the volume can be mounted across pods.</li><li>AGE — How long the claim has existed</li></ul><p>Using a describe can show the event timeline, storageClass parameters, volume binding info, and any errors encountered during provisioning.</p><pre>kubectl describe pvc &lt;pvc-name&gt; -n &lt;namespace&gt;</pre><p>Another useful trick is to use grep to see what pod is using a PVC</p><pre>kubectl get pods -n &lt;namespace&gt; -o wide | grep &lt;pvc-name-fragment&gt;</pre><h4>Get chronologically sorted Kubernetes events</h4><pre>kubectl get events -n elastic-system --sort-by=&#39;.metadata.creationTimestamp&#39;</pre><p>This command retrieves a running log of events that have occurred within the cluster, scoped to a specific namespace. Events are like system messages; they record pod scheduling, image pulls, node pressure, restarts, probes failing, volume mounting, and more. Sorting by creation timestamp helps you trace issues in the exact order they occurred, which is essential when dealing with startup failures, cascading restarts, or mysterious pod behavior.</p><p>This might return No resources found in default namespace if everything is running without any restarts or if there is no current event data in the Kubernetes event store for the specific namespace.</p><p>This command provides insight into how events unfold and offers details on issues with scheduling, provisioning, probe failures, restarts, and evictions.</p><p>You would use this if a pod is stuck in a CrashLoopBackOff, or a volume is not attaching give FailedAttachVolume or a AttachVolume.Attach failed, or an image won’t pull. You will see possible ErrImagePull, ImagePullBackOff, or auth issues.</p><p>Remember that you can use the watch command to watch events live:</p><pre>watch kubectl get events -n elastic-system --sort-by=&#39;.metadata.creationTimestamp&#39;</pre><h4>Observe Pod Events for Recent Warnings and Failures</h4><pre>kubectl describe pod &lt;pod-name&gt; -n elastic-system | awk &#39;/Events:/,/^$/&#39;</pre><p>This command will focus on the Events section of a specific pod without flooding your screen with unrelated spec fields or container metadata. It’s a quick way to check what’s happened to that pod recently, whether it’s dealing with mounting failures, image pull errors, or backoff loops.</p><p>The output is consolidated so that you don’t need to scroll through the entire describe output. Events are also chronologically timestamped, providing a brief narrative about the pod’s life so far. Unlike kubectl get events This command is scoped directly to the pod, so you skip unrelated noise from other resources.</p><p>This command would be great to use when a pod has been stuck in Pending and you are unsure why. This will show “FailedScheduling” or “Insufficient CPU” It can also be used when a container crashes shortly after it starts up. You can expect to see “Backoff” or “CrashLoopBackOff” If a PersistentVolume is not attached, you might see “FailedMount” or “AttachVolume.Attach failed” Along with the node or zone mismatch, it is being blocked.</p><p>Combined with the watch command, you can see new events happen in near real time:</p><pre>watch kubectl get events -n elastic-system --sort-by=&#39;.metadata.creationTimeStamp&#39;</pre><h4>List all Helm releases in the elastic-system namespace</h4><pre>helm list -n &lt;namespace&gt;</pre><p>This command pulls in a list of Helm releases installed in the specified namespace. Each release represents a chart that has been deployed, whether it is an operator, a monitoring stack, or a production-grade app.</p><pre>testUser@Bash% helm list -n elastic-system<br>NAME             NAMESPACE      REVISION UPDATED                              STATUS   CHART              APP VERSION<br>elastic-operator elastic-system 1        2025-06-12 12:28:21.971857 -0500 CDT deployed eck-operator-3.0.0 3.0.0</pre><p>What&#39;s in the Output:</p><ul><li>NAME — The name of the Helm release. This is how you will refer to it for upgrades, rollbacks, or uninstalling.</li><li>NAMESPACE — Where the release is deployed. Helm 3 installs are namespace-scoped by default.</li><li>REVISION — The version of the release. Every time you runhelm upgrade, this number ticks up. If you are at5, the chart’s been updated five times.</li><li>Updated — Timestamp of the last successful install or upgrade.</li><li>STATUS — Should say deployed if everything’s working. Other statuses include pending-upgrade, failed, or uninstalled.</li><li>CHART — The chart name and version that was used. Helpful for auditing or matching chart values with version-specific behaviors.</li><li>APP VERSION — The actual version of the application or service the chart is deployed on. This may differ from the chart version.</li></ul><p>This command is particularly helpful if you want to check the deployment status, audit what is running where, and prepare for rollbacks.</p><h4>List All Helm Releases Accross the Entire Cluster</h4><pre>helm list --all-namespaces</pre><p>This command scans every namespace and displays all Helm-managed releases installed across the cluster. It’s the wide-angle lens you reach for when you’re unsure where something was deployed or when you’re managing a shared environment and want full visibility.</p><p>Sample output:</p><pre>NAME               NAMESPACE        REVISION UPDATED                                 STATUS     CHART              APP VERSION<br>elastic-operator   elastic-system   1        2025-06-12 12:28:21.971857 -0500 CDT    deployed   eck-operator-3.0.0 3.0.0<br>kibana             elastic-system   2        2025-06-18 15:02:00.782919 -0500 CDT    deployed   kibana-8.17.1      8.17.1<br>prom-stack         monitoring       5        2025-06-10 10:41:32.102939 -0500 CDT    deployed   kube-prometheus   46.5.0</pre><p>Breakdown:</p><ul><li>NAME — The release name you would use in commands like helm upgrade, rollback, or uninstall.</li><li>NAMESPACE — Where the release lives. This matter since Helm 3 uses namespace-scoped installs by default.</li><li>REVISION — The number of times the release has been updated. Higher numbers mean a longer history and potentially more rollback points.</li><li>UPDATED — Timestamp of the release was modified (installed, upgraded, or rolled back).</li><li>STATUS — Whether the release is healthy ( deployed ), in the middle of something ( pending-upgrade ), or failed.</li><li>CHART/APP VERSION — The Helm chart used and the version of the actual app deployed.</li></ul><p>This command is helpful for auditing across the entire cluster. It will show what charts are installed where. You can verify what versions are running before planning upgrades. Additionally, if something is running in the wrong namespace or a duplicate release exists, this issue is quickly surfaced.</p><h4>Install a Helm release</h4><pre>helm install &lt;name&gt; &lt;release&gt; -n &lt;namespace&gt;</pre><p>This command creates a new Helm-managed deployment in the specified namespace. You’re giving it a name (your label for the release), pointing to a chart (either local or from a remote repo), and telling it where to live.</p><p>Example:</p><pre>helm install elastic-operator elastic/eck-operator -n elastic-system</pre><p>This example creates a release called elastic-operator, using the eck-operator chart from the elastic repository, and installs it into the elastic-system namespace.</p><p>This will:</p><ul><li>Helm pulls the chart and unpacks it into templates</li><li>It fills in any values (defaults unless you override them).</li><li>It renders Kubernetes manifests.</li><li>It pushes those manifests to the Kubernetes API and creates the resources.</li><li>It tracks the release and revision in a hidden ConfigMap or Secret for version history and rollbacks.</li></ul><p>This command is customizable. For example, you can add a --values file during and install:</p><pre>helm install elasticsearch elastic/elasticsearch -f custom-values.yaml -n elastic-system</pre><p>or overide individual values inline:</p><pre>helm install kibana elastic/kibana \<br>  --set replicas=2,image.tag=8.17.1 \<br>  -n elastic-system</pre><p>Helpful Flags</p><ul><li>--create-namespace — Creates the namespace if it doesn’t already exist.</li><li>--wait — Waits until all resources are up and running before returning.</li><li>--timeout=5m — Controls how long Helm waits when paired with --wait</li><li>--atomic — Rolls back automatically if the install fails.</li><li>--dry-run — Perfect to see what Helm would apply without making changes. Perfect for validating templates, checking rendered YAML, or catching misconfiguration before they hit the cluster.</li></ul><h4>Uninstall Helm release</h4><pre>helm uninstall &lt;name&gt; -n &lt;namespace&gt;</pre><p>This command will wipe out a Helm-managed release from the cluster. It tears down the Kubernetes resources that were created by the chart: deployments, services, Statefulsets, secrets, config maps, and PVCs. It will only touch the resources Helm tracks as part of that release.</p><p>Persistant Volume Claims (PVCs) often stick around after uninstalling if they were created by StatefulSets and might need to be removed manually.</p><p>Custom Resource Definitions (CRDs) are not deleted by Helm unless explicitly declared in the chart’s crds/ directory. This is meant to prevent unintended cluster-wide changes.</p><p>Helm will delete the Kubernetes resources associated with the release. The release record is then removed unless you used --keep-history .</p><p>Optional Flags</p><ul><li>--keep-history — Leaves behind Helm’s internal metadata, so you can inspect or rollback later, even though the resources are gone.</li><li>--no-hooks — Skips running any delete hooks defined in the chart.</li></ul><h4>Eck Operator Deployment Status</h4><pre>helm status elastic-operator -n elastic-system</pre><p>This command gives a summary of the Helm release named elastic-operator inside the elastic-system namespace. It’s your quick glance at health check to confirm that the installation completed successfully and that the operator is currently in a good state.</p><pre>testUser@Bash% helm status elastic-operator -n elastic-system<br>NAME: elastic-operator<br>LAST DEPLOYED: Thu Jun 12 12:28:21 2025<br>NAMESPACE: elastic-system<br>STATUS: deployed<br>REVISION: 1<br>TEST SUITE: None<br>NOTES:<br>1. Inspect the operator logs by running the following command:<br>   kubectl logs -n elastic-system sts/elastic-operator</pre><p>What each field means:</p><ul><li>NAME — The release name used when installed</li><li>LAST DEPLOYED — Timestamp of the most recent install, upgrade, or rollback.</li><li>NAMESPACE — Where the release is scoped. Helm 3 installs are namespace-aware by default.</li><li>STATUS — Reflects the current state: deployed, pending-upgrade, failed, uninstalled, etc. A healthy chart should sit at deployed.</li><li>REVISION — How many times the release has been modified. If this number increases, someone is either upgrading or experimenting.</li><li>TEST SUITE — This is typically None unless the chart includes test hooks. Most infrastructure charts skip this.</li><li>NOTES — any post-install hints or usage guidance defined by the chart maintainers. These can be gold, pointing you to log commands, sample CRs, or next steps.</li></ul><p>The output can confirm your Helm release is not stuck in pending-install limbo or quietly marked as failed. The timestamp can help with aligning Helm actions with resource creation, upgrades, and troubleshooting windows. The notes section can often include follow-up commands, such as creating a CR or inspecting the log.</p><h4>Port Forward Elasticsearch HTTP port to localhost</h4><pre>kubectl port-forward service/elasticsearch-default 9200:9200 -n elastic-system</pre><p>This command creates a tunnel between your local machine and the Kubernetes service named elasticsearch-default, mapping its internal port 9200 to your own system’s localhost:9200. This gives you a direct connection to the Elasticsearch REST API.</p><p>Once the port forward is active, open a new terminal and run:</p><pre>curl http://localhost:9200</pre><p>kubectl port-forward blocks the terminal and supports a single session, so you will need multiple terminals if you want to multitask. Additionally, if you close the terminal, the session will be terminated. If you want a more permanent setup, consider an ingress or LoadBalancer with proper authentication.</p><h4>List encrypted secrets</h4><pre>kubectl get secrets -n elastic-system | grep elasticsearch-dev</pre><p>This command filters the list of Kubernetes secrets in the elastic-system namespace, returning only those whose names include elasticsearch-dev. These are typically generated and managed by the Elastic Operator when it provisions resources, such as the cluster, user credentials, certificates, and service tokens.</p><p>Example output:</p><pre>elasticsearch-dev-es-elastic-user    Opaque    3     5d<br>elasticsearch-dev-es-http-certs-public  Opaque    2     5d<br>elasticsearch-dev-es-transport-certs   Opaque    3     5d</pre><p>What are these secrets:</p><ul><li>elasticsearch-dev-es-elastic-user — Contains the base64-encoded password for the elastic superuser account. This is often the credential used for initial auth into the Elasticsearch API.</li><li>-certs-public/-certs — TLS certificates and keys used by pods, services, or clients communicating with the cluster.</li></ul><p>These secrets appear as Opaque types, meaning Kubernetes treats them as arbitrary key-value pairs. While Kubernetes stores secrets in base64, it is important to note:</p><ul><li>Secrets are not encrypted at rest by default, unless you have configured envelope encryption on your cluster.</li><li>They are encrypted in transit when you use TLS to talk to the Kubernetes API.</li></ul><h4>Decode a secret</h4><pre>kubectl get secret &lt;secret name&gt; \<br> -n elastic-search \<br> -o go-template=&#39;{{ .data.elastic | base64decode }}&#39;</pre><p>This command will grab the Kubernetes secret, pull out the base64-encoded value for the key elastic, and decodes it on the fly. What you get back is typically a password, token, or certificate. This is useful for testing, scripting, or securely injecting into local dev tools.</p><h4>Build and run a deployment</h4><pre>kubectl apply -f &lt;manifest_file.yml&gt;</pre><p>This command tells Kubernetes to take whatever is defined inside your manifest file, whether that is a Deployment, Service, Configmap, or a full multi-resource bundle, and bring it to life inside the cluster. If the resources already exist, Kubernetes doesn’t blow them away, it will patch them, updating only the field that changed. If they don’t exist yet, it creates them.</p><p>This is declarative infrastructure in action: you describe what the world should look like, and Kubernetes makes it happen.</p><p>Apply is the preferred tool because it will only change what you change; it will not reset everything like kubectl replace will.</p><h4>Delete a Deployment Using a Manifest</h4><pre>kubectl delete -f &lt;manifest_file.yml&gt;</pre><p>This command reaches into the manifest file, reads each declared resource, whether it is a Deployment, Service, Configmap, Secret, and instructs the Kubernetes API to fully remove those resources from the cluster.</p><p>If your manifest file defines a Deployment, this command doesn&#39;t just scale it down, it tears out the entire object: pods, metadata, labels, replicaSets, and everything else.</p><p>This is irreversible through Kubernetes. Once deleted, that resource is gone unless you have a copy of the manifest or a backup. Deletion is immediate for Deployments, but finalizers or dependent PVCs may linger. Always check with kubectl get all -n &lt;namespace&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qn7sXxTI3_huhnZ49vBwBA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5896c50f8bc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm and Kubernetes Namespaces]]></title>
            <link>https://medium.com/@brianmayrose/helm-and-kubernetes-namespaces-b172a652f835?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b172a652f835</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Tue, 24 Jun 2025 16:33:26 GMT</pubDate>
            <atom:updated>2025-06-24T16:33:26.203Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometime Helm charts and Kubernetes namespaces are working off of different set of rules. They both use the term namespace, but they serve two different roles, confusing the two can cause a lot of confusion and wasted time.</p><p><strong>Two Worlds, One Term</strong></p><p>Kubernetes namespaces are like different compartments inside a cluster. They act like containers for Pods, Services, ConfigMaps, etc, giving a way to keep things organized. You can use one for dev, one for staging, and another for production, each with its own rules, limit, and isolation.</p><p>On the other hand, Helm uses namespaces as a place to store the record of a release, like a filing cabinet Helm writes into. The namespace tells Helm where to find your chart’s history, where to manage upgrades and rollbacks, and where to track resources it installed.</p><p>Even though Helm installs your application into a Kubernetes namespace, it tracks everything about that deployment based on the release namespace, which is something you specify at the time of installation, not in the values file. This is where confusion can often times happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5pBeb7Hk0HwjvnS024L2w.jpeg" /></figure><p><strong>How things can get mixed up</strong></p><p>For example, we are deploying a chart called dev . In your values.yml file we would set:</p><pre>namespace: dev-deployment</pre><p>We can expect this will place the Pods and Services into the dev-deployment namespace. But when you run:</p><pre>helm install dev -f values.yaml .</pre><p>The Helm output states that the deployment was installed into the default namespace, not dev-development namespace as expected.</p><p>This is because the value we put into the values.yml does not affect where Helm tracks the release. That value is the name of the Kubernetes namespace that was also created, just not displayed in the output. It can be verified by running:</p><pre>kubectl get namespaces</pre><p>For example, if your deployment.yml does not explicitly say metadata.namespace: {{ .Values.namespace }}, Kubernetes will just assume the resource belongs in whatever namespace Helm is currently working in, usually default.</p><p>The metadata.namespace: {{ .Values.namespace }} line can usually be found in the namespaces.yml template file and will be populated by the value in our values.yml file, for example, namespace: dev-deployment . Kubernetes will see that and know exactly what namespace to put our Pods. If your namespaces.yml does not explicitly decalre metadata.namespace: {{ .Values.namespace }}, Kubernetes will just assume the resource belongs in whatever namespace Helm is currently working in, usually default.</p><p>The Helm release namespace, where Helm keeps track of its own internal state, will not change where the app gets deployed unless the chart makes a point of aligning both. You could be installing into Helm’s default namespace while our Kubernetes workloads go into dev-deployment.</p><p>To make things simple, if the template yml file only has:</p><pre>metadata:<br>  name: my-app</pre><p>Then Kubernetes will drop that resource into whatever namespace the Helm CLI was operating in, often the default namespace.</p><p>But if we add to the template yml:</p><pre>metadata:<br>  name: my-app<br>  namespace: {{ .Values.namespace }}</pre><p>then the value we put in our custom yml, namespace: dev-deployment will be the kubernetes namespace that will be created.</p><p>Think of the Helm namespace as a clipboard where Helm writes down what it did, so it can make decisions later. The Kubernetes namespace is more like the warehouse where the work actually happens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*7JD-LSuWQB6Enu2NUeE9uA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b172a652f835" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a FastAPI Application with MongoDB: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@brianmayrose/building-a-fastapi-application-with-mongodb-a-step-by-step-guide-b62ecc7f053c?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b62ecc7f053c</guid>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[crud]]></category>
            <category><![CDATA[pydantic]]></category>
            <category><![CDATA[fullstack-development]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 00:31:19 GMT</pubDate>
            <atom:updated>2025-01-13T00:31:19.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAf-_XpylB02If2hse0rLQ.jpeg" /></figure><p>In this post, we will walk through creating a FastAPI based backend that connects to a MongoDB database. We will be transitioning from Flask to FastAPI. The focus will be on setting up CRUD endpoints for creating, reading, updating, and deleting items in the database. By the end, we will have a fully functional API ready for integration with any frontend.</p><p>Before we get into the building of our API, let&#39;s go through the transition from Flask to FastAPI. Flask is excellent for very simple straight forward uses, but FastAPI offers modern features like type hints, automatic documentation, and asynchronous programming.</p><p>You can catch up to where this walk through starts by following along these two articles:</p><ul><li><a href="https://medium.com/@brianmayrose/basic-flask-setup-with-podman-6024ba6769e5">Basic Flask Setup With Podman</a></li><li><a href="https://medium.com/@brianmayrose/adding-mongodb-to-flask-087966930eee">Adding MongoDB to Flask</a></li></ul><p>We are going to be running MongoDB inside a container using Podman. To stop, start, rebuild and rerun the mongo pod you can use the commands in one line:</p><pre>podman stop mongodb &amp;&amp; \<br>podman rm mongodb &amp;&amp; \<br>podman build -t mongodb:latest -f mongodb/Dockerfile . &amp;&amp; \<br>podman run --name mongodb \<br>    --network project-network \<br>    -p 27017:27017 \<br>    -v mongodb_data:/data/db \<br>    -d docker.io/mongo:6.0</pre><p>This will spin up a database server accessible at port 27017. You may need to tweak the names based on what you choose to use for your project.</p><p>We also need to update the Docker file for FastAPI like this:</p><pre># Base image<br>FROM python:3.10-slim<br><br># Set working directory<br>WORKDIR /app<br><br># Install dependencies<br>COPY requirements.txt .<br>RUN pip install --no-cache-dir -r requirements.txt<br><br># Copy application code<br>COPY . .<br><br># Expose port for FastAPI<br>EXPOSE 8000<br><br># Run the app with Uvicorn<br>CMD [&quot;uvicorn&quot;, &quot;main:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;8000&quot;, &quot;--reload&quot;]</pre><p>The conversion is very simple, since Flask And FastAPI are both written in Python. The first step is to convert the file structure to look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*9udxMHKysKyr1bPe6bebnQ.png" /><figcaption><a href="https://tree.nathanfriend.com/">https://tree.nathanfriend.com/</a></figcaption></figure><p>The next step is to replace Flask’s app initializer with this simple FastAPI configuration in main.py:</p><pre>from app import app</pre><p>To keep the project organized, we will update the config.py to be used as a helper file that will manage database configurations that can be used multiple times. Add this to config.py:</p><pre># MongoDB Configuration<br>MONGO_URI = &quot;mongodb://mongodb:27017/&quot;  # &#39;mongodb&#39; referes to the container name in the network<br>DATABASE_NAME = &quot;interactive_portfolio&quot;</pre><p>Then we can update the __init__.py file to bridge the database and backend together:</p><pre>from fastapi import FastAPI<br>from pymongo import MongoClient<br><br># Import configuration<br>from .config import MONGO_URI, DATABASE_NAME<br><br># Initialize FastAPI application<br>app = FastAPI()<br><br># MongoDB connection (shared across the app)<br>client = MongoClient(MONGO_URI)<br>db = client[DATABASE_NAME]<br><br># Register routes<br>from .routes import router<br>app.include_router(router)<br><br># Expose db globally for use in services or routes<br>__all__ = [&quot;app&quot;, &quot;db&quot;]</pre><p>We also need to update the requirements.txt:</p><pre>fastapi<br>uvicorn<br>pymongo<br>pydantic</pre><p>The next step is to define the data structure that will be in our database. We put the data models in models.py. To manage our resources, we are using Pydantic for data validation. Update models.py to this:</p><pre>from bson import ObjectId<br>from pydantic import BaseModel, Field, GetCoreSchemaHandler<br>from pydantic.json_schema import JsonSchemaValue<br>from typing import Optional<br><br># Helper class for MongoDB ObjectId<br>class PyObjectId(ObjectId):<br>    @classmethod<br>    def __get_validators__(cls):<br>        yield cls.validate<br><br>    @classmethod<br>    def validate(clssRef, value_to_validate):<br>        if not ObjectId.is_valid(value_to_validate):<br>            raise ValueError(&quot;Invalid ObjectId&quot;)<br>        return ObjectId(value_to_validate)<br><br>    @classmethod<br>    def __get_pydantic_json_schema__(cls, schema: JsonSchemaValue, handler: GetCoreSchemaHandler) -&gt; JsonSchemaValue:<br>        # Define the JSON schema representation for ObjectId<br>        schema = handler(schema)<br>        schema.update(type=&quot;string&quot;)<br>        return schema<br><br>    @classmethod<br>    def __get_pydantic_core_schema__(cls, source, handler: GetCoreSchemaHandler):<br>        # Use the core schema to validate ObjectId<br>        return handler(str)  # Treat ObjectId as a string for validation<br><br># Pydantic Model for Item<br>class Item(BaseModel):<br>    id: Optional[PyObjectId] = Field(alias=&quot;_id&quot;) # MongoDB&#39;s ObjectId<br>    name: str = Field(..., description=&quot;The name/type of Item&quot;)<br>    category: str = Field(..., description=&quot;The category of the Item&quot;)<br>    rating: int = Field(..., ge=0, le=10, description=&quot;Rating level, from 0 to 10&quot;)<br>    user_id: PyObjectId = Field(..., description=&quot;ID of the user this Item belongs to&quot;)<br><br>    class Config:<br>        allow_population_by_field_name = True<br>        arbitrary_types_allowed = True<br>        json_encoders = {ObjectId: str}</pre><p>With the model created, we can create the routes that will handle the CRUD of item. Update routes.py to this:</p><pre>from fastapi import APIRouter, HTTPException<br>from app import db<br>from app.models import Item, PyObjectId<br>from bson import ObjectId<br>from typing import Optional<br><br>router = APIRouter()<br><br>@router.get(&quot;/item&quot;, response_model=list[Item])<br>async def get_items(user_id: PyObjectId):<br>    &quot;&quot;&quot;Retrieve all items for a specific user.&quot;&quot;&quot;<br>    items = db[&quot;items&quot;].find({&quot;user_id&quot;: ObjectId(user_id)})<br>    return [Item(**item) for item in items]<br><br>@router.get(&quot;/items/{item_id}&quot;, response_model=Item)<br>async def get_item(item_id: PyObjectId):<br>    &quot;&quot;&quot;Retrieve a single item by its ID.&quot;&quot;&quot;<br>    item = db[&quot;items&quot;].find_one({&quot;_id&quot;: ObjectId(item_id)})<br>    if item:<br>        return Item(**item)<br>    raise HTTPException(status_code=404, detail=&quot;Item not found&quot;)<br><br>@router.post(&quot;/items&quot;, response_model=Item)<br>async def create_item(item: Item):<br>    &quot;&quot;&quot;Create a new item.&quot;&quot;&quot;<br>    try:<br>        # Convert the Item model to a dictionary for MongoDB<br>        item_dict = item.dict(by_alias=True)<br><br>        # Insert the item into the database<br>        result = db[&quot;item&quot;].insert_one(item_dict)<br><br>        # Fetch the newly inserted document<br>        inserted_item = db[&quot;items&quot;].find_one({&quot;_id&quot;: result.inserted_id})<br><br>        # Return the inserted document as a Pydantic model<br>        return Item(**inserted_item)<br>    except Exception as e:<br>        raise HTTPException(status_code=500, detail=f&quot;Failed to create item: {str(e)}&quot;)<br><br>@router.put(&quot;/items/{item_id}&quot;, response_model=Item)<br>async def update_item(item_id: PyObjectId, name: Optional[str] = None, category: Optional[str] = None, proficiency: Optional[int] = None):<br>    &quot;&quot;&quot;Update an existing item by ID.&quot;&quot;&quot;<br>    update_data = {}<br><br>    # Add only the fields that are provided<br>    if name is not None:<br>        update_data[&quot;name&quot;] = name<br>    if category is not None:<br>        update_data[&quot;category&quot;] - category<br>    if rating is not None:<br>        if not (0 &lt;= rating &lt;= 10):<br>            raise HTTPException(status_code=400, detail=&quot;rating must be between 0 and 10&quot;)<br>        update_data[&quot;rating&quot;] = rating<br><br>    if not update_data:<br>        raise HTTPException(status_code=400, detail=&quot;No update data provided&quot;)<br><br>    # Update the item in the database<br>    result = db[&quot;items&quot;].update_one({&quot;_id&quot;: ObjectId(item_id)}, {&quot;$set&quot;: update_data})<br><br>    if result.matched_count == 0:<br>        raise HTTPException(status_code=404, detail=&quot;Item not found&quot;)<br><br>    # Fetch the updated item<br>    updated_item = db[&quot;items&quot;].find_one({&quot;_id&quot;: ObjectId(item_id)})<br><br>    if updated_item:<br>        return Item(**updated_item)<br>    else:<br>        raise HTTPException(status_code=500, detail=&quot;Failed to fetch updated item&quot;)<br><br>@router.delete(&quot;/items/{item_id}&quot;, response_model=dict)<br>async def delete_item(item_id: PyObjectId):<br>    &quot;&quot;&quot;Delete a item by its ID.&quot;&quot;&quot;<br>    result = db[&quot;items&quot;].delete_one({&quot;_id&quot;: ObjectId(item_id)})<br><br>    if result.deleted_count == 0:<br>        raise HTTPException(status_code=404, detail=&quot;Item not found&quot;)<br><br>    return {&quot;message&quot;: &quot;Item successfully deleted&quot;}</pre><p>Similar to stopping, starting, rebuilding and rerunning the mongo pod, we can do the same for the API backend in one line:</p><pre>podman stop fastapi-backend &amp;&amp; \<br>podman rm fastapi-backend &amp;&amp; \<br>podman build -t fastapi-backend:latest backend/ &amp;&amp; \<br>podman run --name fastapi-backend \<br>--network project-network \<br>-p 8000:8000 \<br>fastapi-backend:latest</pre><p>We just walked through the process of setting up a sleek, high performance backend using FastAPI, connecting it to a MongoDB database, and implementing the full spectrum of CRUD functionality. As I have highlighted in previous posts, I will also continue exploring how to make open source tools work in your favor with thoughtful organization, scalability, and simplicity.</p><p>As demonstrated, FastAPI is not just a framework, it is a tool that allows developers to write cleaner, faster, and maintainable code. Getting familiar with features like Pydantic models for data validation, asynchronous programming for speed, and automatic API documentation, you can build project foundations that are not only very functional, but also developer friendly.</p><p>MongoDb is an amazing flexible database for dynamic and evolving data structures, great for new development. Leveraging commands like $set for updates and find_one for retrieval, and other commands, you can focus on providing solutions rather than wrestling with complicated schemas. The beauty of this setup is that it will be an enjoyable experience to scale it up to a full-fledged application.</p><p>So as you continue, remember to stay modular by separating your code into manageable pieces, keeping things organized as your application grows in size and complexity. Get familiar with tools like Pydantic to catch data issues before they get to the database. Keep things as lightweight as possible by taking advantage of containers by using Podman or Docker, and get the most out of documentation created with Swagger.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b62ecc7f053c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding MongoDB to Flask]]></title>
            <link>https://medium.com/@brianmayrose/adding-mongodb-to-flask-087966930eee?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/087966930eee</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[podman]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 02:33:44 GMT</pubDate>
            <atom:updated>2025-01-10T02:33:44.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaAy84RASAjInMc-ckf7Yg.jpeg" /></figure><p>For this project, I chose to use Podman over Docker. If you are not familiar with Podman, don’t worry, Podman still uses Dockerfiles and similar commands. I am working from a basic Flask set up, You can follow these instructions to get caught up:</p><p><a href="https://medium.com/@brianmayrose/basic-flask-setup-with-podman-6024ba6769e5">Basic Flask Setup With Podman</a></p><p>The first step is to add the directory that will contain all of our database files to our root folder.</p><pre>mkdir mongodb<br>cd mongodb</pre><p>Now create a Podman Volume for Persistent Storage:</p><pre>podman volume create mongodb_data</pre><p>Inside the mongodb directory, create a Dockerfile for MongoDB:</p><pre>FROM <a href="https://medium.com/docker.io/mongo:6.0">docker.io/</a>mongo:6.0<br><br># MongoDB default port<br>EXPOSE 27017<br><br># Set up a volume for persistent data storage<br>VOLUME [&quot;/data/db&quot;]<br><br>CMD [&quot;mongod&quot;]</pre><p>Create a Podman network to allow containers to communicate:</p><pre>podman network create interactive-network</pre><p>Now we can build the MongoDB container and then run it:</p><pre>podman build -t mongodb:latest -f mongodb/Dockerfile .<br><br>podman run --name mongodb \<br>    --network interactive-network \<br>    -p 27017:27017 \<br>    -v mongodb_data:/data/db \<br>    -d docker.io/mongo:6.0</pre><p>This will build and spin up MongoDB locally, exposing 27027.</p><p>Let’s install the MongoDB Driver for Flask. To do this, we will add pymongo to requirements.txt file in the root directory:</p><pre>flask<br>pymongo</pre><p>Then go ahead and rebuild the Flask container and check for any errors:</p><pre>podman build -t flask-backend:latest -f backend/Dockerfile .</pre><p>Now we can connect MongoDB to Flask. We will add the MongoDB connection to the backend/app.py file:</p><pre>from pymongo import MongoClient<br><br># connect to MongoDB<br>client = MongoClient(&quot;mongodb://mongodb:27017/&quot;)<br>db = client[&quot;interactive_portfolio&quot;]</pre><p>Podman will automatically resolve the mongodb hostname to the MongoDB container within the same network.</p><p>Since we are in the app.py file already, we can add 2 endpoints that will test our connection to MongoDB.</p><p>The first endpoint will be a POST that adds an item to the database:</p><pre>@app.route(&#39;/add-post&#39;, methods=[&#39;POST&#39;])<br>def add_skill():<br>    # Placeholder item to insert<br>    item = {&quot;name&quot;: &quot;Joe&quot;, &quot;level&quot;: &quot;Expert&quot;}<br>    db.skills.insert_one(item)<br>    return jsonify({&quot;mesage&quot;: &quot;Item added!&quot;})</pre><p>The second endpoint will be a GET that will query for the added item:</p><pre>@app.route(&#39;/items&#39;, methods=[&#39;GET&#39;])<br>def get_items():<br>    items = list(db.items.find({}, {&quot;_id&quot;: 0}))<br>    return jsonify(items)</pre><p>Here is an example of the complete app.py:</p><pre>from flask import Flask, jsonify<br>from pymongo import MongoClient<br><br>app = Flask(__name__)<br><br># connect to MongoDB<br>client = MongoClient(&quot;mongodb://mongodb:27017/&quot;)<br>db = client[&quot;Flask_API&quot;]<br><br>@app.route(&#39;/&#39;)<br>def home():<br>    return jsonify({&quot;message&quot;: &quot;Flask API Home&quot;})<br><br>@app.route(&#39;/add-item&#39;, methods=[&#39;POST&#39;])<br>def add_skill():<br>    # Placeholder item to insert<br>    item = {&quot;name&quot;: &quot;Joe&quot;, &quot;level&quot;: &quot;Expert&quot;}<br>    db.items.insert_one(item)<br>    return jsonify({&quot;mesage&quot;: &quot;Item added!&quot;})<br><br>@app.route(&#39;/items&#39;, methods=[&#39;GET&#39;])<br>def get_items():<br>    items = list(db.items.find({}, {&quot;_id&quot;: 0}))<br>    return jsonify(items)<br><br>if __name__ == &quot;__main__&quot;:<br>    app.run(host=&#39;0.0.0.0&#39;, port=5000)</pre><p>Rebuild and run the Flask container:</p><pre>podman build -t flask-backend:latest -f backend/Dockerfile .<br><br>podman run --name flask-backend \<br>    --network interactive-network \<br>    -p 5000:5000 \<br>    flask-backend:latest</pre><p>Now to verify everything is working. I used Postman to add and item and get the item</p><p>send a POST request to URL <a href="http://localhost:5000/add-skill">http://localhost:5000/add-</a>item and you should see the “Item added!” message returned. Now if you go through your browser or send a GET request to <a href="http://localhost:5000/add-skill">http://localhost:5000</a>/items.</p><p>Now we have set up and integrated MongoDB with a very simple Flask set-up. We created a MongoDB container, connected it to the flask application and implemented a very basic integration to verify the connection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=087966930eee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lean Canvas Basics]]></title>
            <link>https://medium.com/@brianmayrose/lean-canvas-basics-507ab12bef63?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/507ab12bef63</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[lean-canvas]]></category>
            <category><![CDATA[planning]]></category>
            <category><![CDATA[lean-startup]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 06:24:33 GMT</pubDate>
            <atom:updated>2025-01-08T06:24:33.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9O5xtrWw6rrsVcgGO_cLQ.jpeg" /></figure><p>The Lean Canvas is a simple, one page business model framework designed to help entrepreneurs clearly articulate and refine their ideas. It’s particularly well-suited for websites and startups.</p><p>The Lean Canvas can be broken up into 9 sections, let&#39;s take a look at each one.</p><h3>1. The<strong> Problem</strong></h3><p>possibly the most important part of a Lean Canvas, by gaining a clear understanding of the problem, will create a strong foundation to build from.</p><p>Before identifying problems, it is important to define the target audience in order to know who you are solving the problem for.</p><ul><li>Who are they?</li><li>What are their roles or situation?</li><li>What are the pain points your idea will solve?</li></ul><p>The goal then is to identify 3 main problems your target audience faces that your idea aims to solve. Keep in mind that not all problems are worth solving, they can be prioritized by identifying the frequency, severity, and any currently available solutions.</p><ul><li>How often do users encounter the problem?</li><li>How painful or disruptive is the problem?</li><li>Are there existing solutions, and are they effective?</li></ul><p>Use clear, concise statements to describe each problem with the intent to be specific and actionable. While researching the problem, keep in mind to spot related or secondary problems.</p><p>For example, a primary problem could be that a culinary expert is unable to find a great paying gig, while the secondary problem is that chefs are unable to showcase their abilities without a social media presence.</p><p>It is important to understand that the “<strong>Problem</strong>” section of a Lean Canvas is not static. As insights come in through the development process, it is important to update the problem definitions.</p><p>Here is an example:</p><h4>The audience:</h4><ul><li>primary group — chefs, bakers, catering staff, mixologists looking for opportunities.</li><li>secondary group — restaurants, event planners, celebration throwers.</li></ul><h4>The problems:</h4><ul><li>Culinary professionals struggle to find consistent, well-paying gigs tailored to their skills and availability.</li><li>Businesses and individuals are challenged with finding and vetting skilled culinary professionals quickly and reliably.</li><li>Both groups lack transparency in expectations, skills verification, and payment security.</li></ul><h4>Validation:</h4><ul><li><strong>Frequency</strong> — restaurants and catering companies often need temporary seasonal staff. While culinary professionals often mention the instability of temp work as the biggest challenge.</li><li><strong>Severity</strong> — Unfilled positions can lead to loss of revenue, poor service, hurting reputation of businesses, while culinary professionals can miss opportunities for experience and extra pay.</li><li><strong>Available solutions</strong> — local staffing agencies, word of mouth, social media.</li><li><strong>Solution limitations </strong>— platforms are not specialized for culinary needs. Communication between companies and professionals can be slow and unreliable.</li></ul><h4>Secondary Problems</h4><ul><li>limited resources to showcase talents.</li><li>lack of an easy way to manage ongoing freelance relationships or reschedule gigs.</li></ul><h3>2. Customer Segments</h3><p>Defining customer segments is critical for creating effective business ideas, features, design, and marketing strategies. Potential customers can be broken up into primary and secondary users.</p><p>Here are the questions you want to answer about primary users:</p><ol><li><strong>Who are they? — </strong>Demographics, Psychographics, Professional roles or statuses.</li><li><strong>What are their pain points?</strong> Associate these points to the problems identified in the first step.</li><li><strong>What are their motivations?</strong> Are they looking for convenience, affordability, quality, or something else?</li></ol><p>Define the secondary users:</p><ol><li><strong>Who are they?</strong> Collaborators, businesses, organizations, or service providers that engage with your business in different ways.</li><li><strong>How do they interact with your platform?</strong> Are they buyers, influencers, or indirect users?</li></ol><p>After identifying different users, you should have enough information to create ‘personas’ to represent a typical user within that segment.</p><p>For example:</p><p><strong>Mixologist persona</strong>:</p><ul><li>Name: Joe, 28, Bartender.</li><li>Goals: Secure 3 to 5 gigs a month.</li><li>Challenges: finding opportunities.</li><li>Behavior: Checks social media, word of mouth.</li></ul><p>Once all potential users have been identified, it is time to consider focussing on a niche audience. Focussing on a specific audience can make your solution more appealing to that specific group, which in turn can help your business grow steadily before expanding to a broader audience.</p><h3>3. Unique Value Proposition — UVP</h3><p>A unique value proposition is a clear, concise statement that describes what your solution will do, who it is for, and why is it better than alternatives? Think of it as a reason your target audience will choose your solution over other options.</p><p>To start, revisit the core problems identified back in step 1 and connect them directly to the solution you offer. A strong UVP will directly address the pain points.</p><p>Then list the top benefits your solution offers that solve the problems better than your competitors, focusing on the outcomes, not just features.</p><p>Your UVP must clearly differentiate you from existing solutions. Study the competition and identify gaps or areas your solution shines.</p><ul><li><strong>What do competitors offer?</strong></li><li><strong>What’s missing from their solutions?</strong></li><li><strong>What is your competitive edge?</strong></li></ul><p>When you write your UVP, think of it as a thesis statement, you want it to be direct, concise, and easily understood in one sentence. You can follow this example:</p><p>&lt;what solution you provide&gt; for &lt;target audience&gt; that &lt;solves a specific problem&gt; better than &lt;competitor or other alternative solution&gt;.</p><p>For example:</p><blockquote>Connecting culinary professionals to real-time job opportunities, faster and more effectively than ever before.</blockquote><p>Keep in mind, your UVP is not static and is expected to be adjusted. Test out different variations and get feedback. A great UVP does not just solve a problem, they also appeal to emotions. Think about the deeper desires or fears that your users might have, and subtly address them. Your UVP will be displayed front and center and will be highly visible on your website, in your marketing materials, and in email signatures.</p><h3>4. The Solution</h3><p>The solution section of a Lean Canvas directly builds on the problem and customer segments by giving details about how your idea addresses specific pain points of your target audience through features and functionalities.</p><p>For every problem identified in step 1, brainstorm corresponding solutions that your idea provides. The solutions should directly solve the pain points of your primary and secondary audiences. Think about the features your idea needs to implement these solutions effectively. Organize these features into categories. For example,</p><ul><li><strong>User Management</strong></li><li><strong>Communication Tools</strong></li><li><strong>Trust and Security</strong></li><li><strong>Payment Features</strong></li><li><strong>Analytics</strong></li></ul><p>Create a chart that maps problem to solution to feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RP4Jrfl1DTAf5mhv6XPClA.png" /></figure><p>Design your features with the users experience in mind, great solutions are not just functional, but are also intuitive and enjoyable to use. Focus on the most critical features that address your audience’s biggest concerns. Try out your core ideas with a minimum viable product (MVP) then, if successful, you can scale up and add more features. Highlight the uniqueness of your solution compared to competitors, and incorporate elements of your UVP into the solution descriptions.</p><h3><strong>5. Channels</strong></h3><p>Channels refer to how you will attract and retain users. This section of your lean canvas is about finding the most effective ways to reach your target audience and drive them to your solution.</p><p>Some questions to consider:</p><ul><li>What platforms do they use most?</li><li>Do they prefer visual content, text, or videos?</li><li>Are they actively searching for solutions, or do you need to create the demand?</li></ul><p>It is also a good idea to identify both organic and paid strategies to bring in new users, while also identifying ways you will keep users engaged so they return.</p><ul><li><strong>Organic channel</strong>s consist of things like content marketing, social media, community engagement, and referrals.</li><li><strong>Paid channels</strong> can be made up of social media ads, google or other search engine ads, sponsorships, and attending industry related events.</li><li><strong>Retention channels </strong>are about keeping users and are made up of things like email marketing, push notifications, and loyalty plans.</li></ul><p>Another idea to gain users is to seek out partnerships and collaborations with organizations or individuals that already have access to your target audience.</p><p>Not all channels will perform equally. You can gain insights by using analytic tools to keep track of performance in order to optimize your strategies over time.</p><h3>6. Revenue Streams</h3><p>The Revenue Streams section defines how your website will generate income. A solid revenue model ensures sustainability and scalability while aligning with your target audience’s willingness to pay.</p><p>Before choosing a revenue model, determine what your target audience values and is willing to pay for. Revenue models can vary widely depending on your business. Here are some examples:</p><ul><li>Subscription based model</li><li>Paid memberships</li><li>Pay per use</li><li>Commission based model</li><li>Advertising revenue</li><li>Partnerships</li></ul><p>You can also consider a hybrid model by combining multiple revenue streams, diversifying your income and attract different user segments. Like Channels, not all revenues will work equally well. It is important to leverage tools to give insights. Market research, User surveys, and pilot programs are all viable options that will help to find the best revenue strategy.</p><p>Ensure your revenue streams align with your user&#39;s behaviors and are optimized to increase perceived value. Track your revenue streams and adjust them based on how many users upgrade to paid tiers, total income over time, and how users perceive pricing and value.</p><h3>7. Cost Structure</h3><p>The Cost Structure section of a lean canvas identifies all the significant expenses needed to build, run, and scale your solution. This section should provide clarity on resource allocation, profitability, and long-term sustainability, while focussing on critical costs for launching a minimum viable product, removing unnecesary expenses and using profits to scale up the business.</p><p>Costs can be divided into two main categories, fixed costs and variable costs.</p><p><strong>fixed costs</strong></p><ul><li>hosting, email, and domain costs</li><li>licensing</li><li>Salaries</li><li>equipment</li></ul><p><strong>Variable costs</strong></p><ul><li>traffic and storage scaling costs</li><li>marketing costs</li><li>payment processing fees</li></ul><p>It is a good idea to break down costs by function</p><ul><li>Development and Maintenance</li><li>Infrastructure</li><li>Marketing and Acquisitions</li><li>Operations</li><li>Legal and Administrative</li><li>Miscellaneous</li></ul><p>Like with the <strong>Solutions</strong> section it is a good practice to organize your costs in a chart, here is an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6wedfwtJEqoUijvSf-CMA.png" /></figure><h3>8. Key Metrics</h3><p>Key metrics identify how you will measure the success of your business idea. Metrics focus on solving your target audience’s problems and demonstrating growth, engagement, and reaction. Focus on metrics that measure how your solution addresses the problems and contributes to growth. Avoid metrics that do not reflect meaningful progress.</p><p>Metrics can be divided into different categories using the Pirate Metrics Framework (AARRRG):</p><ul><li>Acquisition Metrics — how well your idea attracts new users</li><li>Activation Metrics — how users interact with your product</li><li>Retention Metrics — how well your solution keeps users coming back</li><li>Revenue Metrics — revenue generation and financial performance</li><li>Referral Metrics — Do users tell others about your solution</li><li>Goal-specific Metrics — metrics that directly relate to your solutions purpose</li></ul><p>Be sure to set clear benchmarks for each metric to evevaluate succes. Use analytics tools to track key metrics in real-time. Start by focusing on a few metrics that reflect the core goal of the MVP. As the solution scales you should add more detailed metrics for retention, revenue, and referrals.</p><p>Regularly review and update your metrics based on feedback, growth strategies, and new features. Identify weak areas and implement strategies to improve those metrics.</p><h3>9. Unfair advantage</h3><p>The unfair advantage section will help to identify your solutions uniqueness, something that sets it apart from competitors and cannot be easily replicated. This is a critical feature that will lead to long term success in your market.</p><p>An unfair advantage is something intrinsic to your business that competitors can’t easily copy or acquire. Examples can be proprietary technology, exclusive access to a resource, network, or partnerships, exceptional talent, expertise, and brand loyalty.</p><p>To be effective, your unfair advantage must address the core problems of your audience and compliment your UVP. The strongest unfair advantages often combine several elements, making them more difficult to replicate.</p><p>To ensure your unfair advantage is strong, test it, document it and expand upon it. Once you have your unfair advantage identified, integrate your unfair advantage into your messaging to enhance trust, reputation, and credibility. Through research and development, partnerships, and other avenues keep innovating to make your advantage stronger over time.</p><p>Choosing to use a Lean Canvas will provide a structured, one-page framework to quickly articulate and refine your business idea. It forces you to focus on the most critical aspects creating alignment with your target audience’s needs. A Lean Canvas creates a clear understanding of the business model’s viability while encouraging adaptability, making it easy to iterate as new insights are discovered. Ultimately, it’s a powerful tool for entrepreneurs to communicate their vision effectively, test assumptions, and build a focused strategy for success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=507ab12bef63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Flask Setup With Podman]]></title>
            <link>https://medium.com/@brianmayrose/basic-flask-setup-with-podman-6024ba6769e5?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6024ba6769e5</guid>
            <category><![CDATA[podman-vs-docker]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[podman]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 03:11:57 GMT</pubDate>
            <atom:updated>2025-01-07T03:11:57.594Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osbtVqVrrJHWMIFeRxDiTw.jpeg" /></figure><p>I had a need to setup a Python Flask application for a back-end service.</p><p>The start to any flask project is to set up your directory structure. I created a base directory to hold the project files. Inside the base directory we add the basic files needed:</p><pre>mkdir base-files<br>cd base-files<br><br>mkdir backend<br>cd backend<br><br>mkdir static<br>mkdir templates<br>touch Dockerfile<br>touch app.py<br>touch requirements.txt<br></pre><p>Just to get things initialized I added the bare minimum to app.py to get Flask up and running:</p><pre>from flask import Flask, jsonify<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def home():<br>    return jsonify({&quot;message&quot;: &quot;Flask API Home&quot;})<br><br>if __name__ == &quot;__main__&quot;:<br>    app.run(host=&#39;0.0.0.0&#39;, port=5000)</pre><p>I also added flask to the requirements.txt file:</p><pre>flask</pre><p>Then updated the Dockerfile:</p><pre># image<br>FROM python:3.10-slim<br><br># Set working directory<br>WORKDIR /app<br><br># Copy over project files<br>COPY backend/ /app<br><br># Install dependencies<br>RUN pip install --no-cache-dir -r requirements.txt<br><br># Expose the flask port<br>EXPOSE 5000<br><br># Run the application<br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>Now with this basic setup it was time to build the container:</p><pre>podman build -t flask-backend:latest -f backend/Dockerfile.</pre><p>Then run a test to check the pod runs with no errors:</p><pre>podman run --name flask-backend -p 5000:5000 flask-backend:latest</pre><p>You can navigate to <a href="http://localhost:5000/">http://localhost:5000/</a> to verify the app works. Sometime issues can arise, if you run into an error use podman ps -ato get your container name then run podman logs &lt;container-name-or-id&gt;. Also, If you need to get into the container to debug with out running flask you can use:</p><pre>podman run -it --name flask-debug --entrypoint /bin/bash flask-backend:latest</pre><p>A nice feature of Podman is that it uses Dockerfile making it compatible with alternative container workflows, while providing additional features and benefits over Docker. Unlike Docker, Podman is daemonless. Podman does not rely on a centralized service to manage your containers, reducing potential single points of failure. Because it is daemonless, Podman consumes fewer resources.</p><p>Podman also supports rootless container management, enabling containers to run without root privileges, preventing the potential threat of an privilege escalation attack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6024ba6769e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Podman on EndevourOS]]></title>
            <link>https://medium.com/@brianmayrose/installing-podman-on-endevouros-62c6afc7e425?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/62c6afc7e425</guid>
            <category><![CDATA[arch]]></category>
            <category><![CDATA[endeavor]]></category>
            <category><![CDATA[podman]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 17:52:45 GMT</pubDate>
            <atom:updated>2025-01-06T17:52:45.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KicCQMZrKRbw_7uuM8inug.jpeg" /></figure><p>I had a fresh install of EndevourOS and needed Podman installed. The installation of Podman is:</p><pre>sudo pacman -S podman<br><br>systemctl --user enable podman.socket<br>systemctl --user start podman.socket</pre><p>However, when running podman versionreturns an error:</p><pre>Error: configure storage: kernel does not support overlay fs: <br>&#39;overlay&#39; is not supported over extfs at <br>&quot;/home/user/.local/share/containers/storage/overlay&quot;: <br>backing file system is unsupported for this graph driver</pre><p>This happened because my current file system, ext4, does not support the overlay filesystem driver required by Podman. This is actually expected on setups where the storage directory, ~/.local/share/containers/storage, is on a filesystem that doesn’t support overlays.</p><p>This issue was resolved by using the vfs storage driver. I modified the Podman storage configuration to use the vfs driver.</p><p>I created the configuration file and directory:</p><pre>mkdir -p ~/.config/containers<br><br>nano ~/.config/containers/storage.conf</pre><p>Then added the configuration to the file:</p><pre>[storage]<br>driver = &quot;vfs&quot;</pre><p>After saving the configuration file I restarted Podman and verified the configuration:</p><pre>systemctl --user restart podman.socket<br><br>podman info | grep -i &quot;graphdriver&quot;</pre><p>Once verified, I tested Podman was working by running a basic container:</p><pre>podman run --rm -it alpine sh</pre><p>When attempting to run this basic container, I received an error:</p><pre>Trying to pull docker.io/library/alpine:latest...<br>Getting image source signatures<br>Copying blob 38a8310d387e done   |<br>Copying config 4048db5d36 done   |<br>Writing manifest to image destination<br>Error: pasta failed with exit code 1:<br>Failed to open() /dev/net/tun: No such device<br>Failed to set up tap device in namespace</pre><p>The message eludes the tun is missing from my system. I checked this by looking for its files:</p><pre>ls -l /dev/net/tun</pre><p>The files did in fact not exist. So the first step was to load the tun module:</p><pre>sudo modprobe tun</pre><p>Unexpectedly, this gave an error:</p><pre>modprobe: FATAL: Module tun not found in directory /lib/modules/6.12.4-arch1-1</pre><p>this error suggested that the tun kernel module was not built during my kernel installation. So to fix this I started out by checking the kernel version and installed the headers for my current kernel before rebooting:</p><pre>uname -r<br><br>sudo pacman -S linux-headers<br><br>reboot</pre><p>After the reboot I retried running the basic pod:</p><pre>podman run --rm -it alpine sh</pre><p>This time the pod spun up and the shell started with no problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62c6afc7e425" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Elasticsearch is a great choice.]]></title>
            <link>https://medium.com/@brianmayrose/why-elasticsearch-is-a-great-choice-146974e80cf6?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/146974e80cf6</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[logstash]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elastic]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Mon, 18 Nov 2024 05:06:00 GMT</pubDate>
            <atom:updated>2024-11-18T05:06:00.092Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQfDZVlyF-FEkgDaCcpSAw.jpeg" /></figure><p>Elastic is a great choice for many data search and analytics use cases because of its flexability, speed, and extensive features. A few of the key features that stand out are:</p><ul><li>Speed and performance</li><li>Scalability</li><li>Complex search query capabilities</li><li>versatility</li><li>Compatibility</li><li>Ecosystem for data ingestion, visualization, and monitoring</li><li>Observability and monitoring</li><li>Secure</li><li>Large community and accessible support</li></ul><p>When people ask, “What is Elasticsearch?”, they might get responses like “ a search engine”, “an analytics database”, or “a big data solution”. Elasticsearch might also be described as a fast, scalable, personal Google for your organization. The amazing thing about Elasticsearch is that all of theses descriptions are all accurate. This versatility of Elasticsearch and the Elastic Stack are the core of why Elasticsearch is so popular. Originally developed as a scalable search engine, Elasticsearch has evolved to become the leading enterprise search solution and one of the most widely used databases for analytics and search-driven applications. Let’s go over the key features to be aware of.</p><p><strong>Speed and performance</strong></p><p>Elasticsearch’s commitment to real-time search and analytics means it can rapidly index data, making it well-suited for near-instant search applications. Elastic has enhanced its multi-threaded search capabilities to process searches in parallel across segments, minimizing response times and allowing users to retrieve results faster than ever.</p><p>Elasticsearch’s distributed architecture scales horizontally by adding nodes to a cluster. This design allows it to handle high data volumes while maintaining speed. With the integration of memory-efficient enhancements and compression techniques that optimize resources without compromising search accuracy. These innovations ensure Elasticsearch remains a top choice for real-time data search applications that require both speed and scalability.</p><p>Reference:</p><p><em>Elastic reports 8x speed and 32X efficiency gains for Elasticsearch and Lucene Vector Database</em>. BigDATAwire. (n.d.). <a href="https://www.datanami.com/this-just-in/elastic-reports-8x-speed-and-32x-efficiency-gains-for-elasticsearch-and-lucene-vector-database/">https://www.datanami.com/this-just-in/elastic-reports-8x-speed-and-32x-efficiency-gains-for-elasticsearch-and-lucene-vector-database/</a></p><p><strong>Scalability</strong></p><p>Elasticsearch is designed to scale seamlessly as the data grows, by leveraging its distributed architecture to handle massive datasets efficiently. Indicies can be subdivided into smaller units called shards and those shards can be distributed across multiple nodes ensuring data is balanced and accessible.</p><p>Elasticsearch is built on top of Apache Lucene leveraging the Lucene index data structure. It stores and organizes data in a format optimized for efficient indexing and retrieval of data. Each Elasticsearch shard is essentially a self-contained Lucene index allowing the ability to distribute both data and query load across the cluster.</p><p>Shards come in two types, Primary and Replica shards. Primary shards hold the origional data and Replica shards are copies of the primary shards. Replica shards enhance data redundancy and increase the capacity for read operations like searches and document retrievals.</p><p>Elasticsearch’s automatic shard allocation and balancing mechanisms optimize the cluster for both high availability and scalability. If a node fails, the cluster seamlessly shifts workloads to other nodes, maintaining uninterrupted operations. This distributed design ensures that Elasticsearch remains responsive to queries, even as your workload grows or infrastructure changes.</p><p>Adding more nodes to an cluster scales Elasticsearch horizontally, distributing shards across new nodes to improve performance and resilience. This flexibility makes it ideal for dynamic environments where data and query demands can fluctuate over time.</p><p>Reference:</p><p><em>Get ready for production</em>. Elastic. (n.d.). <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/scalability.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/scalability.html</a></p><p><strong>Complex search query capabilities</strong></p><p>Elasticsearch stands out as a versatile tool for managing and analyzing data. Elasticsearch combines speed and flexibility when handling large datasets. Whether it’s searching through text, filtering numerical ranges, or exploring geospatial data, Elasticsearch equips you with a rich set of features to give valuable insights in the data you are working with.</p><p>At its core, Elasticsearch uses a JSON-based query language called the Query DSL that can construct detailed queries. With DSL you can search text fields, filter for exact matches, apply boolean logic, and even handle typos or approximate matches. DSL supports advanced techniques like proximity searches, range filtering, and geospatial queries, giving a great set of tools for working with structured and unstructured data alike.</p><p>Elasticsearch provides full-text queries for searching large text fields that can identify matches across multiple fields or target exact phrases. These queries focus on important terms by ignoring common, less relevant words. Term queries and range queries allow you to sift through specific values or narrow results based on numerical thresholds or date ranges for precise filtering.</p><p>There are tools for ranking and summarizing results. Sorting features allow you to order results by specific attributes, while boosting options let you emphasize the importance of certain fields. Aggregations provide another layer of functionality, enabling dynamic grouping or statistical calculations like averages, sums, and counts.</p><p>For a deeper dive into analytics, Elasticsearch supports custom calculations and data transformations. Script fields can generate computed values on the fly, adding a layer flexibility to your analyses. This is particularly useful for tasks like calculating profit margins or deriving percentages from existing data.</p><p>Reference:</p><p><em>Advanced querying techniques in Elasticsearch</em>. RSS. (n.d.). <a href="https://www.capellasolutions.com/blog/advanced-querying-techniques-in-elasticsearch">https://www.capellasolutions.com/blog/advanced-querying-techniques-in-elasticsearch</a></p><p><strong>Versitile</strong></p><p>Elasticsearch operates without requiring a rigid or predefined blueprint for your data, allowing you to bring in and work with many different types of data formats. This flexibility means you’re not constrained by strict rules about the type of data it must be before it can be used, this is especially handy for managing collections of information that vary widely in structure or content.</p><p>If a project demands more detailed control or specific instructions on how certain pieces of data should be handled, Elasticsearch also gives you the tools to create detailed instructions, often referred to as mapping definitions. These mappings enable you to set clear boundaries and preferences for individual data fields, such as how they should be stored, indexed, or searched. This adaptability ensures that Elasticsearch can meet the specific needs of an application while handling both structured and unstructured information seamlessly.</p><p><strong>Ecosystem and Compatibility</strong></p><p>The Elastic Stack is a powerful combination of tools comprised of Elasticsearch, Logstash, Kibana, and Beats. These tools work together to manage and analyze all types of data. Elasticsearch provides a fast and scalable search engine for querying large datasets, Logstash acts as a pipeline for collecting and transforming data, Kibana is an intuitive interface for creating visualizations and dashboards, and Beats serves as lightweight shippers to forward logs and metrics. Together, these components create a cohesive ecosystem for everything from log management to real-time analytics.</p><p>The Elastic Stack in used all over the world across many different industries because of it versatility. Companies rely on it for centralized log management, infrastructure monitoring, and security use cases like SIEM and DDoS mitigation. The ability to integrate with a broad array of tools including cloud services like AWS and Azure, database like PostgreSQL, and streaming platforms such as Kafka, making it invaluable for crafting advanced data pipelines and ensuring seamless data flow. From e-commerce analytics to operational observability, Elastic Stack can adapt to diverse changes.</p><p>The global popularity of the Elastic Stack is reflected in its adoption by organizations like Walmart, Github, and Adobe, who use it for search, monitoring, and security applications. While it can be installed locally or in the cloud, managed offerings simplify scaling and maintenance, making it easier for businesses to focus on insights instead of infrastructure management. Elastic Stack’s ability to turn raw data into meaningful intelligence has cemented its place as a leading solution in the data analytics space.</p><p>Reference:</p><p>Bennett, E. (2024, February 21). <em>Complete guide to elk [2024]</em>. Logit.io. <a href="https://logit.io/blog/post/elk-stack-guide/">https://logit.io/blog/post/elk-stack-guide/</a></p><p><strong>Observability and Security Features</strong></p><p>Elasticsearch is really way more than just a monitoring tool, it is an amazingly powerful tool to gain deeper insights and stronger operational control of all types of data. By combining observability features and cutting edge security measures, Elastic enables organizations to maintain both transparency and resilience. Whether managing the intricate layers of a distributed system or countering emerging threats, Elastic provides an adaptable and efficient framework that anticipates future demands while keeping operations running smoothly.</p><p>Security in Elasticsearch goes beyond basic measures, incorporating role-based access control, field-level restrictions, and encryption for data both at rest and in transit. These security features address critical vulnerabilities highlighted in Elastic’s Global Threat Report, such as misconfiguration and unauthorized access. Elastic enriches system logs with context, enabling organizations to detect behaviors like brute force login attempts or misuse of credentials with precision.</p><p>Elasticsearch combines advanced monitoring and visualization tools to offer seamless oversight of complex systems. With Kibana as its visualization companion, users can interpret metrics, logs, and system events through intuitive dashboards tailored to common operational needs. Elastic’s Search AI Platform processes massive amounts of telemetry data, enabling quick identification of trends and anomalies while ensuring all applications remain visible. Its open architecture and integration with OpenTelemetry provide unmatched flexibility, allowing teams to future-proof their observability strategy and eliminate blind spots without the financial strain of traditional retention models.</p><p>References:</p><p>Singh, G. (2024, August 14). <em>Elastic named a leader in the 2024 gartner magic quadrant for Observability Platforms</em>. Elastic Blog. <a href="https://www.elastic.co/blog/elastic-leader-gartner-magic-quadrant-observability-platforms-2024">https://www.elastic.co/blog/elastic-leader-gartner-magic-quadrant-observability-platforms-2024</a></p><p><em>2024 elastic global threat report</em>. Elastic. (n.d.). <a href="https://www.elastic.co/resources/security/report/global-threat-report">https://www.elastic.co/resources/security/report/global-threat-report</a></p><p><strong>Large community and accessible support</strong></p><p>Because there is welcoming and cooperative global community surrounding Elasticsearch it has become the go-to tool. The network of users, contributors, and enthusiasts has created a wealth of resources, such as extensive guides and tutorials, that make the platform approachable even for hose who are just getting started. Whether you are a seasoned developer refining your craft or an engineer stepping into the world of search and analytics for the first time, the combination of accessible learning materials and active community engagement creates an environment where troubleshooting and growth feel achievable.</p><p>Elastic’s managed service, Elastic Cloud, brings convenience by taking the hassle out of setting up and running Elasticsearch. This streamlines tasks that usually take large amounts of times and technical prowess. It’s ideal for organizations or individuals who prefer to focus on exploring and using search capabilities rather than worrying about server configurations or infrastructure upkeep. Whether it’s automating the deployment or simplifying ongoing maintenance, Elastic Cloud delivers a practical solution for those aiming to get the most out of Elasticsearch without diving into the nitty-gritty of backend management.</p><p>Reference:</p><p>Nkenchor, R. (2024, September 14). <em>Elastic’s return to open source: A new chapter for Elasticsearch and Kibana</em>. LinkedIn. <a href="https://www.linkedin.com/pulse/elastics-return-open-source-new-chapter-elasticsearch-regina-nkenchor-ttelf">https://www.linkedin.com/pulse/elastics-return-open-source-new-chapter-elasticsearch-regina-nkenchor-ttelf</a></p><p>Elasticsearch is a tool that is adaptable and can handle the management and exploration of vast collections of information. Elasticsearch allows for super quick retrieval of information. It scales smoothly along side the scaling of the data that keeps things running smooth and efficient. It offers flexibility in the way searches are conducted, backed by a powerful set of search tools that give insights into the data giving a resource to tune your searches.</p><p>Elasticsearch’s ability to work with many different types of data makes it available to handle many different tasks besides just searches. The Elastic Stack gives features that allow the gathering, handling, visualizing, and tracking of data. Improved safety measures and tools that help you watch over your systems come together to offer an all-in-one answer that handles data while keeping it safe and accessible.</p><p>Supported by a friendly and engaged group of users, along with easy-to-find guides and tutorials, and options like Elastic Cloud that take care of the setup for you, people can make good use of Elasticsearch no matter how much experience they have. Elasticsearch stands as a strong and flexible system that meets the demands of today’s data search an analysis, bringing together speed, the ability to grow, flexibility, and community backing.</p><p>Reference:</p><p>Mitchell, L., Quach, S., &amp; Ambalgekar, P. (2024, February 28). <em>Elasticsearch: What it is, how it works, and it’s usage</em>. Knowi. <a href="https://www.knowi.com/blog/what-is-elastic-search/">https://www.knowi.com/blog/what-is-elastic-search/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=146974e80cf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Helm is a greatTool for Managing Kubernetes Applications]]></title>
            <link>https://medium.com/@brianmayrose/why-helm-is-a-greattool-for-managing-kubernetes-applications-fe7aee84262a?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe7aee84262a</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 23:05:22 GMT</pubDate>
            <atom:updated>2024-11-07T23:05:22.137Z</atom:updated>
            <content:encoded><![CDATA[<p>As Kubernetes continues to expand its user base, adopting Helm for managing your Kubernetes applications is a smart choice. Here’s why:</p><ul><li>Simplifies deployment and management</li><li>Reusable Helm charts</li><li>Consistency across different environments</li><li>Simplified rollback options</li><li>Simplifies the complexity of dealing with multiple Kubernetes resource definitions</li><li>Customizable Configuration and templating</li><li>Large active community</li><li>Dependency management</li><li>Versioned releases</li><li>Reduced Boilerplate</li><li>Collaboration made easier between developers and operations</li></ul><p><strong>Deployment and Management</strong></p><p>Helm acts as an abstraction layer on top of Kubernetes that allows users to deploy and manage their applications simply. Helms package management capabilities simplify creating reusable, custom definitions that encapsulate the entire application stack. At the same time, Helm, makes deployments more consistent, less error-prone, and reproducible. Helm saves time while giving more control over Kubernetes applications.</p><p>Helm can be analogized to a package manager for Kubernetes. Kubernetes requires developers and operations teams to define numerous YAML manifests for deployments, services, and config maps. Helm allows you to bundle these manifests into charts. Charts are reusable, versioned packages containing all the necessary definitions for an application allowing easy managment of the entire lifecycle of your application.</p><p>Reference:</p><p>Wallen, J. (2022, April 14). <em>Get started with the helm Kubernetes Package manager</em>. The New Stack. <a href="https://thenewstack.io/get-started-with-the-helm-kubernetes-package-manager/">https://thenewstack.io/get-started-with-the-helm-kubernetes-package-manager/</a></p><p><strong>Reusable Helm Charts and Library Charts</strong></p><p>Helm charts make it easy to consolidate Kubernetes resource definitions into reusable and easily deployable packages. By utilizing Library charts, Helm users can take this reusability to another level, reducing redundancy, maintaining consistency across multiple deployments, streamlining the management and scaling of Kubernetes applications. Adopting this modular reusable approach can be valuable for large teams in charge of managing multiple microservices with the intent to maintain consistency and minimizing duplication in order to improve efficiency and reduce the risk of errors.</p><p>Helm charts consolidate all the YAML used by a Kubernetes applications. The ability to package all of the necessary resources into a single chart significantly reduces the complexity of deployment and management. For example, a team that deploys several microservices with Kubernetes would have a development file, a service, and configuration maps for each service each with similar elements like resource limits, environment variables and service types. Using Helm charts, these YAML resources can be captured in a reusable format so that the same application can be deployed across multiple environments by changing the values defined in the values file.</p><p>Library Charts improve upon the reusability and modularity capabilities of Helm. In place of standalone charts for each microservice or duplicating chart configurations, a Library Chart acts as a central set of templates and utilities that can be shared across multiple Helm charts. Lets say a team is implementing a new feature, such as opening an additional port, and this feature needs to be added to all microservices, without Library Charts the team would have to update each chart for each microservice costing more time and opening up the possibility of errors.</p><p>Reference:</p><p>Sharabi, R. (2024, March 21). <em>The Power of Library charts in Helm: A comprehensive guide</em>. Develeap. <a href="https://www.develeap.com/The-Power-of-Library-Charts-in-Helm-A-Comprehensive-Guide/">https://www.develeap.com/The-Power-of-Library-Charts-in-Helm-A-Comprehensive-Guide/</a></p><p><strong>Consistency</strong></p><p>Helm provides a powerful way to manage complex Kubernetes configurations and maintain consistency across multiple environments. Taking advantage of <em>values files, </em>template functions, and other features like the tpl function, Helm allows you to easily adapt a single chart to different environments. The features Helm offers, like Automatic rolling updates, Reusable secrets, and flexible templating, help to reduce errors, configuration drift, while streamlining deployment across multiple environments without compromising on modularity and flexibility.</p><p>read more:</p><p><em>Chart development tips and tricks</em>. Helm. (n.d.). <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/">https://helm.sh/docs/howto/charts_tips_and_tricks/</a></p><p><strong>Simplified rollback options</strong></p><p>Helm gives an easy and effective solution to roll back releases to a previous stable state, making Kubernetes deployments resilient and secure. Every update to a release creates a new revision tracked by Helm. Helm gives the ability to quickly revert changes to a known good state if something happens to go wrong. The helm history` command is useful to gain insight into every deployment event, and the helm rollback command can restore an application to a previous version with a single command. Helm rollbacks reduces downtime and ensures stability, making it invaluable when dealing with complex deployments that fail or introduce bugs.</p><p>Helm also offers more advanced rollback options that provide flexibility to manage different deployment scenarios. The rollback feature is helpful in production environments, where failed upgrades can lead to inconsistencies or downtime. By allowing teams to easily revert to a stable state, Helm’s rollback mechanisms reduces risks, reduces disruptions, and helps maintain a reliable Kubernetes environments.</p><p>Reference:</p><p>Gerganov, W. by: H. (2024, July 6). <em>Helm release upgrades and rollbacks</em>. Baeldung on Ops. <a href="https://www.baeldung.com/ops/helm-release-upgrade-rollback">https://www.baeldung.com/ops/helm-release-upgrade-rollback</a></p><p><strong>Reducing Complexity</strong></p><p>Helm simplifies the management of Kubernetes applications by bundling multiple resource definitions such as Deployments, Services, Configmaps, and PersistantVolumeClaims into a single Helm chart, allowing the entire application to be deployed or upgraded with a single command. This type of abstraction is valuable as many modern applications are microservice based and require numerous interconnected components that can be complex and have their own error considerations. By combining all the components in a single chart, Helm can create consistent deployments reducing risks and allowing for easy rollbacks if any issues arise.</p><p>Reference:</p><p>Helm. (n.d.-b). <a href="https://helm.sh/">https://helm.sh/</a></p><p><strong>Customization</strong></p><p>Helms use of templates and values files for parameterization brings significant benefits to Kubernetes deployments. Helm allows the same base chart to be easily reused across multiple environments by simply updating different values.yaml files. This makes it simple to adapt configurations like replica count, image version, and service types for each environment. All the configurable parts of the deployment are found in a values.yaml file. Only having to update one centralized file reduces the risk of human error. Helm also offers the --set command to enable one-off customizations dynamically at deployment time further adding to the customization ability of Helm. Helm customization makes deployments flexible, reduces manual overhead, and simplifies the management of Kubernetes resources.</p><p>Reference:</p><p>Jaiswal, Aman. (2024, June 19). <em>Helm charts tutorial: A simple guide for beginners</em>. DevopsCube. <a href="https://devopscube.com/create-helm-chart/">https://devopscube.com/create-helm-chart/</a></p><p><strong>Large active community</strong></p><p>Helm’s community is full of collaborators and experts ready to help navigate Kubernetes. With an expansive library of free to use charts for common services like MySQL, Reddis, and Prometheus, Helm simplifies your development process, saving time on setup allowing more focus on innovation and development.</p><p>New charts are constantly being released and improved apon based on user feedback. Education and refining skills are core community components with access to numorous resources like workshops, tutorials, and community driven events. This collaborative spirit extends to partnerships, where multiple contributers share their expertise to enhance the Helm ecosystem.</p><p>In-person events, conferences like KubeCon, and local meetups help build a community where users and contributors can come together and share ideas. Helm’s ecosystem thrives on collaboration, making Kubernetes deployments more accessible and to get users up and developing quickly.</p><p><strong>Managing Application Dependencies</strong></p><p>Helm’s ability to manage dependencies between different components fo an application makes deploying and upgrading much more efficient and consistent. Taking advantage of defining dependencies directly in the Chart.yaml manifest of the main Helm chart, gives the ability to install related components automatically. For example, you can declare database or service connections in the dependencies section. Helm will then deploy these dependencies together, managing the installation so that it spins up preventing common errors from misconfigurations.</p><p>You can also use sub-charts` for managing dependencies. These charts can be referenced from a remote repository or stored locally. The developer has the option to decide whether they want to pull dependencies from an external source or include them directly in the project.</p><p>Helm provides commands to ensure that all dependencies are up to date and correctly configured before deployment, but is also limited in its ability to explicitly define the deployment order. If you are working with complex infrastructures where order is crucial, you may consider using something like Terraform for better control over how and when services are deployed.</p><p>Reference:</p><p>Anais Urlichs. (2022, November 21). <em>A deep dive into helm dependencies</em>. <a href="https://anaisurl.com/a-deep-dive-into-helm-sub-charts/">https://anaisurl.com/a-deep-dive-into-helm-sub-charts/</a></p><p><strong>Versioning and Releases</strong></p><p>Helm provides versioning control over releases of your deployments, which makes managing your application’s history and control over changes as simple as possible. With every update, Helm creates a new versioned release allowing for easy tracking of changes while maintaining a clear history of what modifications have been made.</p><p>Helm’s versioning capabilities give the ability to deploy specific chart versions to ensure compatibility with your Kubernetes environment. Sometimes the latest version of your application might not always work with the Kubernetes version or configuration you have in place, so by specifying chart versions during installation you gain the ability to tailor your deployments to match the needs of your environment.</p><p>Reference:</p><p>Gerganov, W. by: H. (2024a, July 6). <em>Helm chart searching and versioning</em>. Baeldung on Ops. <a href="https://www.baeldung.com/ops/helm-chart-search-versions">https://www.baeldung.com/ops/helm-chart-search-versions</a></p><p><strong>Reduced Boilerplate</strong></p><p>Managing Kubernetes YAML manifests without the help from Helm can involve a lot of boilerplate that is open to potential errors and can become difficult to maintain, especially for large applications with multiple components. Helm addresses this concern by allowing chart developers to use template functions, named templates, and default variables to minimize repetition, making deployments more managable.</p><p>Named templates in Helm act as reusable functions that developers can define once and then apply across different parts of the Helm chart. This will prevent duplication of common configurations such as metadata labels, container specifications, health checks, and other repetitive elements that appear in multiple Kubernetes resources.</p><p>For example, imagine you have a Helm chart for deploying an application and you need to create multiple deployment resources for different microservices. Without the use of templates, you would have multiples of the same YAML files repeated, with slight modifications to each one for each component. This can lead to hard to find errors and lack of consistency when a change is required across all the deployments. Named templates solve this issue by allowing you to define these repetitive parts once and reuse them throughout your Helm chart.</p><p>Reference:</p><p>Austin Dewey. (2021, May 16). <em>How to reduce Helm chart boilerplate with named templates</em>. <a href="https://austindewey.com/2020/08/09/how-to-reduce-helm-chart-boilerplate-with-named-templates/">https://austindewey.com/2020/08/09/how-to-reduce-helm-chart-boilerplate-with-named-templates/</a></p><p><strong>Collaboration</strong></p><p>The integration of Helm charts with GitOps practices promotes a strong foundation for collaboration between developers and operations teams. By using version-controlled Helm charts, teams can review and iterate on application deployments together, resulting in better communication, alignment, and efficiency. Automation, transparency, and easy rollback capabilities further contribute to a seamless and reliable deployment process, ultimately supporting the core principles of DevOps and driving a culture of collaboration and shared responsibility.</p><p>Helm is a valuable tool for managing Kubernetes applications by providing a huge set of features that simplify deployment, reduce complexity, and ensure consistency. Helm can be integrated with GitOps practices fostering collaboration between developers and oeration teams, enabling shared ownership, automated processes, and efficient versioning and rollbacks. Helm’s reusability, customization, and active community support make it a powerful solution for organizations seeking to streamline their Kubernetes operations. With Helm, teams can deliver applications faster, more reliably, and with greater confidence in the stability of their deployments.</p><p>Reference for additional tools to use with Helm:</p><p><em>Five helm tools for improving Kubernetes Quality of life: Robusta</em>. RSS. (n.d.). <a href="https://home.robusta.dev/blog/top-five-helm-addon-tools-for-kubernetes">https://home.robusta.dev/blog/top-five-helm-addon-tools-for-kubernetes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe7aee84262a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django — Step 14]]></title>
            <link>https://medium.com/@brianmayrose/django-step-14-de6785527721?source=rss-14c00d2e6b4c------2</link>
            <guid isPermaLink="false">https://medium.com/p/de6785527721</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Brian Mayrose]]></dc:creator>
            <pubDate>Sat, 10 Aug 2019 07:37:21 GMT</pubDate>
            <atom:updated>2019-08-10T07:39:15.340Z</atom:updated>
            <content:encoded><![CDATA[<h3>Django — Step 14</h3><h4>Styling A Django Form</h4><p>This is a continuation of step 13:</p><p><a href="https://medium.com/@brianmayrose/django-step-13-2622593f79bf">Django — Step 13</a></p><p>Currently, We are using Django Forms in its simplest implementation in formForGallery1.html:</p><p>{{ form }}</p><p>This renders the form, but without any particular styling. Alternatively we can call each individual element of our form in order to add custom styling.</p><p>The first step is to start your development server and navigate to the form, <a href="http://127.0.0.1:8000/display_1/g1_post">http://127.0.0.1:8000/display_1/g1_post</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8HdNJExZgr-pF6xjQDDCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XrhCzO6zOGH2BijvlVCHA.png" /></figure><p>right-click the form in the browser and view page source and you will see the forms HTML code that is rendered by Django Forms. We will use this to identify each element:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUBy7gk3nJ2qG_NvxA2j_Q.png" /></figure><p>Now open up the formForGallery1.html file and comment out the {{ form }} line. And add:</p><pre>{{ form.non_field_errors }}</pre><p>This is where errors in the uploading will be displayed.</p><p>Next, we will start with the title. In the page source the title element is:</p><pre>&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;id_title&quot;&gt;Title:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; maxlength=&quot;200&quot; required id=&quot;id_title&quot;&gt;&lt;/td&gt;&lt;/tr&gt;</pre><p>Django Forms uses a div with the class of <strong>fieldwrapper</strong> when declaring the specific elements of a form. Inside the div is the form error-tag for the element, a label and an input:</p><pre>&lt;div class=&quot;fieldWrapper&quot;&gt;<br>    {{ form.form_element.errors }}<br>   &lt;label for=&#39;&#39;&gt;&lt;/label&gt;<br>   &lt;input type=&#39;&#39; name=&#39;&#39; id=&#39;&#39;&gt;<br>&lt;/div&gt;</pre><p>Using the <strong>title</strong> info from the page source, we can create the <strong>title</strong> element for the form:</p><pre>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin-left:10px;&quot;&gt;<br>    {{ form.title.errors }}<br>      &lt;label for=&quot;id_title&quot;&gt;Title:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;text&quot; name=&quot;title&quot; maxlength=&quot;200&quot; required id=&quot;id_title&quot;&gt;<br>&lt;/div&gt;</pre><p>In the <strong>templates/components</strong> folder create a <strong>customForm.html</strong> file. We can put our custom fields in this file:</p><pre>{{ form.non_field_errors }}<br>        <br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin-left:10px;&quot;&gt;<br>    {{ form.title.errors }}<br>      &lt;label for=&quot;id_title&quot;&gt;Title:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;text&quot; name=&quot;title&quot; maxlength=&quot;200&quot; required id=&quot;id_title&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot;  style=&quot;margin:10px;&quot;&gt;<br>    {{ form.description_1.errors }}<br>      &lt;label for=&quot;id_description_1&quot;&gt;Description 1:&lt;/label&gt;&lt;br&gt;<br>      &lt;textarea name=&quot;description_1&quot; cols=&quot;40&quot; rows=&quot;5&quot; required id=&quot;id_description_1&quot;&gt;&lt;/textarea&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.description_2.errors }}<br>      &lt;label for=&quot;id_description_2&quot;&gt;Description 2:&lt;/label&gt;&lt;br&gt;<br>      &lt;textarea name=&quot;description_2&quot; cols=&quot;40&quot; rows=&quot;5&quot; id=&quot;id_description_2&quot;&gt;&lt;/textarea&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.description_3.errors }}<br>      &lt;label for=&quot;id_description_3&quot;&gt;Description 3:&lt;/label&gt;&lt;br&gt;<br>      &lt;textarea name=&quot;description_3&quot; cols=&quot;40&quot; rows=&quot;5&quot; id=&quot;id_description_3&quot;&gt;&lt;/textarea&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.reference_link.errors }}<br>      &lt;label for=&quot;id_reference_link&quot;&gt;Reference link:&lt;/label&gt;&lt;br&gt;<br>      &lt;textarea type=&quot;url&quot; name=&quot;reference_link&quot; cols=&quot;50&quot; rows=&quot;1&quot; id=&quot;id_reference_link&quot;&gt;&lt;/textarea&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_main.errors }}<br>      &lt;label for=&quot;id_photo_main&quot;&gt;Photo main:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_main&quot; required id=&quot;id_photo_main&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_1.errors }}<br>      &lt;label for=&quot;id_photo_1&quot;&gt;Photo 1:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_1&quot; id=&quot;id_photo_1&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_2.errors }}<br>      &lt;label for=&quot;id_photo_2&quot;&gt;Photo 2:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_2&quot; id=&quot;id_photo_2&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_3.errors }}<br>      &lt;label for=&quot;id_photo_3&quot;&gt;Photo 3:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_3&quot; id=&quot;id_photo_3&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_4.errors }}<br>      &lt;label for=&quot;id_photo_4&quot;&gt;Photo 4:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_4&quot; id=&quot;id_photo_4&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_5.errors }}<br>      &lt;label for=&quot;id_photo_5&quot;&gt;Photo 5:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_5&quot; id=&quot;id_photo_5&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.photo_6.errors }}<br>      &lt;label for=&quot;id_photo_6&quot;&gt;Photo 6:&lt;/label&gt;&lt;br&gt;<br>      &lt;input type=&quot;file&quot; name=&quot;photo_6&quot; id=&quot;id_photo_6&quot; style=&quot;margin:10px;&quot; class=&quot;btn btn-success&quot;&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.is_published.errors }}<br>      &lt;label for=&quot;id_is_published&quot;&gt;Check the box to publish:&lt;/label&gt;<br>      &lt;input class=&quot;checkbox1 btn btn-primary&quot; type=&quot;checkbox&quot; name=&quot;is_published&quot; id=&quot;id_is_published&quot; style=&quot;margin:10px;&quot; &gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;fieldWrapper&quot; style=&quot;margin:10px;&quot;&gt;<br>    {{ form.is_published.errors }}<br>      &lt;label for=&quot;id_list_date&quot;&gt;List date:&lt;/label&gt;<br>      {{ form.list_date }}<br>&lt;/div&gt;</pre><p>Save the customForm.html file and add the <strong>include</strong> in formForGallery1.html file:</p><pre>{% extends &#39;base.html&#39; %}<br>{% block content %}<br>&lt;section&gt;<br>  &lt;h1 class=&quot;display-4 mb-4 text-center&quot;&gt;<br>    Gallery 1 post form<br>  &lt;/h1&gt;<br>    &lt;form action=&quot;&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;<br>        {% csrf_token %}<br>        &lt;!-- {{ form }} --&gt;<br>        {% include &#39;components/customForm.html&#39; %}</pre><pre>&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; class=&quot;btn btn-primary&quot; style=&quot;margin-left:250px;&quot;&gt;<br>    &lt;/form&gt;<br>&lt;/section&gt;<br>{% endblock %}</pre><p>I removed the div that initially encompassed the form, and added some style to the submit button.</p><p>In the customForm.html file, I just used inline styling to customize the form. However, with the way things are now set up, the styling can be moved to a css stylesheet and classes can be applied to each element.</p><p>In the next step to this tutorial, we will cover creating a user login and registration option for our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*7nTsfnyDliO221c5-fvznQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de6785527721" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>