<?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 George Tsopouridis on Medium]]></title>
        <description><![CDATA[Stories by George Tsopouridis on Medium]]></description>
        <link>https://medium.com/@gtsopour?source=rss-d6f0ee346420------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gUpr2L-BBp10j5bM.png</url>
            <title>Stories by George Tsopouridis on Medium</title>
            <link>https://medium.com/@gtsopour?source=rss-d6f0ee346420------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:34:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gtsopour/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[mTLS Authentication with AWS ALB and ECS Fargate]]></title>
            <link>https://gtsopour.medium.com/mtls-authentication-with-aws-alb-and-ecs-fargate-aa5fa875f81d?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa5fa875f81d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[alb]]></category>
            <category><![CDATA[tlm]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Thu, 13 Apr 2023 06:24:05 GMT</pubDate>
            <atom:updated>2023-04-13T06:24:41.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHZaN9jqVciT9UpBN4yhEg.png" /></figure><p>mTLS is a feature of TLS for mutual authentication that enables the server to authenticate the client’s identity. mTLS authentication is a standard security practice that uses client TLS certificates to provide an additional layer of protection, verifying the client information cryptographically.</p><p>Here is a post <a href="https://www.copebit.ch/en/mtls-authentication-with-aws-alb-and-ecs-fargate/">https://www.copebit.ch/en/mtls-authentication-with-aws-alb-and-ecs-fargate</a> I have prepared on how to setup mTLS authentication with AWS ALB and ECS Fargate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa5fa875f81d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use a private AWS Elastic Container Registry (ECR) with an external Kubernetes Cluster or…]]></title>
            <link>https://gtsopour.medium.com/aws-elastic-container-registry-ecr-is-a-fully-managed-container-registry-7624781635d9?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/7624781635d9</guid>
            <category><![CDATA[ecr]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[cronjob]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Mon, 29 Nov 2021 09:32:25 GMT</pubDate>
            <atom:updated>2021-11-29T09:43:12.546Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use a private AWS Elastic Container Registry (ECR) with an external Kubernetes Cluster or any on-prem infrastructure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xD0sMyZKoVur4a3tKImGw.png" /><figcaption>AWS Elastic Container Registry (ECR)</figcaption></figure><p>AWS Elastic Container Registry (ECR) is a fully managed container registry. AWS ECR natively integrates with AWS EKS, AWS ECS, AWS Lambda, and the Docker CLI, allowing you to simplify your development and production workflows. But sometimes you might need to use a private AWS ECR registry with an external Kubernetes Cluster or any on-prem infrastructure (or even within a distributed hybrid cloud infrastructure).</p><p>This was one of the technical requirements I experienced recently. The idea was to use AWS CodeBuild (using webhooks with the source repositories in GitHub) as a fully managed continuous integration service that compiles source code, runs tests, produces images and push the images to a private AWS ECR registry. But then, the produced images had to be pulled from an on-prem Kubernetes Cluster. Below I am including some technical challenges/details from this integration.</p><h3>AWS ECR</h3><p>AWS ECR is a fully managed container registry offering high-performance hosting, so you can reliably deploy application images and artifacts anywhere. As a fully managed registry, it eliminates the need to operate and scale the infrastructure required to power your container registry. Additionally, AWS ECR transfers your container images over HTTPS and automatically encrypts your images at rest.</p><p>I just wanted to clarify here that usually we are associating the AWS ECR with the application container images but AWS ECR supports also Open Container Initiative (OCI) artifacts, such as Helm charts. Open Container Initiative (OCI) artifacts are not a new specification, format, or API. They are a set of somewhat-contradictory conventions on how to store things other than images inside an OCI registry. You can find more details here <a href="https://aws.amazon.com/blogs/containers/oci-artifact-support-in-amazon-ecr/">https://aws.amazon.com/blogs/containers/oci-artifact-support-in-amazon-ecr/</a> about the OCI artifacts. But just keep in mind that you could also create an AWS ECR repository and use it as a Helm registry pushing there your Helm charts for proper version control.</p><h3>Authenticate to a private AWS ECR registry</h3><p>You can use a private AWS ECR registry to manage private image repositories consisting of Docker images and Open Container Initiative (OCI) artifacts. You can authenticate to a private AWS ECR registry with an authorization token by using AWS CLI. An authorization token represents your IAM authentication credentials and it can be used to access any AWS ECR registry that your IAM principal has access to. Please find below an example of an ECR policy with all the permissions that it can be attached to an IAM user. The resource property should be replaced with your repository in case you apply this.</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;VisualEditor0&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;ecr:GetRegistryPolicy&quot;,<br>        &quot;ecr:DescribeRegistry&quot;,<br>        &quot;ecr:GetAuthorizationToken&quot;,<br>        &quot;ecr:DeleteRegistryPolicy&quot;,<br>        &quot;ecr:PutRegistryPolicy&quot;,<br>        &quot;ecr:PutReplicationConfiguration&quot;<br>      ],<br>      &quot;Resource&quot;: &quot;*&quot;<br>    },<br>    {<br>      &quot;Sid&quot;: &quot;VisualEditor1&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: &quot;ecr:*&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:ecr:eu-central-1:782135427521:repository/my-app&quot;<br>    }<br>  ]<br>}</pre><p>The authorization token is valid for 12 hours. To obtain an authorization token, you can use the GetAuthorizationToken API. The AWS CLI get-login-password command simplifies this by retrieving and decoding the authorization token which you can then pipe into a docker login command to authenticate.</p><p>To authenticate Docker to a private Amazon ECR registry with get-login-password, you should run the aws ecr get-login-password <a href="https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html">https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html</a> command. When passing the authorization token to the docker login command, use the value AWS for the username and specify the Amazon ECR registry uri you want to authenticate to.</p><pre>aws ecr get-login-password --region &lt;region&gt; | docker login --username AWS --password-stdin &lt;aws_account_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com</pre><p>After a successful login, you can start using the Docker CLI and pull images from any environment.</p><pre>docker pull [OPTIONS] NAME[:TAG|@DIGEST]</pre><h3>Using a private AWS ECR registry in Kubernetes</h3><p>Regarding the container images, we typically create a container image of our application and all its software dependencies and push it to a registry before referring to it in a Kubernetes Pod. When using a private registry in Kubernetes, the credentials can be provided in several ways:</p><p>1. Configuring the nodes to authenticate to a private registry<br>- All pods can read any configured private registries<br>- Requires node configuration by cluster administrator</p><p>2. Pre-pulled images<br>- All pods can use any images cached on a node<br>- Requires root access to all nodes to setup</p><p>3. Specifying ImagePullSecrets on a pod<br>- Only pods which provide own keys can access the private registry</p><p>4. Vendor-specific or local extensions<br>- If you’re using a custom node configuration, you (or your cloud provider) can implement your mechanism for authenticating the node to the container registry.</p><p>At this article, I will focus only on the third option. This is the option I used in this specific integration and this is a very common pattern especially in case the Kubernetes Cluster nodes are fully managed and they can be replaced at any time or you have not root access to the nodes or you are missing a node configuration management tool for re-applying the same settings/configurations to the nodes. Actually, this is even the Kubernetes recommended approach to run containers based on images in private registries.</p><p>Regarding the third option and the imagePullSecrets specification, Kubernetes supports specifying container image registry keys on a Pod. As I have the docker credentials like username: AWS and password: &lt;authorization token from get-login-password&gt;, I can create a new docker-registry (Dockercfg) secret in my namespace. docker-registry (Dockercfg) secrets are used to authenticate against Docker registries. Please note that Pods can only reference image pull secrets in their own namespace, so this process has to be done one time per namespace. This secret can be created by running the following command after substituting the corresponding values.</p><pre>kubectl create secret docker-registry &lt;name&gt; --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL -n &lt;namespace&gt;</pre><p>Below you can find a more specific example with the above command after assigning the authorization token to the TOKEN variable and using an AWS ECR registry in the docker-server flag.</p><pre>TOKEN=`aws ecr get-login-password --region eu-central-1 | cut -d&#39; &#39; -f6<br>kubectl create namespace my-namespace<br>kubectl create secret docker-registry regcred --docker-server=782135427521.dkr.ecr.eu-central-1.amazonaws.com/my-app --docker-username=AWS --docker-password=$TOKEN -n my-namespace`</pre><p>After creating the above secret with the name regcred , there are different ways to use/refer to it.</p><p>One way is to specify it in a Pod definition.</p><pre>apiVersion: v<br>kind: Pod<br>metadata:<br>  name: my-app<br>  namespace: my-namespace<br>spec:<br>  containers:<br>    - name: my-app<br>      image: &lt;private-aws-ecr-registry&gt;/my-app:v1<br>  imagePullSecrets:<br>    - name: regcred</pre><p>Another way is to add it to the default ServiceAccount in the Pod’s namespace with the kubectl patch command. In this way, you can avoid the imagePullSecrets spec in each Pod’s manifest.</p><pre>kubectl patch serviceaccount default -p &quot;{\&quot;imagePullSecrets\&quot;: [{\&quot;name\&quot;: \&quot;regcred\&quot;}]}&quot; -n my-namespace</pre><h3>Kubernetes CronJob / AWS authorization token expiration</h3><p>By creating manually the docker-registry secret in a namespace and referring it to a Pod afterwards or patching the default ServiceAccount (as I described in the previous section), it will work but only for the first 12 hours. As I highlighted before, the authorization token is valid only for 12 hours. This means that somehow and before its expiration, the secret should be updated with a new one. Here is where a Kubernetes CronJob resource should be created and configured accordingly.</p><p>CronJobs are meant for performing regular scheduled actions. Each of those actions should be configured to recur indefinitely. The frequency of the Kubernetes CronJob is written in the familiar cron format. For example ‘0 */6 * * *’ in the cron format means at every 6 hours. You can read more here <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax</a> about the cron schedule syntax.</p><p>Below, you can find a CronJob example in order to update the docker-registry secret in your applied namespace every 6 hours. Please you should replace every value inside the angle brackets &lt;VALUE&gt; with your values before applying it.</p><p>As you will notice, Kubernetes CronJob schedules also a container as a Pod. This is why I have prepared a minimal Docker image (gtsopour/awscli-kubectl:latest) based on Alpine Linux with AWS CLI v2 and kubectl. Here is the Github repository <a href="https://github.com/gtsopour/awscli-kubectl">https://github.com/gtsopour/awscli-kubectl</a> with the Dockerfile and it is also public available in my Docker Hub account <a href="https://hub.docker.com/r/gtsopour/awscli-kubectl">https://hub.docker.com/r/gtsopour/awscli-kubectl</a> ( docker pull gtsopour/awscli-kubectl).</p><p>As part of the CronJob execution part, I retrieve the authorization token with AWS CLI, create the docker-registry secret and patch the default ServiceAccount in the applied namespace. Now you are wondering probably how the AWS credentials are getting populated. I would like to mention here that the AWS CLI could be also configured via environment variables (AWS CLI is already installed in the image). Environment variables provide another way to specify configuration options and credentials, and can be useful for scripting or temporarily setting a named profile as the default. AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID are among the supported AWS CLI environment variables. You can find here <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html">https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html</a> all the supported environment variables.</p><p>Finally, you will notice that I am creating a new ServiceAccount including the Role and RoleBinding with permissions to get, create, patch and delete secrets and serviceaccounts. I am doing this because the existing permissions of the default ServiceAccount don’t allow it to list or modify any resources. The new ServiceAccount is assigned through the property serviceAccountName: sa-ecr-token-helper.</p><pre>cat &lt;&lt;EOF | kubectl apply -f <br>kind: Role<br>apiVersion: rbac.authorization.k8s.io/v1<br>metadata:<br>  namespace: &lt;namespace&gt;<br>  name: ecr-token-helper<br>rules:<br>  - apiGroups: [&quot;&quot;]<br>    resources:<br>      - secrets<br>      - serviceaccounts<br>      - serviceaccounts/token<br>    verbs:<br>      - &#39;delete&#39;<br>      - &#39;create&#39;<br>      - &#39;patch&#39;<br>      - &#39;get&#39;<br>---<br>kind: RoleBinding<br>apiVersion: rbac.authorization.k8s.io/v1<br>metadata:<br>  name: ecr-token-helper<br>  namespace: &lt;namespace&gt;<br>subjects:<br>  - kind: ServiceAccount<br>    name: sa-ecr-token-helper<br>    namespace: &lt;namespace&gt;<br>roleRef:<br>  kind: Role<br>  name: ecr-token-helper<br>  apiGroup: &quot;&quot;<br>---<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: sa-ecr-token-helper<br>  namespace: &lt;namespace&gt;<br>---<br>apiVersion: batch/v1<br>kind: CronJob<br>metadata:<br>  name: ecr-token-helper<br>  namespace: &lt;namespace&gt;<br>spec:<br>  schedule: &#39;0 */6 * * *&#39;<br>  successfulJobsHistoryLimit: 0<br>  jobTemplate:<br>    spec:<br>      template:<br>        spec:<br>          serviceAccountName: sa-ecr-token-helper<br>          containers:<br>            - command:<br>                - /bin/sh<br>                - -c<br>                - |-<br>                  TOKEN=`aws ecr get-login-password --region ${REGION} | cut -d&#39; &#39; -f6`<br>                  kubectl delete secret -n &lt;namespace&gt; --ignore-not-found $SECRET_NAME<br>                  kubectl create secret -n &lt;namespace&gt; docker-registry $SECRET_NAME \<br>                  --docker-server=$ECR_REPOSITORY \<br>                  --docker-username=AWS \<br>                  --docker-password=$TOKEN \<br>                  --namespace=&lt;namespace&gt;<br>                  kubectl patch serviceaccount default -p &#39;{&quot;imagePullSecrets&quot;:[{&quot;name&quot;:&quot;&#39;$SECRET_NAME&#39;&quot;}]}&#39; -n &lt;namespace&gt;<br>              env:<br>                - name: AWS_SECRET_ACCESS_KEY<br>                  value: &lt;AWS_SECRET_ACCESS_KEY&gt;<br>                - name: AWS_ACCESS_KEY_ID<br>                  value: &lt;AWS_ACCESS_KEY_ID&gt;<br>                - name: ACCOUNT<br>                  value: &lt;ACCOUNT&gt;<br>                - name: SECRET_NAME<br>                  value: &#39;regcred&#39;<br>                - name: REGION<br>                  value: &lt;REGION&gt;<br>                - name: ECR_REPOSITORY<br>                  value: &lt;ECR_REPOSITORY&gt;<br>              image: gtsopour/awscli-kubectl:latest<br>              imagePullPolicy: IfNotPresent<br>              name: ecr-token-helper<br>          restartPolicy: Never<br>EOF</pre><p>This article is an effort to explain in detail several principles around the private AWS ECR registry, the IAM Permissions/Policies, the AWS authorization token and its expiration, the Kubernetes docker-registry Secrets and the Kubernetes CronJob resources. As always, your feedback is always welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7624781635d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes logging architecture with AWS EKS and Elastic Cloud — Elasticsearch, Fluent Bit and…]]></title>
            <link>https://gtsopour.medium.com/kubernetes-logging-architecture-with-aws-eks-and-elastic-cloud-elasticsearch-fluent-bit-and-e4e9d71b49a5?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4e9d71b49a5</guid>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 10:42:56 GMT</pubDate>
            <atom:updated>2021-08-03T10:45:08.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes logging architecture with AWS EKS and Elastic Cloud — Elasticsearch, Fluent Bit and Kibana (EFK)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laK4tNtVOTntZKcSK5ITXg.png" /></figure><h3>Logging Architecture</h3><p>Application logs can help you understand what is happening inside your application. The logs are particularly useful for debugging problems and monitoring cluster activity. Most modern applications have some kind of logging mechanism. Likewise, container engines are designed to support logging. The easiest and most adopted logging method for containerised applications is writing to standard output and standard error streams.</p><p>However, the native functionality provided by a container engine or runtime is usually not enough for a complete logging solution. For example, you may want access your application’s logs if a container crashes; a pod gets evicted; or a node dies. In a Kubernetes cluster, logs should have a separate storage and lifecycle independent of nodes, pods, or containers. This concept is called cluster-level logging.</p><p>Cluster-level logging architectures require a separate backend to store, analyse, and query logs. Kubernetes does not provide a native storage solution for log data. Instead, there are many logging solutions that integrate with Kubernetes. One popular centralised logging solution is the Elasticsearch, Fluent Bit and Kibana (EFK).</p><h3>Cluster-level logging architectures</h3><p>While Kubernetes does not provide a native solution for cluster-level logging, there are several common approaches you could consider. Here are some options:</p><ul><li>Use a node-level logging agent that runs on every node</li><li>*Include a dedicated sidecar container for logging in an application pod</li><li>Push logs directly to a backend from within an application</li></ul><h3>Using a node-level logging agent</h3><p>You can implement cluster-level logging by including a node-level logging agent on each Kubernetes cluster node. The logging agent is a dedicated tool that exposes logs or pushes logs to a backend. Commonly, the logging agent is a container that has access to a directory with log files from all of the application containers on that node. In a Kubernetes cluster, the directory should be the /var/log/containers/.</p><p>Because the logging agent must run on every cluster node, it is recommended to run the agent as a DaemonSet. Node-level logging creates only one agent per node and doesn’t require any changes to the applications running on the node. Containers write stdout and stderr, but with no agreed format. A node-level agent collects these logs and forwards them for aggregation.</p><p><em>* Based on my experience, sidecar pattern for logging should be applied for smaller-scale setups or in setups without the root access to the cluster nodes to read the logs. I would personally choose Fluent Bit as a DaemonSet because it’s more straightforward to configure, it has a small footprint and it requires less resources.</em></p><h3>Elasticsearch, Fluent Bit and Kibana (EFK)</h3><p>Elasticsearch is a real-time, distributed, and scalable search engine which allows for full-text and structured search, as well as analytics. It is commonly used to index and search through large volumes of logs.</p><p>Elasticsearch is commonly deployed alongside Kibana, a data visualisation frontend and dashboard for Elasticsearch. Kibana allows you to explore your Elasticsearch logs through a web interface, and build dashboards and queries to quickly answer questions and gain insight into your Kubernetes applications.</p><p>In this article, I will provide all the technical details/specifications for integrating and sending application logs from the AWS Elastic Kubernetes Service (EKS) to the Elastic Cloud <a href="https://www.elastic.co/cloud/">https://www.elastic.co/cloud/</a> managed service (Elasticsearch, Kibana, APM &amp; Fleet) using a node-level logging agent based on Fluent Bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*OdVRCP5k9Dl2R6Jk" /></figure><p>Fluent Bit is an open source Log Processor and Forwarder which allows you to collect any data like metrics and logs from different sources, enrich them with filters and send them to multiple destinations. It’s the preferred choice for containerised environments like Kubernetes as it enriches the logs with Kubernetes metadata. Fluent Bit is designed with performance in mind: high throughput with low CPU and Memory usage. Fluent Bit is a CNCF (Cloud Native Computing Foundation) subproject under the umbrella of Fluentd.</p><h3>Set up — Deploy Elastic Cloud managed service</h3><p>Using Elasticsearch Service is a great way to take advantage of all the power that Elastic offers. You can start with a free trial account and you can find here <a href="https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html">https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html</a> all the details for the first steps. The 14-day free trial includes a deployment to explore Elastic solutions for Enterprise Search, Observability, Security, or the latest version of the Elastic Stack.</p><p>A deployment should be created first and you can find here <a href="https://www.elastic.co/guide/en/cloud/current/ec-create-deployment.html#ec-create-deployment">https://www.elastic.co/guide/en/cloud/current/ec-create-deployment.html#ec-create-deployment</a> all the details for the deployment configuration. A deployment helps you manage an Elasticsearch cluster and other Elastic products, like Kibana or APM instances, in one place.</p><p>You can pick a cloud platform where Elastic hosts your deployment among Amazon Web Services (AWS), Google Cloud Platform (GCP) and Microsoft Azure. Which platform you pick is a personal preference. Elasticsearch Service handles all hosting details for you, no additional cloud accounts required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*08RCcOpwuk26iCdg" /></figure><p>You can either customise a new deployment or customise an existing one. On the Create a deployment page, click Edit settings to change the cloud provider, region, hardware profile, and stack version; or click Advanced settings for more complex configuration settings.</p><p>You can enable at the beginning the Elasticsearch and Kibana services/nodes at their minimum sizing as you can see below. You could even select an Elasticsearch deployment within a single availability zone but you will be at risk of data loss with fault tolerance set to a single zone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GeVSiWhHccgd8KQd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wHpzakA5GQPChXn3" /></figure><p>After creating the deployment you will receive the username/password credentials for this deployment. Please download and save them in your end. This is what you should expect after a successful deployment creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gkQlF5wDdgFoRrnf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TL9GMLroW3OWJAVm" /></figure><p>Please note the Elasticsearch endpoint (includes the port), the Cloud ID and the Username/Password credentials as you would need them in the Fluent Bit configuration.</p><p>e.g Elasticsearch endpoint: <a href="https://my-cluster-deployment.es.eu-central-1.aws.cloud.es.io/">https://my-cluster-deployment.es.eu-central-1.aws.cloud.es.io</a></p><p>e.g Elasticsearch port: 9243</p><p>e.g Cloud ID: my-cluster-deployment:ZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5lcy5pbyQ1NDkyNTJlOWZkNDY0YTNlOTQxMTc2YmIxMTMyZDE5MCQzNzQyNjNjZjIzNDQ0NGM2YWQ0MjI0NTcyMWNkOWYwOA==</p><h3>Set up — Deploy Fluent Bit</h3><p>At this section, you will find all the steps in order to set up Fluent Bit to collect logs from your containers. Using docker, the containers save their log files in the host’s directory /var/log/containers/ with a .log file extension. The log is formatted in JSON because Kubernetes nodes are configured with docker json logging driver. The container log file will have the format {“log”:”&lt;CONTAINER_LOG&gt;”,”stream”:”stdout”,”time”:”&lt;TIMESTAMP&gt;”}.</p><p>The following yaml resources are mostly based on the Kubernetes Logging with Fluent Bit Github official repository <a href="https://github.com/fluent/fluent-bit-kubernetes-logging">https://github.com/fluent/fluent-bit-kubernetes-logging</a> but you will find also here <a href="https://github.com/gtsopour/fluent-bit-kubernetes-logging">https://github.com/gtsopour/fluent-bit-kubernetes-logging</a> all the adaptations I have done on top of the default resources.</p><p>Please note that for the execution of all the following commands, the kubectl command line too should have been already configured and connected to your Kubernetes cluster.</p><h3>Create Kubernetes namespace</h3><p>Please create a new namespace with the name logging for the Fluent Bit deployment.</p><pre>#Create a Kubernetes namespace<br>kubectl create namespace logging</pre><h3>Create RBAC resources for Fluent Bit</h3><p>Fluent Bit must be deployed as a DaemonSet so that it will be available on every node of the Kubernetes cluster. To get started run the following commands to create the service account and role setup.</p><pre>#Create ServiceAccount<br>kubectl create -f <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-service-account.yaml">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-service-account.yaml</a></pre><pre>#Create ClusterRole<br>kubectl create -f <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role.yaml">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role.yaml</a></pre><pre>#Create ClusterRoleBinding<br>kubectl create -f <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role-binding.yaml">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/fluent-bit-role-binding.yaml</a></pre><h3>Create Fluent Bit ConfigMap</h3><p>The next step is to create a ConfigMap that will be used by the Fluent Bit DaemonSet.</p><pre>#Create ConfigMap<br>kubectl create -f <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-configmap.yaml">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-configmap.yaml</a></pre><p>Regarding the Fluent Bit ConfigMap and as I am using the Elastic Cloud managed service, I had to adapt the es output configuration as below. The es output plugin, allows to ingest your records into an Elasticsearch database. Please you can find here <a href="https://docs.fluentbit.io/manual/pipeline/outputs/elasticsearch">https://docs.fluentbit.io/manual/pipeline/outputs/elasticsearch</a> all the instructions about the es plugin configuration parameters. As I am using Cloud Elastic’s Elasticsearch Service, Cloud_ID is the id of the cluster running and Cloud_Auth specifies the credentials to use to connect to Elastic’s Elasticsearch Service.</p><p>From</p><pre>output-elasticsearch.conf: |<br> [OUTPUT]<br>     Name            es<br>     Match           *<br>     Host            ${FLUENT_ELASTICSEARCH_HOST}<br>     Port            ${FLUENT_ELASTICSEARCH_PORT}<br>     Logstash_Format On<br>     Replace_Dots    On<br>     Retry_Limit     False</pre><p>To</p><pre>output-elasticsearch.conf: |<br> [OUTPUT]<br>     Name            es<br>     Match           *<br>     Host            ${CLOUD_ELASTICSEARCH_HOST}<br>     Port            ${CLOUD_ELASTICSEARCH_PORT}<br>     Cloud_ID        ${CLOUD_ELASTICSEARCH_ID}<br>     Cloud_Auth      ${CLOUD_ELASTICSEARCH_USER}:${CLOUD_ELASTICSEARCH_PASSWORD}<br>     Logstash_Format On<br>     Logstash_Prefix my-cluster<br>     Replace_Dots    On<br>     Retry_Limit     False<br>     tls             On<br>     tls.verify      Off</pre><p>You can also find here the adapted fluent-bit-configmap.yaml <a href="https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/fluent-bit-configmap.yaml">https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/fluent-bit-configmap.yaml</a> and you can apply that using the following command.</p><pre>#Create ConfigMap<br>kubectl create -f <a href="https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/fluent-bit-configmap.yaml">https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/fluent-bit-configmap.yaml</a></pre><h3>Create Fluent Bit DaemonSet</h3><p>The next step is to create the Fluent Bit DaemonSet ready to be used with the Elasticsearch on a normal Kubernetes Cluster.</p><pre>#Create DaemonSet<br>kubectl create -f <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-ds.yaml">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-ds.yaml</a></pre><p>Regarding the Fluent Bit DaemonSet, as I had adapted the ConfigMap before, I had to adapt the env variables section in the DaemonSet and drive their values properly from two new ConfigMap and Secret resources. Please make sure that you apply the values collected from the Elastic Cloud deployment to the resource placeholders. The ConfigMap and the Secret resources are pre-requisites for the DaemonSet.</p><p>&lt;CLOUD_ELASTICSEARCH_ID&gt; = <a href="https://my-cluster-deployment.es.eu-central-1.aws.cloud.es.io/">https://my-cluster-deployment.es.eu-central-1.aws.cloud.es.io</a><br>&lt;CLOUD_ELASTICSEARCH_HOST&gt; = my-cluster-deployment:ZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5lcy5pbyQ1NDkyNTJlOWZkNDY0YTNlOTQxMTc2YmIxMTMyZDE5MCQzNzQyNjNjZjIzNDQ0NGM2YWQ0MjI0NTcyMWNkOWYwOA==<br>&lt;CLOUD_ELASTICSEARCH_DEPLOYMENT_USER&gt; = …&lt;CLOUD_ELASTICSEARCH_DEPLOYMENT_PASSWORD&gt; = …</p><pre>#Elasticsearch ConfigMap<br>kind: ConfigMap<br>apiVersion: v1<br>metadata:<br> name: elasticsearch-configmap<br> namespace: logging<br>data:<br> CLOUD_ELASTICSEARCH_ID: &lt;CLOUD_ELASTICSEARCH_ID&gt;<br> CLOUD_ELASTICSEARCH_HOST: &lt;CLOUD_ELASTICSEARCH_HOST&gt;<br> CLOUD_ELASTICSEARCH_PORT: &#39;9243&#39;</pre><pre>#Elasticsearch Secret<br>kind: Secret<br>apiVersion: v1<br>metadata:<br> name: elasticsearch-secret<br> namespace: logging<br>data:<br> CLOUD_ELASTICSEARCH_PASSWORD: &lt;CLOUD_ELASTICSEARCH_DEPLOYMENT_PASSWORD&gt;<br> CLOUD_ELASTICSEARCH_USER: &lt;CLOUD_ELASTICSEARCH_DEPLOYMENT_USER&gt;<br>type: Opaque</pre><p>#DaemonSet (partial change)</p><p>From</p><pre>env:<br> - name: FLUENT_ELASTICSEARCH_HOST<br>   value: &quot;elasticsearch&quot;<br> - name: FLUENT_ELASTICSEARCH_PORT<br>   value: &quot;9200&quot;</pre><p>To</p><pre>env:<br> - name: CLOUD_ELASTICSEARCH_HOST<br>   valueFrom:<br>     configMapKeyRef:<br>       name: elasticsearch-configmap<br>       key: CLOUD_ELASTICSEARCH_HOST<br> - name: CLOUD_ELASTICSEARCH_PORT<br>   valueFrom:<br>     configMapKeyRef:<br>       name: elasticsearch-configmap<br>       key: CLOUD_ELASTICSEARCH_PORT<br> - name: CLOUD_ELASTICSEARCH_ID<br>   valueFrom:<br>     configMapKeyRef:<br>       name: elasticsearch-configmap<br>       key: CLOUD_ELASTICSEARCH_ID<br> - name: CLOUD_ELASTICSEARCH_USER<br>   valueFrom:<br>     secretKeyRef:<br>       name: elasticsearch-secret<br>       key: CLOUD_ELASTICSEARCH_USER<br> - name: CLOUD_ELASTICSEARCH_PASSWORD<br>   valueFrom:<br>     secretKeyRef:<br>       name: elasticsearch-secret<br>       key: CLOUD_ELASTICSEARCH_PASSWORD</pre><p>You can also create all the above resources referring them directly from this <a href="https://github.com/gtsopour/fluent-bit-kubernetes-logging">https://github.com/gtsopour/fluent-bit-kubernetes-logging</a> Github repository.</p><pre>#Create Elasticsearch ConfigMap<br>kubectl create -f <a href="https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/elasticsearch-configmap.yaml">https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/elasticsearch-configmap.yaml</a></pre><pre>#Create Elasticsearch Secret<br>kubectl create -f <a href="https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/elasticsearch-secret.yaml">https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/elasticsearch-secret.yaml</a></pre><pre>#Create DaemonSet<br>kubectl create -f <a href="https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/fluent-bit-ds.yaml">https://raw.githubusercontent.com/gtsopour/fluent-bit-kubernetes-logging/master/fluent-bit-ds.yaml</a></pre><p>If you create successfully the DaemonSet, you should get something like this below having a Fluent Bit pod for each of your Kubernetes nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bGkxHmZNDuC518Id" /></figure><h3>Kibana Index Management/Pattern</h3><p>Kibana requires an index pattern to access the Elasticsearch data that you want to explore. An index pattern selects the data to use and allows you to define properties of the fields.</p><p>An index pattern can point to a specific index, for example, your log data from yesterday, or all indices that contain your data. Please find here <a href="https://www.elastic.co/guide/en/kibana/current/index-patterns.html">https://www.elastic.co/guide/en/kibana/current/index-patterns.html</a> all the details about the Kibana index patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P231ORGWfegfx8-z" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4e9d71b49a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EKS maximum number of Pods per EC2 Node instance]]></title>
            <link>https://gtsopour.medium.com/aws-eks-maximum-number-of-pods-per-ec2-node-instance-bfbe658cecad?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfbe658cecad</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[vpc]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Mon, 24 May 2021 21:37:26 GMT</pubDate>
            <atom:updated>2021-08-17T08:10:17.106Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34NrXxLL9CiSCQvtw94QnQ.png" /></figure><p>AWS EKS supports native VPC networking with the Amazon VPC Container Network Interface (CNI) plugin for Kubernetes. Using this plugin allows Kubernetes Pods to have the same IP address inside the pod as they do on the VPC network. The plugin is an open-source project that is maintained on GitHub. For more information, see <a href="https://github.com/aws/amazon-vpc-cni-k8s">amazon-vpc-cni-k8s</a> and <a href="https://github.com/aws/amazon-vpc-cni-k8s/blob/master/docs/cni-proposal.md">Proposal: CNI plugin for Kubernetes networking over AWS VPC</a> on GitHub. The Amazon VPC CNI plugin is fully supported for use on Amazon EKS and self-managed Kubernetes clusters on AWS.</p><p>The Amazon VPC CNI plugin for Kubernetes is deployed with each of your EC2 Nodes in a Daemonset with the name <strong>aws-node</strong>.</p><p>This is a great feature but it introduces a limitation in the number of Pods per EC2 Node instance. Whenever you deploy a Pod in the EKS worker Node, EKS creates a new IP address from VPC subnet and attach to the instance. You can find here <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI</a> the maximum number of network interfaces and maximum number of IPs per interface.</p><p>The formula for defining the maximum number of Pods per EC2 Node instance is as follows:</p><pre>N * (M-1) + 2</pre><p>Where:</p><ul><li><strong>N</strong> is the number of Elastic Network Interfaces (ENI) of the instance type</li><li><strong>M</strong> is the number of IP addresses per ENI</li></ul><p>As an example, for a <strong>t3.small</strong> instance, this calculation is 3 * (4–1) + 2 = <strong>11 Pods</strong>.</p><p>Here <a href="https://github.com/awslabs/amazon-eks-ami/blob/master/files/eni-max-pods.txt">https://github.com/awslabs/amazon-eks-ami/blob/master/files/eni-max-pods.txt</a> you can find also the calculated number of Pods.</p><p>By executing the following command, you can identify the total number of running Pods across all Kubernetes namespaces.</p><pre>kubectl get pods — all-namespaces | grep -i running | wc -l</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfbe658cecad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Ingress — AWS EKS Cluster with AWS Load Balancer Controller]]></title>
            <link>https://gtsopour.medium.com/kubernetes-ingress-aws-eks-cluster-with-aws-load-balancer-controller-cf49126f8221?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf49126f8221</guid>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Sun, 11 Apr 2021 22:08:57 GMT</pubDate>
            <atom:updated>2021-04-12T22:50:40.741Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Ingress — AWS EKS Cluster with AWS Load Balancer Controller</h3><p>Kubernetes Ingress is an API object that manages external access to the Services in a Kubernetes Cluster. Ingress exposes HTTP and HTTPS routes from outside the Cluster to Services within the Cluster. Traffic routing is controlled by rules defined on the Ingress resource.</p><p>Here is a simple example where an Ingress sends all its traffic to one Service:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MAUWGPtKFFpyttwjCOC9UQ.png" /></figure><p>An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name-based virtual hosting. An Ingress controller is responsible for fulfilling the Ingress, usually with a Load Balancer, though it may also configure your edge router or additional frontends to help handle the traffic.</p><h3>Options for exposing applications deployed in Kubernetes</h3><p>Kubernetes Service is an abstract way to expose an application running on a set of Pods as a network service. For some parts of the application (for example Frontends, public API interfaces) you may need to expose a Service onto an external IP address, that’s outside of the Kubernetes Cluster.</p><p>Kubernetes <strong>ServiceTypes</strong> allow you to specify what kind of Service you want. The default is <strong>ClusterIP</strong>.</p><p>Type values and their behaviours are:</p><ul><li><strong>ClusterIP</strong>: Exposes the Service on a cluster-internal IP. Choosing this value makes the Service only reachable from within the Cluster. This is the default ServiceType.</li><li><strong>NodePort</strong>: Exposes the Service on each Node’s IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created. You’ll be able to contact the NodePort Service, from outside the Cluster, by requesting &lt;NodeIP&gt;:&lt;NodePort&gt;.</li><li><strong>LoadBalancer</strong>: Exposes the Service externally using a Cloud provider’s Load Balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.</li><li><strong>ExternalName</strong>: Maps the Service to the contents of the externalName field (e.g. foo.bar.example.com), by returning a CNAME record with its value. No proxying of any kind is set up.</li></ul><p>ClusterIP, NodePort, LoadBalancer and ExternalName are all ways to get external traffic into the Cluster. <strong>Ingress</strong> is also used to expose a Service but it is not a Service type itself. It acts as the entry point for the Cluster. It lets you consolidate the routing rules into a single resource as it can expose multiple Services under the same IP address.</p><p><strong>ClusterIP</strong> is the preferred option for internal Service access and uses an internal IP address to access the Service. Some examples of where ClusterIP might be the best option include Service debugging during development and testing, internal traffic and dashboards.</p><p><strong>NodePort</strong> is a virtual machine (VM) used to expose a Service on a Static Port number. It’s primarily used for exposing Services in a non-production environment and it is not recommended for production.</p><p><strong>LoadBalancer</strong> uses an external Load Balancer to expose Services to the Internet. You can use LoadBalancer in a production environment but Ingress is often preferred.</p><p><strong>Ingress</strong> enables you to consolidate the traffic-routing rules into a single resource and runs as part of the Kubernetes Cluster. Some reasons Kubernetes Ingress is the preferred option for exposing a service in a production environment include the following:</p><ul><li>Traffic routing is controlled by rules defined on the Ingress Resource.</li><li>Ingress is part of the Kubernetes Cluster.</li><li>An external Load Balancer is expensive and you need to manage this outside the Kubernetes Cluster. Kubernetes Ingress is managed from inside the Cluster.</li></ul><h3>Ingress Controller</h3><p>In order for the Ingress resource to work, the Cluster must have an Ingress Controller running. If Kubernetes Ingress is the API object that provides routing rules to manage external access to the Services, Ingress Controller is the actual implementation of the Ingress API. The Ingress Controller is responsible for reading the Ingress Resource information and processing that data accordingly. The following is a sample Ingress Resource:</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br> name: {NAME}<br> namespace: {NAMESPACE}<br>spec:<br> rules:<br>   - host: {host}<br>     http:<br>       paths:<br>         - path: /*<br>           pathType: Prefix<br>           backend:<br>             service:<br>               name: {SERVICE}<br>               port:<br>                 number: 8080</pre><p>Looking deeper, the Ingress Controller is an application that runs in a Kubernetes Cluster and configures an HTTP Load Balancer according to the Ingress Resources. The Load Balancer can be a software Load Balancer running in the Cluster or a hardware or Cloud Load Balancer running externally. Different Load Balancers require different Ingress Controller implementations.</p><h3>AWS Ingress Controller</h3><p>Ingress controllers in AWS use ALB to expose the Ingress Controller to outside traffic. They have added benefits such as advanced routing rules (e.g. path-based routing /service2) and consolidating Services to a single entry point for lower cost and centralized configuration.</p><p>The <strong>AWS Load Balancer Controller</strong> manages AWS Load Balancers for a Kubernetes Cluster. Please note that this controller was formerly named as <strong>AWS ALB Ingress Controller</strong>. The controller provisions:</p><ul><li>An AWS Application Load Balancer (ALB) when you create a Kubernetes Ingress.</li><li>An AWS Network Load Balancer (NLB) when you create a Kubernetes Service of type LoadBalancer using IP targets on 1.18 or later Amazon EKS clusters.</li></ul><p>The AWS Load Balancer Controller is a popular way to expose Kubernetes Services using Kubernetes ingress rules to create an ALB. The following diagram is from the original ALB Ingress Controller announcement to show benefits such as ingress path-based routing and the ability to route directly to pods in Kubernetes instead of relying on internal service IPs and kube-proxy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*NebjwCkmO05N-38H" /></figure><h3>Share an ALB with multiple Kubernetes Ingress rules</h3><p>In the AWS ALB Ingress Controller, prior to version 2.0, each Ingress object created in Kubernetes would get its own ALB. Customers wanted a way to lower their cost and duplicate configuration by sharing the same ALB for multiple Services and Namespaces and this feature is available with the <strong>AWS Load Balancer Controller </strong><a href="https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html">https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html</a></p><p>By sharing an ALB, you can still use annotations for advanced routing but share a single load balancer for a team, or any combination of apps by specifying the alb.ingress.kubernetes.io/group.name annotation. All Services within the same group.name will use the same Load Balancer.</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br> name: {NAME}<br> namespace: {NAMESPACE}<br>  annotations:<br>    kubernetes.io/ingress.class: alb<br>    #Share a single ALB with all Ingress rules with a specific group name<br>    alb.ingress.kubernetes.io/group.name: {GROUP_NAME}<br>    alb.ingress.kubernetes.io/target-type: instance<br>    alb.ingress.kubernetes.io/scheme: internet-facing<br>    alb.ingress.kubernetes.io/certificate-arn: {CERTIFICATE}<br>    alb.ingress.kubernetes.io/listen-ports: &#39;[{&quot;HTTPS&quot;:443}]&#39;<br>    alb.ingress.kubernetes.io/actions.ssl-redirect: &#39;{&quot;Type&quot;: &quot;redirect&quot;, &quot;RedirectConfig&quot;: { &quot;Protocol&quot;: &quot;HTTPS&quot;, &quot;Port&quot;: &quot;443&quot;, &quot;StatusCode&quot;: &quot;HTTP_301&quot;}}&#39;<br>spec:<br> rules:<br>   - host: {host}<br>     http:<br>       paths:<br>         - path: /*<br>           pathType: Prefix<br>           backend:<br>             service:<br>               name: {SERVICE}<br>               port:<br>                 number: 8080</pre><h3>Summary</h3><p>The Kubernetes Ingress API lets you expose your applications deployed in a Kubernetes Cluster to the Internet with routing rules into a single source. To implement Ingress, you need to configure an Ingress Controller in your Cluster as this is responsible for processing Ingress Resource information and allowing traffic based on the Ingress rules. In case of an AWS EKS Cluster, you can share an ALB with multiple Kubernetes Ingress rules by installing the latest AWS Load Balancer Controller and configuring the alb.ingress.kubernetes.io/group.name annotation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf49126f8221" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Elements as Native Web Components]]></title>
            <link>https://gtsopour.medium.com/angular-elements-as-native-web-components-750f7bd9605f?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/750f7bd9605f</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angular-elements]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Sun, 14 Jul 2019 16:45:35 GMT</pubDate>
            <atom:updated>2019-07-14T16:45:35.949Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Angular elements</em> are Angular components packaged as <em>custom elements</em> (also called Web Components), a web standard for defining new HTML elements in a framework-agnostic way.</p><p>Custom elements are a Web Platform feature currently supported by Chrome, Firefox, Opera, and Safari, and available in other browsers through polyfills. A custom element extends HTML by allowing you to define a tag whose content is created and controlled by JavaScript code. The browser maintains a CustomElementRegistry of defined custom elements, which maps an instantiable JavaScript class to an HTML tag.</p><p>The @angular/elements package exports a <a href="https://angular.io/api/elements/createCustomElement">createCustomElement</a>() API that provides a bridge from Angular&#39;s component interface and change detection functionality to the built-in DOM API.</p><p>Please find here <a href="https://github.com/gtsopour/angular-elements">https://github.com/gtsopour/angular-elements</a> a public GitHub CLI project that implements the Angular Elements and builds them as Native Web Components.</p><p><a href="https://github.com/gtsopour/angular-elements">https://github.com/gtsopour/angular-elements</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=750f7bd9605f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install and Run Minishift On MacOSX]]></title>
            <link>https://gtsopour.medium.com/how-to-install-and-run-minishift-on-macosx-8cabb3374bb8?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cabb3374bb8</guid>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[minishift]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Thu, 25 Apr 2019 09:28:34 GMT</pubDate>
            <atom:updated>2019-04-25T09:41:29.627Z</atom:updated>
            <content:encoded><![CDATA[<p>Minishift is a tool that helps you run OpenShift locally by launching a single-node OpenShift Origin cluster inside a virtual machine.</p><h3>Download latest Minishift</h3><p>Please download the latest Minishift binary from the Minishift Github releases page <a href="https://github.com/minishift/minishift/releases">https://github.com/minishift/minishift/releases</a> (minishift-1.33.0-darwin-amd64.tgz).<br>Then extract the tgz file and copy the <strong>minishift</strong> file to <strong>/usr/local/bin</strong> folder.</p><pre>tar -xvf ~/Downloads/&lt;minishift-1.33.0-darwin-amd64.tgz&gt;<br>sudo cp ~/Downloads/&lt;minishift-1.33.0-darwin-amd64&gt;/minishift /usr/local/bin<br>sudo chmod +x /usr/local/bin/minishift</pre><h3>Setup the virtualization platform (Hypervisor)</h3><p>Xhyve is the default hypervisor on macOS. For this we need to install libmachine driver plugin for xhyve native OS X Hypervisor.</p><pre>brew install docker-machine-driver-xhyve</pre><pre># docker-machine-driver-xhyve needs root owner and uid<br>sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve<br>sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve</pre><h3>Run Minishift</h3><pre>minishift start</pre><p>Finally you should get in your console the following:</p><pre>OpenShift server started.</pre><pre>The server is accessible via web console at:<br>    <a href="https://192.168.64.2:8443/console">https://192.168.64.2:8443/console</a></pre><pre>You are logged in as:<br>    User:     developer<br>    Password: &lt;any value&gt;</pre><pre>To login as administrator:<br>    oc login -u system:admin</pre><pre>-- Exporting of OpenShift images is occuring in background process with pid 34561.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cabb3374bb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NodeJS Express middleware abstraction]]></title>
            <link>https://gtsopour.medium.com/nodejs-express-middleware-abstraction-2d25926516e4?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d25926516e4</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[middleware]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Mon, 24 Jul 2017 17:06:13 GMT</pubDate>
            <atom:updated>2017-07-24T17:06:13.166Z</atom:updated>
            <content:encoded><![CDATA[<p>NodeJS Express <a href="https://expressjs.com/">https://expressjs.com/</a> is a routing and middleware web framework that has minimal functionality of its own: An Express application is essentially a series of middleware function calls.</p><p><strong><em>Middleware</em></strong> functions <a href="https://expressjs.com/en/guide/using-middleware.html">https://expressjs.com/en/guide/using-middleware.html</a> are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named next.</p><h3>Abstraction</h3><p><strong><em>Middleware</em></strong> is flexible. You can use anonymous or named functions, but <strong>the best thing is to abstract request handlers into external modules based on the functionality</strong>. Even this is straightforward, sometimes we need to pass a param(s) to the exported module functions. <em>Param could be even a callback function. </em>You can find below a simple example.</p><h4>./middlewares/middleware.js</h4><pre>requiredParamHandler = function(param) {<br>    return function (req, res, next) {<br>      // Use param<br>    }<br>}</pre><pre>exports.requiredParamHandler = requiredParamHandler;</pre><h4>app.js</h4><pre>let middleware = require(&#39;./middlewares/middleware&#39;);</pre><pre>app.get(&#39;/api/v1&#39;, middleware.requiredParamHandler(param));</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d25926516e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get all property values of a Javascript Object]]></title>
            <link>https://gtsopour.medium.com/how-to-get-all-property-values-of-a-javascript-object-a07c31a1de5a?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/a07c31a1de5a</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[ecmascript-5]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 12:44:33 GMT</pubDate>
            <atom:updated>2017-07-19T12:47:14.508Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>ECMAScript 5 and ES6</strong></h4><h4>ECMAScript</h4><pre>Object.keys(obj).forEach(function (key) {<br> var val = obj[key];<br> // Use val<br>});</pre><pre><em>// Get values as an Array<br></em>var vals = Object.keys(obj).map(function (key) {<br>    return obj[key];<br>});<br>// Use vals array</pre><h4><strong>ECMAScript 2015 (ES6)</strong></h4><pre>for (const key of Object.keys(obj)) {<br>    const val = obj[key];<br>    // Use val<br>}</pre><pre><em>// Get values as an Array<br></em>const vals = Object.keys(obj).map(key =&gt; obj[key]);<br>// Use vals array</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a07c31a1de5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use ViewChildren to get the QueryList of elements or directives from the view DOM]]></title>
            <link>https://gtsopour.medium.com/use-angular-viewchildren-to-get-the-querylist-of-elements-or-directives-from-the-view-dom-35a37cab0fa3?source=rss-d6f0ee346420------2</link>
            <guid isPermaLink="false">https://medium.com/p/35a37cab0fa3</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[viewchildren]]></category>
            <dc:creator><![CDATA[George Tsopouridis]]></dc:creator>
            <pubDate>Sun, 12 Mar 2017 18:43:59 GMT</pubDate>
            <atom:updated>2017-03-12T20:09:49.067Z</atom:updated>
            <content:encoded><![CDATA[<p>In many cases you have used the <strong>ViewChild</strong> decorator to get the first component matching the selector from the view DOM.</p><p><strong><em>What about if you should keep reference to your components that you initialise dynamically over iterations?</em></strong></p><p>In that case, you can use <strong>ViewChildren</strong> decorator to get the QueryList of elements or directives from the view DOM. Any time a child element is added, removed, or moved, the query list will be updated, and the changes observable of the query list will emit a new value.</p><p><a href="https://angular.io/docs/ts/latest/api/core/index/ViewChildren-decorator.html">https://angular.io/docs/ts/latest/api/core/index/ViewChildren-decorator.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35a37cab0fa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>