部署数据库,利用mysql-operator,部署完成之后登录进去手动创建confluence库
Code Block |
---|
apiVersion: v1 kind: Secret metadata: name: confluence-secret namespace: tools type: Opaque data: # root password is required to be specified ROOT_PASSWORD: Y29uZmx1ZW5jZQ== ## 密码为confluence # DATABASE: # USER: # PASSWORD: --- apiVersion: mysql.presslabs.org/v1alpha1 kind: MysqlCluster metadata: name: confluence namespace: tools spec: replicas: 1 secretName: confluence-secret image: harbor.uenpay.com/base/percona:8.0 mysqlVersion: "8.0" mysqlConf: default_authentication_plugin: caching_sha2_password character-set-server: utf8mb4 collation-server: utf8mb4_bin transaction-isolation: READ-COMMITTED max-connections: 1024 max-allowed-packet: 256M innodb-log-file-size: 2g log-bin-trust-function-creators: 'true' podSpec: nodeSelector: zone: dell resources: requests: cpu: "4" memory: 8Gi limits: cpu: "4" memory: 8Gi volumeSpec: persistentVolumeClaim: storageClassName: cephrbd-sc accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 30Gi |
建库:
Code Block |
---|
CREATE DATABASE confluence DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; |
应用:
Code Block |
---|
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: confluence
namespace: tools
spec:
replicas: 1
selector:
matchLabels:
app: confluence
template:
metadata:
labels:
app: confluence
spec:
containers:
- name: confluene
#该镜像已将注册机打到/data/confluence-agent/atlassian-agent.jar
#MySQL8.0驱动打到/opt/atlassian/confluence/confluence/WEB-INF/lib/mysql-connector-j-8.0.31.jar
image: harbor.uenpay.com/base/confluence-server:8.0.0_example.com
#image: registry.cn-hangzhou.aliyuncs.com/zhengyu1992/confluence-server:8.0.0_example.com
ports:
- name: web
containerPort: 80
protocol: TCP
env:
- name: TZ
value: Asia/Shanghai
- name: JVM_MINIMUM_MEMORY
value: 4g
- name: JVM_MAXIMUM_MEMORY
value: 4g
- name: JVM_RESERVED_CODE_CACHE_SIZE
value: 512m
- name: JVM_SUPPORT_RECOMMENDED_ARGS
value: '-javaagent:/data/confluence-agent/atlassian-agent.jar'
- name: ATL_JDBC_URL
value: jdbc:mysql://confluence-mysql:3306/confluence
- name: ATL_JDBC_USER
value: root
- name: ATL_JDBC_PASSWORD
value: confluence
- name: ATL_DB_TYPE
value: mysql
resources:
limits:
cpu: '4'
memory: 8Gi
requests:
cpu: 1
memory: 2Gi
volumeMounts:
- name: config
mountPath: /opt/atlassian/confluence/conf/server.xml
subPath: server.xml
- name: data
mountPath: /var/atlassian/application-data/confluence
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
name: confluence-config
name: config
volumeClaimTemplates:
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: data
annotations:
volume.beta.kubernetes.io/storage-class: "cephrbd-sc"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
---
kind: Service
apiVersion: v1
metadata:
name: confluence
namespace: tools
labels:
app: confluence
spec:
ports:
- name: web
protocol: TCP
port: 8090
targetPort: 8090
selector:
app: confluence
---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: confluence.uenpay.com-ingress
namespace: tools
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
nginx.ingress.kubernetes.io/proxy-connect-timeout: '300'
nginx.ingress.kubernetes.io/proxy-read-timeout: '300'
nginx.ingress.kubernetes.io/proxy-send-timeout: '300'
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
spec:
ingressClassName: nginx
rules:
- host: confluence.uenpay.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: confluence
port:
number: 8090
tls:
- hosts:
- confluence.uenpay.com
secretName: uenpay.com |
破解
Code Block |
---|
kubectl -n tools exec confluence-0 -- java -jar /data/confluence-agent/atlassian-agent.jar -p conf -m admin@example.com -n tom -o bluesky -s BWYW-WBH0-PBBT-2V02 |