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

谢谢你请我吃糖果


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

查看所有标签

猜你喜欢:

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

编程之道

编程之道

杰弗雷﹒詹姆斯 / 清华大学出版社 / 1999-05 / 18.00元

本书出自美国一位善于进行哲学思考、有十多年工作经验的程序设计师——杰弗雷·詹姆斯之手,他以一种敏锐的眼光审视着发生在程序设计室里的各种各样的小故事,并利用古老的道家思想对其进行分析。简单的故事蕴含深奥的道理,是本书的最大特色。本书语言优美,比喻生动,可读性极强。一起来看看 《编程之道》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具