跳到主要内容

快速部署

本文档介绍如何快速部署 AlterShield Operator 到 Kubernetes 集群中。

入门指南

您在运行 AlterShield Operator 服务之前,需要阅读以下文档:

集群中运行

构建镜像并推送

  1. 构建镜像并将其推送到您的镜像仓库中(替换地址中的xxx):
make docker-build docker-push IMG=xxx/altershieldoperator:v1.0.0

部署方式一(推荐)

  1. 获取资源部署文件:
make deployYaml IMG=xxx/altershieldoperator:v1.0.0
  • 可以在config/samples/tmp目录下找到资源部署文件
  1. 执行部署:
kubectl apply -f config/samples/tmp/Deployment.yaml

部署方式二

  1. 执行部署:
make deploy IMG=xxx/altershieldoperator:v1.0.0
  • 当您看到控制台输出以下日志时,表示部署成功
namespace/altershieldoperator-system created
customresourcedefinition.apiextensions.k8s.io/changepods.app.ops.cloud.alipay.com created
customresourcedefinition.apiextensions.k8s.io/changeworkloads.app.ops.cloud.alipay.com created
customresourcedefinition.apiextensions.k8s.io/opsconfiginfoes.app.ops.cloud.alipay.com created
serviceaccount/altershieldoperator-controller-manager created
role.rbac.authorization.k8s.io/altershieldoperator-leader-election-role created
clusterrole.rbac.authorization.k8s.io/altershieldoperator-manager-role created
clusterrole.rbac.authorization.k8s.io/altershieldoperator-metrics-reader created
clusterrole.rbac.authorization.k8s.io/altershieldoperator-proxy-role created
rolebinding.rbac.authorization.k8s.io/altershieldoperator-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/altershieldoperator-manager-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/altershieldoperator-proxy-rolebinding created
service/altershieldoperator-controller-manager-metrics-service created
service/altershieldoperator-webhook-service created
deployment.apps/altershieldoperator-controller-manager created
certificate.cert-manager.io/altershieldoperator-serving-cert created
issuer.cert-manager.io/altershieldoperator-selfsigned-issuer created
mutatingwebhookconfiguration.admissionregistration.k8s.io/altershieldoperator-mutating-webhook-configuration created
validatingwebhookconfiguration.admissionregistration.k8s.io/altershieldoperator-validating-webhook-configuration created

检测服务

  1. 执行以下命令,查看服务是否部署成功:
kubectl get pods -n altershieldoperator-system
  • 当您看到控制台输出以下日志时,表示部署成功
NAME                                                     READY   STATUS    RESTARTS   AGE
altershieldoperator-controller-manager-7f5f6f7f9-4q9q4 2/2 Running 0 2m

卸载服务

make undeploy