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 .\i ngress-nginx\v alues.yaml ingress-nginx/ingress-nginx
点击查看详细描述
部署相关secrets,类似于iap-secret,数据库密码等
# iap-secret.yaml比较敏感,不要上传到git仓库
kubectl apply -f ./iap/iap-secret.yaml
kubectl apply -f ./secret.yaml
登录私有docker registry
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin < your docker private registry>
构建镜像
# 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
发布服务
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
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" }属性