ambassador 学习一基本试用
Posted rongfengliang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ambassador 学习一基本试用相关的知识,希望对你有一定的参考价值。
安装使用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 学习一基本试用的主要内容,如果未能解决你的问题,请参考以下文章
ambassador 学习九 多ambassador部署说明