Getting start to run kubernetes
This article will illustrate how to run a Kubernetes in mac M1 local, and learn how to use kubectl command to deploy a service. More detailed concept can reference Kubernetes documents
Continue ReadingMarketing, SEO, Web trends, Programming tutorial, Web design, and Life event...
This article will illustrate how to run a Kubernetes in mac M1 local, and learn how to use kubectl command to deploy a service. More detailed concept can reference Kubernetes documents
Continue ReadingIn this article, we will create a simple golang application CI/CD process and push it to Docker hub by github action. Finally, will illustrate an example of how to use the terraform and docker-compose to deploy a local docker environment.
First, create a repository on Docker hub, here we create a repo name adon988/go-github-action-helloworld
Create a project folder .github/workflows/
and add github actions yaml file
Here we used the gorilla module to build a websocket application, and this tutorial will focus on building up a websoccket server.
About client part will implement with the chrome extension: Websocket King.
Get gorilla module
go get github.com/gorilla/websocket
Following are examples of simple websocket servers built with gin and gorilla,
Gin creates a get request and upgrades this HTTP connection to websocket connection by upgrader.Upgrade
.
錯誤訊息:
upgrade:websocket: request origin not allowed by Upgrader.CheckOrigin
原因: 如內文所述,在 Go Websocket 判別跨域來源不合法
解決方式: 需要在 websocket.Upgrader 設定 CheckOrigin 來源,例如下方允許所有來源
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true
},
} // use default options
例如,在使用 Chrome Websocket King Client 擴充時,可以只允許這個來源,例如:
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
origin := r.Header.Get("Origin")
return origin == "chrome-extension://cbcbkhdmedgianpaifchdaddpnmgnknn"
},
}
Continue Reading
AWS Copilot CLI 是一個開源的 CLI ,可以方便地用於管理 AWS App Runner, AWS ECS, AWS Farget.
只要透過簡單的指令就可搭建起 containerized application,
在本文會先介紹 ECS 以及如何透過 Copilot 來部署應用到 ECS 。
AWS ECS(Elastic Container Service) 是一個簡單且高擴充的 container cluster 管理服務, 可以透過 task definnition 定義 container 並且直接運行在 serverless infrastructure (Fargate),或者可以選用 EC2 來做更多的調控。
下方是一個 ECS Object 示意
在開始創建 ECS ,有以下流程
Container definition : 會先需要選擇 image 以及規格 (cpu, RAM….)
Task definition : 用於定義 APP 的藍圖,可以用來描述要部署的一個或多個 containers (最多10 個) ,透過 attributes 設定 container 配置(network, cpu, ram..) 等
Continue Reading這邊列出幾個常見的 shards & replicas 問題及流程機制:
Continue Reading本文紀錄 Linux 安裝及配置 Elasticsearch 單節點以及 cluster 流程:
Continue Reading這裡記錄一些 Elasticsearch 常用的索引操作方式,方便之後查詢參考
Continue Reading這裡記錄一些 Elasticsearch 核心概念及機制說明:
Continue ReadingTmux 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 ReadingA service provider probably has a technology-related service contract with the client to promise about the service level availability and usability.
Here we will discuss service level terminology about SLI/SLO/SLA and User-Facing:
Continue ReadingDatabase slow query is a normalized case in operation situation. For example, if a new feature in production has a long data loading time, we can check this situation in the application log or database slow query.
Here, is how to set MySql slow query log.
Continue ReadingSaltstack is an automatic configuration management tool, easy extension infrastructure, and high performance.
Using Saltstack can easy to manage large-scale servers, include dynamic connections, can be used for remote/local execution, config management, etc.
Continue ReadingWhen running Xcode and iOS simulator, open VSCode does not show the iOS device but has Android emulator options.
How to show iOS simulator in VSCode?
Continue ReadingHow to solve the problem of “another exception was thrown: Unable to load asset:” in flutter?
Here is the step for flutter how to load local images:
First, for use asset image in local, image location should be add in pubsec.yaml
Continue ReadingDart is created by Google in 2011, and can be use for web, server, mobile, and IoT, also can be use to develop Flutter.
Here we will present a quickly short guid for let you understand what is Dart and how to use it. For more detail about Dart can reference tour of basic Dart program.
Continue ReadingThis tutorial will demonstrate how to install flutter in Mac and build the first app with Xcode.
To install flutter and develop the app, we need to check environment meet minimum requirements
In Visual Studio Code, I’m using the Live Sass Compiler and Live Server (both plugins are developed by Ritwick Dey) for the development HTML project.
After install Live Sass compiler and Liver Server, the quickly functional button “Watch Sass” and “Go Live” will show in the VSCode bottom status list.
Continue ReadingHere is a tutorial for download video or streaming from Azure Media Service content.
Azure Media Player provides one player to support multiple devices and formate and integration content protection.
Azure media service is provided a stream solution with Azure Media Player, Azure media service is using manifest as streaming info contains the file.
When we need to download content from Azure media, first, we need to get the manifest URL,
Continue ReadingCobra is a golang library for creating CLI applications and is using by Kubernetes, Hugo, and Github CLI..
Here we will show how to use cobra to build a CLI app.
Continue Reading