ambassador 能够在请求路由以前进行认证处理,通常的咱们可能会使用第三方的认证服务git
基本的环境安装能够参考相关文档github
能够参考官方文档,或者https://github.com/rongfengliang/ambassador-learning
https://github.com/datawire/ambassador-auth-service
--- apiVersion: v1 kind: Service metadata: name: example-auth spec: type: ClusterIP selector: app: example-auth ports: - port: 3000 name: http-example-auth targetPort: http-api --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: example-auth spec: replicas: 1 strategy: type: RollingUpdate template: metadata: labels: app: example-auth spec: containers: - name: example-auth image: datawire/ambassador-auth-service:1.1.1 imagePullPolicy: Always ports: - name: http-api containerPort: 3000 resources: limits: cpu: "0.1" memory: 100Mi kubectl apply -f https://www.getambassador.io/yaml/demo/demo-auth.yaml
--- apiVersion: v1 kind: Service metadata: name: example-auth annotations: getambassador.io/config: | --- apiVersion: ambassador/v0 kind: AuthService name: authentication auth_service: "example-auth:3000" path_prefix: "/extauth" allowed_headers: - "x-qotm-session" spec: type: ClusterIP selector: app: example-auth ports: - port: 3000 name: http-example-auth targetPort: http-api 使用官方提供的配置文件 kubectl apply -f https://www.getambassador.io/yaml/demo/demo-auth-enable.yaml
总的来讲仍是比较简单的,同时比较方便
https://www.getambassador.io/user-guide/auth-tutorial
https://github.com/rongfengliang/ambassador-learningapi