c语言sscanf函数的用法是什么
370
2022-09-12
基于k8s安装部署sonarqube
SonarQube需要依赖数据库存储数据,且SonarQube7.9及其以后版本将不再支持Mysql,所以这里推荐设置PostgreSQL作为SonarQube的数据库。
一,安装PGSql
apiVersion: apps/v1kind: Deploymentmetadata: name: postgres-sonar labels: app: postgres-sonarspec: replicas: 1 selector: matchLabels: app: postgres-sonar template: metadata: labels: app: postgres-sonar spec: containers: - name: postgres-sonar image: postgres:11.4 imagePullPolicy: IfNotPresent ports: - containerPort: 5432 env: - name: POSTGRES_DB value: "sonarDB" - name: POSTGRES_USER value: "sonarUser" - name: POSTGRES_PASSWORD value: "123456" resources: limits: cpu: 1000m memory: 2048Mi requests: cpu: 500m memory: 1024Mi volumeMounts: - name: data mountPath: /var/lib/postgresql/data volumes: - name: data persistentVolumeClaim: claimName: postgres-data---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: postgres-data spec: accessModes: - ReadWriteMany storageClassName: "gluster-heketi" resources: requests: storage: 1Gi---apiVersion: v1kind: Servicemetadata: name: postgres-sonar labels: app: postgres-sonarspec: clusterIP: None ports: - port: 5432 protocol: TCP targetPort: 5432 selector: app: postgres-sonar
二,部署SonarQube
apiVersion: apps/v1kind: Deploymentmetadata: name: sonarqube labels: app: sonarqubespec: replicas: 1 selector: matchLabels: app: sonarqube template: metadata: labels: app: sonarqube spec: initContainers: - name: init-sysctl image: busybox imagePullPolicy: IfNotPresent command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true containers: - name: sonarqube image: sonarqube:lts ports: - containerPort: 9000 env: - name: SONARQUBE_JDBC_USERNAME value: "sonarUser" - name: SONARQUBE_JDBC_PASSWORD value: "123456" - name: SONARQUBE_JDBC_URL value: "jdbc:postgresql://postgres-sonar:5432/sonarDB" livenessProbe: path: /sessions/new port: 9000 initialDelaySeconds: 60 periodSeconds: 30 readinessProbe: path: /sessions/new port: 9000 initialDelaySeconds: 60 periodSeconds: 30 failureThreshold: 6 resources: limits: cpu: 2000m memory: 2048Mi requests: cpu: 1000m memory: 1024Mi volumeMounts: - mountPath: /opt/sonarqube/conf name: data subPath: conf - mountPath: /opt/sonarqube/data name: data subPath: data - mountPath: /opt/sonarqube/extensions name: data subPath: extensions volumes: - name: data persistentVolumeClaim: claimName: sonarqube-data ---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: sonarqube-data spec: accessModes: - ReadWriteMany storageClassName: "gluster-heketi" resources: requests: storage: 10Gi---apiVersion: v1kind: Servicemetadata: name: sonarqube labels: app: sonarqubespec: type: NodePort ports: - name: sonarqube port: 9000 targetPort: 9000 nodePort: 30003 protocol: TCP selector: app: sonarqube
部署完成后 通过nodeport方式访问即可,
账号密码都是admin
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~