Skip to content
/ ops Public

moke-game基于k8s 集群部署的相关配置

Notifications You must be signed in to change notification settings

moke-game/ops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moke-game EKS 集群

Architecture

image

GameFlow

image

Requirements:

集群创建流程

  • EKS Cluster Create
    • IAM 角色权限策略: AmazonEKSClusterPolicy、AmazonEKS_CNI_Policy,AmazonEBSCSIDriverPolicy
  • Amazon EBS CSI install
  • NodeGroup Create
    • IAM 角色权限策略: AmazonEKSWorkerNodePolicy、AmazonEC2ContainerRegistryReadOnly、AmazonEKS_CNI_Policy、AmazonEBSCSIDriverPolicy

集群访问

配置权限:

  aws configure // 配置aws cli 需要相关权限文件
  aws eks update-kubeconfig --name moke-prod --region ap-southeast-1
  winget install k9s // 安装k9s
  k9s // 查看集群状态

Infrastructure deployment:

  • Install mongodb
    helm repo add bitnami https://charts.bitnami.com/bitnami
    helm repo update 
    helm install mongo oci://registry-1.docker.io/bitnamicharts/mongodb 
  • Install redis
    helm install redis oci://registry-1.docker.io/bitnamicharts/redis 
  • Install Nats
    helm repo add nats https://nats-io.github.io/k8s/helm/charts/
    helm repo update 
    helm upgrade --install nats nats/nats
  • Install ingress-nginx
       helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
       helm repo update 
       helm install nginx -f .\ingress-nginx\values.yaml ingress-nginx/ingress-nginx 

部署cert-manager

点击查看详细描述

部署 agones

部署 moke services:

  • 部署相关secrets,类似于iap-secret,数据库密码等
    #iap-secret.yaml比较敏感,不要上传到git仓库
    kubectl apply -f ./iap/iap-secret.yaml
    kubectl apply -f ./secret.yaml

发布流程:

  1. 登录私有docker registry
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin <your docker private registry>
  1. 构建镜像
# fix {appname} to service name
# 这里建议使用Jenkins/GitHub Actions自动化构建镜像
docker buildx build -t {appname}<your docker private registry>:{version} --build-arg APP_NAME={appname} -f ./build/package/docker/Dockerfile .  --push
  1. 发布服务
  • TODO:通过configmap配置helm values.yaml 以实现不同环境下走不同的配置信息
  • 修改helm/base/Chart.yaml中的version,appVersion(自增)
# fix {appname} to service name
# 这里建议使用Jenkins/argoCD自动化发布服务
helm upgrade --install {appname} ./helm/base  -f ./helm/{appname}/values.yaml 

问题排查

  1. Error saving credentials: error storing credentials - err: exit status 1, out: error storing credentials - err: exit status 1, out: The stub received bad data.
  • 删除 用户/.docker/config.json 文件中 { "credsStore": "desktop" }属性

About

moke-game基于k8s 集群部署的相关配置

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages