sonarqube
https://blog.csdn.net/li81562/article/details/139255900
https://www.jindouyun.cn/document/industry/details/184076
| apiVersion: v1 |
| kind: Namespace |
| metadata: |
| name: sonar-ns |
| apiVersion: v1 |
| kind: PersistentVolume |
| metadata: |
| name: nfs-pv |
| namespace: sonar-ns |
| spec: |
| capacity: |
| storage: 5Gi |
| accessModes: |
| - ReadWriteOnce |
| nfs: |
| server: 10.0.2.11 |
| path: "/root/share/pg" |
| |
| --- |
| apiVersion: v1 |
| kind: PersistentVolumeClaim |
| metadata: |
| name: postgres-data |
| namespace: sonar-ns |
| spec: |
| accessModes: |
| - ReadWriteOnce |
| resources: |
| requests: |
| storage: 5Gi |
| |
| --- |
| apiVersion: v1 |
| kind: PersistentVolume |
| metadata: |
| name: nfs-pv2 |
| namespace: sonar-ns |
| spec: |
| capacity: |
| storage: 5Gi |
| accessModes: |
| - ReadWriteOnce |
| nfs: |
| server: 10.0.2.11 |
| path: "/root/share/sonar" |
| |
| --- |
| apiVersion: v1 |
| kind: PersistentVolumeClaim |
| metadata: |
| name: sonarqube-data |
| namespace: sonar-ns |
| spec: |
| accessModes: |
| - ReadWriteOnce |
| resources: |
| requests: |
| storage: 5Gi |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: postgres-sonar |
| namespace: sonar-ns |
| labels: |
| app: postgres-sonar |
| spec: |
| replicas: 1 |
| selector: |
| matchLabels: |
| app: postgres-sonar |
| template: |
| metadata: |
| labels: |
| app: postgres-sonar |
| spec: |
| containers: |
| - name: postgres-sonar |
| image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/bitnami/postgresql:16 |
| imagePullPolicy: IfNotPresent |
| ports: |
| - containerPort: 5432 |
| env: |
| - name: POSTGRES_DB |
| value: "sonarDB" |
| - name: POSTGRES_USER |
| value: "sonar" |
| - name: POSTGRES_PASSWORD |
| value: "123456" |
| resources: |
| limits: |
| cpu: 1000m |
| memory: 2Gi |
| requests: |
| cpu: 500m |
| memory: 1Gi |
| volumeMounts: |
| - name: data |
| mountPath: /var/lib/postgresql/data |
| subPath: data |
| volumes: |
| - name: data |
| persistentVolumeClaim: |
| claimName: postgres-data |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: postgres-sonar |
| namespace: sonar-ns |
| labels: |
| app: postgres-sonar |
| spec: |
| type: NodePort |
| ports: |
| - port: 5432 |
| protocol: TCP |
| targetPort: 5432 |
| nodePort: 31000 |
| selector: |
| app: postgres-sonar |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: sonarqube |
| namespace: sonar-ns |
| labels: |
| app: sonarqube |
| spec: |
| replicas: 1 |
| selector: |
| matchLabels: |
| app: sonarqube |
| template: |
| metadata: |
| labels: |
| app: sonarqube |
| spec: |
| initContainers: |
| - name: init-sysctl |
| image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/gcr.io/google-containers/busybox:1.27.2 |
| imagePullPolicy: IfNotPresent |
| command: ["sysctl", "-w", "vm.max_map_count=262144"] |
| securityContext: |
| privileged: true |
| containers: |
| - name: sonarqube |
| image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/sonarqube:lts-community |
| ports: |
| - containerPort: 9000 |
| env: |
| - name: SONARQUBE_JDBC_USERNAME |
| value: "sonar" |
| - name: SONARQUBE_JDBC_PASSWORD |
| value: "123456" |
| - name: SONARQUBE_JDBC_URL |
| value: "jdbc:postgresql://postgres-sonar:5432/sonarDB" |
| livenessProbe: |
| httpGet: |
| path: /sessions/new |
| port: 9000 |
| initialDelaySeconds: 60 |
| periodSeconds: 30 |
| readinessProbe: |
| httpGet: |
| path: /sessions/new |
| port: 9000 |
| initialDelaySeconds: 60 |
| periodSeconds: 30 |
| failureThreshold: 6 |
| resources: |
| limits: |
| cpu: 2000m |
| memory: 2Gi |
| requests: |
| cpu: 1000m |
| memory: 2Gi |
| 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: v1 |
| kind: Service |
| metadata: |
| labels: |
| app: sonarqube |
| name: sonarqube |
| namespace: sonar-ns |
| spec: |
| internalTrafficPolicy: Cluster |
| ipFamilies: |
| - IPv4 |
| ipFamilyPolicy: SingleStack |
| ports: |
| - name: sonarqube |
| port: 9000 |
| protocol: TCP |
| targetPort: 19000 |
| selector: |
| app: sonarqube |
| sessionAffinity: None |
| type: NodePort |
consul
下载consul
https://developer.hashicorp.com/consul/install#windows
启动
访问
参考:
| https://zhuanlan.zhihu.com/p/715754843 |
| https://www.cnblogs.com/jruing/p/17434858.html |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)