為 GKE 應用建立 CI/CD 流程:自動化部署與更新
在前兩篇文章中,我們成功建立了一個完整的三層架構應用:MySQL、Redis 和 Golang 後端服務,並將它們部署到 GKE 上。然而,手動部署在實際開發中並不實用,特別是當團隊規模擴大或需要頻繁發布時。這篇文章將介紹如何建立一個完整的 CI/CD 流程,實現程式碼變更後的自動測試、建置、部署和更新。
Continue Reading在前兩篇文章中,我們成功建立了一個完整的三層架構應用:MySQL、Redis 和 Golang 後端服務,並將它們部署到 GKE 上。然而,手動部署在實際開發中並不實用,特別是當團隊規模擴大或需要頻繁發布時。這篇文章將介紹如何建立一個完整的 CI/CD 流程,實現程式碼變更後的自動測試、建置、部署和更新。
Continue Reading在上一篇文章中,我們成功使用 Helm 將 Nginx 部署到 GKE 上。這次,我們將更進一步,建立一個完整的三層架構應用:包含 MySQL 資料庫、Redis 快取服務,以及一個 Golang 後端應用。這個實作將更貼近實際的生產環境部署需求。
Continue Reading最近進到新專案,需要開始熟悉 GCP 相關服務,順手先嘗試將一個 Nginx 應用部署到 Google Kubernetes Engine (GKE) 上。過程中,使用 Helm 來簡化與管理部署流程,將過程記錄下來分享。
Continue ReadingContainerization 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.
An Introduction to Kubernetes (3) Publish Application to Amazon Elastic Kubernetes Service
An Introduction to Kubernetes (4) Troubleshooting & References
In this section, will introduction about environment preparation in linux and Mac.
Continue ReadingKubernetes 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.
An Introduction to Kubernetes (3) Publish Application to Amazon Elastic Kubernetes Service
An Introduction to Kubernetes (4) Troubleshooting & References
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 ReadingKubernetes 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.
An Introduction to Kubernetes (3) Publish Application to Amazon Elastic Kubernetes Service
An Introduction to Kubernetes (4) Troubleshooting & References
Before we introduction the environment preparation and cluster. Here will introduction the key concepts in kubernetes:
Continue ReadingIn 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 (3) Publish Application to Amazon Elastic Kubernetes Service
An Introduction to Kubernetes (4) Troubleshooting & References
Troubleshooting Amazon EKS When faced with issues in your Amazon Elastic Kubernetes Service (Amazon EKS) workloads, there are various kubectl commands at your disposal
Continue ReadingWhen 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 ReadingThis is part II to illustrate how to setting secret to kubernetes pod local file.
(Aobut the setting secret to environment variables can reference : How to setting kubernetes secret to environment variables )
In Kubernetes, some sensitive information needs to be managed in Pods, which can be managed by Kubernetes secret.
Here we will demonstrate how to manage secrets and save to pod local file.
Continue ReadingIn Kubernetes, some sensitive information needs to be managed in Pods, which can be managed by Kubernetes secret.
Here we will demonstrate how to manage secrets.
Continue ReadingThis 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 Reading如何在 Mac 本地快速透過 K8S 啟用一個服務,這裡以一個簡易的 go server 為例子,一步步來說明如何啟動。
Continue ReadingK8S 在指派 Node 節點後,查看 Node 會發現 ROLES 除了master ,其他節點都顯示為 none
> kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-node1 Ready <none> 74m v1.18.8
k8s-master Ready master 45h v1.18.6
這時發現 Node 節點的 ROLES 顯示為 none,
可以透過手動方式設定 ROLES
Continue Reading在 Kubernetes 由於 kubeadm 產生的 token 有效時間為 24 小時,若過期則需要重新產生
重新建立 token 可執行以下指令重建:
kubeadm token create
查看 kubeadm token
Continue ReadingK8s 是以 Google 的內部使用十多年的容器編排管理平台 Borg 為基礎原形所實現
萬個機器節點,以及幾千個到幾十萬個 pod (容器組),每週都會部署20多個容器
單一個 container 並不能提供開發者太多的好處,因為開發及生產場景往往需要複雜的交互,需要多個容器同時並行協同工作,以及跨組織的管理
因此,K8s 就作為 container 編排,可跨主機管理的最佳利器
K8s 以 Pod 為基本容器組,每個 Pod 只做一件事,可以將 Pod 進行編排調度,以及聲明他的物件配置模型(Controller, configmap, secret…)
在管理過程中,可以用 controllers 進行資源分配調度,整體健康檢查,修復,彈性伸縮及滾動升級等。
服務發現,服務編排及內部路由支持
服務快速部署
自動負載平衡
對有狀態的服務的支持
K8S 在 2017年戰勝了 Docker Swarm, Apache Mesos ,成為各大雲平台原生應用的支持
K8S 在現有的軟體雲服務之上,又建立一個可移植的雲平台
為用戶提供一個一致的容器部署管理模型
外部請求 -> [ K8s 群集( Service -> 多個 Pod) ]
K8s 群集由一個 Master 節點及多個 Node 節點組成
kubectl get nodes
https://www.imooc.com/video/17048
Continue ReadingKubernets (k8s) 是一個開源的系統,可以用於自動部署,彈性拓展,以及管理容器應用程式。
可以將 containers 統整成 group,並且統一放到一個 Node 的邏輯單元進行管理,及直接用在各種正式的 server 環境。而 Google 就是以這樣的管理模式,每週管理超過數十億個容器,並且在不增加負擔的情況下,輕鬆地完成擴大規模。
在 Docker for mac 預設就提供了 k8s 的安裝
只要開啟 preferences 介面,就會看到 k8s 選項
在這裡我們將它直接啟動,並且同時勾選 Show system containers(advanced) ,就能看到自動安裝 Kubernetes 相關的 containers
安裝 kubernetes-dashboard 服務:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
看到以下內容代表安裝完成
serviceaccount "kubernetes-dashboard" created
role.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
rolebinding.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
deployment.apps "kubernetes-dashboard" created
service "kubernetes-dashboard" created
透過以下指令可以查看目前部署的容器及服務
kubectl get deployments --namespace kube-system
#顯示以下訊息
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
kube-dns 1 1 1 1 22m
kubernetes-dashboard-head 1 1 1 0 1m
透過以下指令啟用 cluster
Continue Reading