sonarqube部署yaml

明月清风 33浏览 0条评论
首页/正文
分享到: / / / /

https://hub.docker.com/_/sonarqube

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: sonar
  name: sonar
  namespace: public-service
spec:
  selector:
    matchLabels:
      app: sonar
  template:
    metadata:
      labels:
        app: sonar
    spec:
      containers:
      - env:
        - name: crowd.application
          value: sonar
        - name: crowd.password
          value: ***
        - name: crowd.url
          value: https://***.com/crowd/
        - name: ldap.bindDn
          value: cn=admin,dc=***,dc=com
        - name: ldap.bindPassword
          value: ***
        - name: ldap.group.baseDn
          value: ou=group,dc=***,dc=com
        - name: ldap.realm
          value: dc=***,dc=com
        - name: ldap.url
          value: ldap://openldap:389
        - name: ldap.user.baseDn
          value: ou=people,dc=***,dc=com
        - name: ldap.user.emailAttribute
          value: mail
        - name: ldap.user.realNameAttribute
          value: sn
        - name: sonar.jdbc.password
          value: ***
        - name: sonar.jdbc.url
          value: jdbc:postgresql://***:1433/sonarqube
        - name: sonar.jdbc.username
          value: sonarqube
        - name: sonar.security.realm
          value: Crowd
        image: sonarqube:8.3.1-community
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /api/system/status
            port: 9000
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 30
        name: sonar
        ports:
        - containerPort: 9000
          name: http
          protocol: TCP
        volumeMounts:
        - mountPath: /opt/sonarqube/data
          name: sonarqube-data
          subPath: sonarqube/data/
        - mountPath: /opt/sonarqube/logs
          name: sonarqube-logs
          subPath: sonarqube/logs/
        - mountPath: /opt/sonarqube/extensions
          name: sonarqube-extensions
          subPath: sonarqube/extensions/
        - mountPath: /opt/sonarqube/conf/sonar.properties
          name: sonar-config
          subPath: sonar.properties
      volumes:
      - flexVolume:
          driver: alicloud/nas
          options:
            options: nolock,tcp,noresvport
            path: /share
            server: nfs-server
            vers: "3"
        name: sonarqube-data
      - flexVolume:
          driver: alicloud/nas
          options:
            options: nolock,tcp,noresvport
            path: /share
            server: nfs-server
            vers: "3"
        name: sonarqube-logs
      - flexVolume:
          driver: alicloud/nas
          options:
            options: nolock,tcp,noresvport
            path: /share
            server: nfs-server
            vers: "3"
        name: sonarqube-extensions
      - configMap:
          defaultMode: 420
          name: sonar-config
          optional: false
        name: sonar-config
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: sonar
  name: sonar
  namespace: public-service
spec:
  ports:
  - name: http
    port: 9000
    protocol: TCP
    targetPort: 9000
  selector:
    app: sonar
  type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
    nginx.ingress.kubernetes.io/proxy-body-size: 200m
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  name: sonar
  namespace: public-service
spec:
  rules:
  - host: ***.com
    http:
      paths:
      - backend:
          serviceName: sonar
          servicePort: 9000
        path: /
  tls:
  - secretName: ***.com

 

最后修改: © 著作权归作者所有
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

上一篇

发表评论

评论列表

还没有人评论哦~赶快抢占沙发吧~