docker pull docker.io/ss75710541/3scale-operator:latest
mkdir -p $GOPATH/src/github.com/ss75710541
cd $GOPATH/src/github.com/ss75710541
git clone https://github.com/ss75710541/3scale-operator
cd 3scale-operator
git checkout master
# 在下面源码文件中修改镜像信息
pkg/3scale/amp/component/ampimages.go
pkg/3scale/amp/product/release_2_5.go
pkg/3scale/amp/product/upstream.go
git commit -am "update images"
git push
[[override]]
name = "github.com/ss75710541/3scale-operator"
revision = "<填写上面查到的commit id>"
cd pkg/3scale/amp/
make all
git commit -am "update amp templates"
cd $GOPATH/src/github.com/ss75710541/3scale-operator
export VERSION=v0.2.0.8
make build
make push
# 以OpenShift管理员用户创建3scale-operator的CRDs:
for i in `ls deploy/crds/*_crd.yaml`; do oc create -f $i ; done
# 创建一个新的空项目(这可以用任何想要的OpenShift用户来完成)
export NAMESPACE="3scale"
oc new-project $NAMESPACE
oc project $NAMESPACE
# 创建 3scale-operator ServiceAccount
oc create -f deploy/service_account.yaml
# 创建 3scale-operator 相关的 roles和 role bindings
oc create -f deploy/role.yaml
oc create -f deploy/role_binding.yaml
# 修改部署3cale-operator yaml中的镜像地址
# 最新的是latest
sed -i 's|REPLACE_IMAGE|quay.io/3scale/3scale-operator:latest|g' deploy/operator.yaml
# 部署 3scale-operator
oc create -f deploy/operator.yaml
# 查看部署状态
oc get deployment 3scale-operator
apiVersion: apps.3scale.net/v1alpha1
kind: APIManager
metadata:
name: example-apimanager
spec:
productVersion: <productVersion>
wildcardDomain: <wildcardDomain>
wildcardPolicy: <None|Subdomain>
resourceRequirementsEnabled: true
apiVersion: apps.3scale.net/v1alpha1
kind: APIManager
metadata:
name: example-apimanager
spec:
productVersion: 2.5
wildcardDomain: apigateway.hisun.com
wildcardPolicy: None
resourceRequirementsEnabled: true