pulsar-manager 2.0 k8s 布署
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pulsar
component: pulsar-manager
name: pulsar-manager
namespace: pulsar
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: pulsar
component: pulsar-manager
template:
metadata:
creationTimestamp: null
labels:
app: pulsar
component: pulsar-manager
spec:
containers:
- env:
- name: SPRING_CONFIGURATION_FILE
value: /pulsar-manager/pulsar-manager/application.properties
image: apachepulsar/pulsar-manager:v0.2.0
imagePullPolicy: IfNotPresent
name: pulsar-manager
ports:
- containerPort: 9527
protocol: TCP
- containerPort: 7750
protocol: TCP
resources:
requests:
cpu: 100m
memory: 250Mi
volumeMounts:
- mountPath: /data
name: pulsar-manager-data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
name: pulsar-manager-data
---
apiVersion: v1
kind: Service
metadata:
name: pulsar-manager
namespace: pulsar
spec:
type: NodePort
ports:
- port: 9527
protocol: TCP
name: web
targetPort: 9527
- port: 7750
protocol: TCP
name: api
targetPort: 7750
selector:
app: pulsar
component: pulsar-manager
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pulsar-manager
namespace: pulsar
spec:
rules:
- host: pulsar-manager.github.cn
http:
paths:
- path: /
backend:
serviceName: pulsar-manager
servicePort: 9527
- host: pulsar-manager-api.github.cn
http:
paths:
- path: /
backend:
serviceName: pulsar-manager
servicePort: 7750
---
9527 是web 访问接口
7750 是api 接口,创建账号时调用
要留意的是账号密码相关项2.0需要调用api注册
apache/pulsar-manager: Apache Pulsar Manager (github.com)
backend-service:7750请求地址自行处理,nodeport/ingress
CSRF_TOKEN=$(curl http://backend-service:7750/pulsar-manager/csrf-token)
curl \
-H "X-XSRF-TOKEN: $CSRF_TOKEN" \
-H "Cookie: XSRF-TOKEN=$CSRF_TOKEN;" \
-H 'Content-Type: application/json' \
-X PUT http://backend-service:7750/pulsar-manager/users/superuser \
-d '{"name": "admin", "password": "apachepulsar", "description": "test", "email": "username@test.org"}'