Linux

Asdf Introduction & Quick Guide

asdf is a versatile version manager designed to simplify the management of multiple runtime versions, such as programming languages, tools, and frameworks, within a single development environment. With asdf, users can easily install, manage, and switch between different versions of various software packages, ensuring compatibility and flexibility across projects. Whether you’re a developer, system administrator, or anyone who needs to juggle multiple versions of tools, asdf provides a seamless solution, enhancing productivity and eliminating version-related headaches.

Continue Reading

How to Get Real Client Ip on Cloudfront

How to get real client IP in AWS CloudFront

In the realm of web development, obtaining accurate client IP information is a common challenge, especially when leveraging Content Delivery Networks (CDNs) like AWS CloudFront. The quest for the client’s true IP address often involves navigating through headers like X-Forwarded-For, but it’s not as straightforward as it might seem.

Continue Reading

An Introduction to Kubernetes (1) Environment Preparation

Containerization has revolutionized the way applications are deployed, offering increased portability and scalability. At the forefront of container management, Kubernetes has emerged as a dominant open-source platform.

Derived from the Greek word for helmsman or pilot, Kubernetes aptly serves as a pilot, skillfully managing workloads while you set the course for your applications.

In kubernetes series article, we will explore Kubernetes' essential features, its role in managing containerized workloads, and its extensibility options, empowering developers to harness its full potential.

In this section, will introduction about environment preparation in linux and Mac.

Continue Reading

An Introduction to Kubernetes (2) Cluster Introduction

Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It was originally developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes provides a robust and scalable infrastructure to manage and deploy containerized applications in a consistent and efficient manner.

In kubernetes series article, we will explore Kubernetes' essential features, its role in managing containerized workloads, and its extensibility options, empowering developers to harness its full potential.

A Kubernetes cluster is a set of physical or virtual machines (nodes) that are connected together to form a cluster. The cluster is managed by the Kubernetes control plane, which includes several components responsible for maintaining the desired state of the cluster. These components ensure that applications are running as intended and handle tasks such as scaling, load balancing, and monitoring.

Node with following components:

Continue Reading

An Introduction to Kubernetes (3) Publish Application to Amazon Elastic Kubernetes Service

Kubernetes has become the standard for container orchestration, enabling developers and DevOps teams to manage containerized applications efficiently and securely. It has a vibrant ecosystem and a vast community that continues to drive innovation and adoption of cloud-native technologies.

In kubernetes series article, we will explore Kubernetes' essential features, its role in managing containerized workloads, and its extensibility options, empowering developers to harness its full potential.

Before we introduction the environment preparation and cluster. Here will introduction the key concepts in kubernetes:

Continue Reading

An Introduction to Kubernetes (4) Troubleshooting & References

In kubernetes series article, we will explore Kubernetes' essential features, its role in managing containerized workloads, and its extensibility options, empowering developers to harness its full potential. An Introduction to Kubernetes (1) Environment Preparation

Continue Reading

Why event-driven architecture is a good choice for aggregating two applications

What is an event-driven architecture?

Traditional approaches to integrating applications involve tightly coupling them together, making changes to one system impact the other.

Event-driven architecture is an excellent way to decouples and aggregate two or more applications because it provides a flexible and scalable way to integrate and communicate between different systems sources, such as user actions, system events, or sensor data. Event-driven architectures are used to build complex and scalable systems that respond to changes in real-time.

Continue Reading

Introduction data lake and how to establish on AWS

A data lake is a centralized repository for storing and managing large amounts of raw data in various formats. Amazon Web Services (AWS) provides a comprehensive range of services that can be used to set up a data lake system. In this article, we will introduct how establish a data lake on AWS.

Continue Reading

How to grant Cross AWS Account Access Resource by resource-based policies in microservices

Recently, our payment service is building with serverless Event-Driven Architecture with SNS, SQS, and lambda function, this will support the Event callback with core payment event service (the following will show as core event service), and this core event service are integration muli-purchase 3rd vendor to one interface.

When a user has subscriptions behavior in our platform, each action send to 3rd party vendor, the 3rd party vendor will create an Event to core event service, and the core event service send the callbacks Event to project payment service’s SNS, for the final process, project service need provide a cross VPC account access SNS grants to core Event service:

3rd vendor --(callback event)--> core event service --(callback event)--> project

Continue Reading

How Manage Aws Ecs Sensitive/Non-Sensitive Environment Variables

When developing an APP in ECS, We need to pass the environment variables to the tasks container.

Because we have sensitive and non-sensitive environment variables, so we need to take care in choosing the policy.

Continue Reading

Troubleshoot on AWS Elb Return 5xxs Error: 504 Gateway Timeout

We have a service that sometimes got a 504 Gateway Time-Out response from ELB( actually is CLB).

When investigating the root cause, we found out that CLB’s 3 instances are normal in the current two weeks, and the 504 time-outs happened in CLB.

Continue Reading

What different key features between Http1 Http2 Http3?

In this article, we will introduce the main key features of HTTP 1.0, HTTP 1.1, HTTP 2.0, and HTTP 3.0.

HTTP1.0

HTTP1.0 was published in 1996 and already obsoleted.

In HTTP1.0, each request needs to make TCP 3-way-handshake connection, which means will high cost for time-consuming and low efficiency.

Continue Reading

Getting Start install Gitlab Runner in AWS EC2 and Regist

In this article is a tutorial to get started with GitLab Runner, will show you how to install runner in AWS EC2 and registrations to GitLab.

Before you start, you need to make sure local with the following configuration:

  • login AWS CLI
  • Docker
  • nodejs

Continue Reading

Develop and Debug Aws Lambda Function in Local by Vscode

AWS CLI tool - AWS SAM CLI

AWS SAM CLI is a AWS CLI tool that allows you to develop, test and analysis your application in the local environment.

In MAC environment, install SAM tool by brew:

brew tap aws/tap
brew install aws-sam-cli
sam --version

Continue Reading

Getting Started With Tmux

Tmux install and quickly start

Tmux is a terminal multiplexer that can run multiple programs in one terminal. There is powerful to manage several programs in the remote server in one terminal, and using the session to attach or detach them. A prefix is an advanced tool that supports split windows and quick short keys.

That’s getting the start for how to using tmux. Here will showing common usage about tmux.

Continue Reading

Terraform 安裝與運行

Terraform 安裝與運行

Terraform 安裝與運行

Terraform 是由 HashiCorp 開發的一套 Infrastructure as Code 工具。

這裡記錄 Terraform 基本安裝及設定的步驟,示範如何在 GCP 建立一個 instance。

Continue Reading

GCP 佈建 Kubernetes 入門 - 使用 Kubernetes Engine

GCP 佈建 Kubernetes 入門 - 使用 Kubernetes Engine

GCP 佈建 Kubernetes 入門 - 使用 Kubernetes Engine

在這裡記錄如何從 GCP 建立起 Kubernetes Engine 建立起 cluster 流程:

Continue Reading

Ansible 配置管理與部署入門

Ansible 配置管理與部署入門

Ansible 配置管理與部署入門

簡介

Ansible 是一個開源的系統自動化工具,擁有配置系統,任務排程,可以透過代碼來管理我們的infra,可以進階設計出一些 CI/CD 流程等功能。Ansible 預設使用 SSH 來進行遠端主機管理,Ansible 1.3 之後的版本可以透過本地的 OpenSSH 與遠端的主機進行通訊,如果是在比較老舊的作業系統,則會採取 paramiko 的相對應做法。

Continue Reading

Kubernetes (K8S) - Mac 本地執行練習上手 如何用 K8S 快速佈建一個 Go Server

Kubernetes (K8S) - Mac 本地執行練習上手 如何用 K8S 快速佈建一個 Go Server

Kubernetes (K8S) - Mac 本地執行練習上手 如何用 K8S 快速佈建一個 Go Server

如何在 Mac 本地快速透過 K8S 啟用一個服務,這裡以一個簡易的 go server 為例子,一步步來說明如何啟動。

Continue Reading

SSH Secure Tunneling (Proxy&Port Forwarding)

SSH Secure tunnel forwarding

在 SSH 連線有一個 Secure Tuunel (加密通道)方式,

可以將 local 與remote server 之間建立一條 secure tunneling 通道。

這通道的方向可以是 local -> server 或者 server -> local。

首先關於 local to server 以 L (left) 表示, server to local 以 R (right) 表示。

其中在通道的傳輸都是透過 SSH 22port 來做 proxy,以下會再舉例說明:

Continue Reading