Kubernetes环境部署Knowage

栏目: 编程工具 · 发布时间: 5年前

内容简介:本文说明在Kubernetes环境部署mysql-5.6.38及Knowage,前提打镜像及docker直接部署过程见另一文章:

Kubernetes环境部署Knowage

本文说明在Kubernetes环境部署mysql-5.6.38及Knowage,前提打镜像及 docker 直接部署过程见另一文章:

Docker环境安装Knowage

knowage-mysql.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: knowage-mysql
    provider: kavenran
    version: "5.6.38"
  name: knowage-mysql
  namespace: apps
spec:
  replicas: 1
  selector:
    matchLabels:
      app: knowage-mysql
  template:
    metadata:
      labels:
        app: knowage-mysql
    spec:
      containers:
      - name: knowage-mysql
        image: "kr.io/db/mysql:5.6.38"
        imagePullPolicy: IfNotPresent
        env:
        - name: MYSQL_DATABASE
          value: "knowagedb"
        - name: MYSQL_ROOT_PASSWORD
          value: "xxxxxx"
        - name: MYSQL_USER
          value: "knowageuser"
        - name: MYSQL_PASSWORD
          value: "xxxxxx"
        ports:
        - containerPort: 3306
          protocol: TCP
          name: http
        volumeMounts:
        - name: knowage-mysql-data
          mountPath: /var/lib/mysql
      volumes:
      - name: knowage-mysql-data
        persistentVolumeClaim:
          claimName: knowage-mysql-data-pv

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: knowage-mysql-data-pv
  namespace: apps
  annotations:
    volume.beta.kubernetes.io/storage-class: standard
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 2Gi
      
---
apiVersion: v1
kind: Service
metadata:
  name: knowage-mysql
  namespace: apps
  labels: 
    app: knowage-mysql
    provider: kavenran
    version: '5.6.38'
spec:
  type: ClusterIP
  ports:
  - port: 3306
    protocol: TCP
    targetPort: 3306
    name: http
  sessionAffinity: ClientIP
  selector:
    app: knowage-mysql

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: kwnowage-mysql
  namespace: apps
spec:
  rules:
  - host: kwdata.kr.io
    http:
      paths:
      - path: /
        backend:
          serviceName: knowage-mysql
          servicePort: 3306

创建后,为了可远程访问需要登录 mysql 执行:

grant all on *.* to root@'%' identified by 'xxxxxx' with grant option; 
grant all on *.* to knowageuser@'%' identified by 'xxxxxx' with grant option; 
flush privileges;

knowage-server.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: knowage-server
    provider: kavenran
    version: "6.1.8"
  name: knowage-server
  namespace: apps
spec:
  replicas: 1
  selector:
    matchLabels:
      app: knowage-server
  template:
    metadata:
      labels:
        app: knowage-server
    spec:
      containers:
      - name: knowage-server
        image: "kr.io/bi/knowage:6.1.8"
        imagePullPolicy: IfNotPresent
        env:
        - name: DB_ENV_MYSQL_DATABASE
          value: "knowagedb"
        - name: DB_ENV_MYSQL_USER
          value: "knowageuser"
        - name: DB_ENV_MYSQL_PASSWORD
          value: "xxxxxx"
        - name: DB_PORT_3306_TCP_ADDR
          value: "knowage-mysql"
        - name: DB_PORT_3306_TCP_PORT
          value: "3306"
        - name: PUBLIC_ADDRESS
          value: "kw.kr.io"
        - name: PUBLIC_PROT
          value: "80"  //此处我修改过,官方镜像只支持8080
        - name: WAIT_MYSQL
          value: "true"
        ports:
        - containerPort: 8080
          protocol: TCP
          name: http
        volumeMounts:
        - name: knowage-server-data
          mountPath: /home/knowage/apache-tomcat-7.0.57/attachments
      volumes:
      - name: knowage-server-data
        persistentVolumeClaim:
          claimName: knowage-server-data-pv

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: knowage-server-data-pv
  namespace: apps
  annotations:
    volume.beta.kubernetes.io/storage-class: standard
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 2Gi
      
---
apiVersion: v1
kind: Service
metadata:
  name: knowage-server
  namespace: apps
  labels: 
    app: knowage-server
    provider: kavenran
    version: '6.1.8'
spec:
  type: ClusterIP
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 8080
    name: http
  sessionAffinity: ClientIP
  selector:
    app: knowage-server

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: kwnowage-ingress
  namespace: apps
spec:
  rules:
  - host: bi.kr.io
    http:
      paths:
      - path: /
        backend:
          serviceName: knowage-server
          servicePort: 8080

创建后,可使用 bi.kr.io来访问knowage。

使用过程中遇到任何问题欢迎留言或加入Knowage开源BI中国社区:QQ 158245788

Kubernetes环境部署Knowage

谢谢你请我吃糖果


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

重构(影印版)

重构(影印版)

Martin Fowler / 中国电力出版社 / 2003-7-1 / 49.00元

随着对象技术应用越来越普及,软件开发社区出现了一个新的问题。缺乏经验的开发者编写出了大批设计较差的程序,导致这些应用程序非常低效,且难于维护和扩展。本书除了讨论重构的各种技巧之外,还提供了超过70个可行重构的详细编目,对如何应用它们给出了有用的提示;并以step by step的形式给出了应用每一种重构的指南;而且用实例展示了重构的工作原理。这些示例都是用Java语言写成的,但其中的思想却可以运用......一起来看看 《重构(影印版)》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具