码迷,mamicode.com
首页 > 其他好文 > 详细

ambassador 学习一基本试用

时间:2018-07-05 21:38:45      阅读:622      评论:0      收藏:0      [点我收藏+]

标签:none   block   github   tar   dock   docker   bsp   png   epo   

安装使用docker for mac

Without RBAC

安装ambassador

  • 安装
kubectl apply -f https://getambassador.io/yaml/ambassador/ambassador-no-rbac.yaml
  • 创建service
---
apiVersion: v1
kind: Service
metadata:
  name: ambassador
spec:
  type: NodePort
  ports:
   - port: 80
  selector:
    service: ambassador
kubectl apply -f ambassador-service.yaml
  • 状态
    技术分享图片

部署简单服务

  • service yaml (qotm.yaml)
---
apiVersion: v1
kind: Service
metadata:
  name: qotm
  annotations:
    getambassador.io/config: |
      ---
      apiVersion: ambassador/v0
      kind:  Mapping
      name:  qotm_mapping
      prefix: /qotm/
      service: qotm
spec:
  selector:
    app: qotm
  ports:
  - port: 80
    name: http-qotm
    targetPort: http-api
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: qotm
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: qotm
    spec:
      containers:
      - name: qotm
        image: datawire/qotm:1.1
        ports:
        - name: http-api
          containerPort: 5000
        resources:
          limits:
            cpu: "0.1"
            memory: 100Mi
kubectl apply -f qotm.yaml

测试

  • 查看服务状态
kubectl get svc -o wide ambassador

技术分享图片

  • 访问
    技术分享图片

查询统计信息

  • service list
    技术分享图片
  • 访问统计信息查看
  • 访问界面
http://localhost:32598

技术分享图片

  • 服务统计信息
    技术分享图片

参考资料

https://www.getambassador.io/user-guide/getting-started
https://github.com/rongfengliang/ambassador-learning

ambassador 学习一基本试用

标签:none   block   github   tar   dock   docker   bsp   png   epo   

原文地址:https://www.cnblogs.com/rongfengliang/p/9270114.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!