gitlab简单部署yaml

明月清风 2020-07-27 43浏览 0条评论
首页/正文
分享到: / / / /

https://hub.docker.com/r/gitlab/gitlab-ce

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app: gitlab
  name: gitlab
  namespace: public-service
data:
  GITLAB_OMNIBUS_CONFIG: |-
    external_url 'https://***.com';
    gitlab_rails['incoming_email_enabled'] = false;
    gitlab_rails['ldap_enabled'] = true;
    gitlab_rails['prevent_ldap_sign_in'] = false;
    letsencrypt['enable'] = false;
    nginx['listen_port'] = 80;
    nginx['listen_https'] = false;
    gitlab_rails['ldap_servers'] = YAML.load <<-EOS;
    main:
      label: '统一认证'
      host: '***.***.***.***'
      port: 389
      uid: 'uid'
      encryption: 'plain'
      bind_dn: 'CN=admin,DC=***,DC=com'
      password: '***'
      smartcard_auth: false
      active_directory: false
      allow_username_or_email_login: true
      lowercase_usernames: true
      base: 'OU=people,DC=huodada,DC=com'
      user_filter: ''
      attributes:
        name: ['sn']
        username: ['uid', 'cn']
        email: ['mail', 'email']
    EOS
    gitlab_rails['gitlab_shell_ssh_port'] = 22;
    gitlab_rails['db_adapter'] = "postgresql";
    gitlab_rails['db_encoding'] = "utf8";
    gitlab_rails['db_database'] = "gitlab";
    gitlab_rails['db_username'] = "gitlab";
    gitlab_rails['db_password'] = "***";
    gitlab_rails['db_host'] = "***";
    gitlab_rails['db_port'] = 1433;
    gitlab_rails['redis_host'] = "***";
    gitlab_rails['redis_port'] = 6379;
    gitlab_rails['redis_ssl'] = false;
    gitlab_rails['redis_password'] = "***";
    gitlab_rails['redis_database'] = 0;
    gitlab_rails['redis_enable_client'] = true;
    gitlab_rails['smtp_enable'] = true;
    gitlab_rails['smtp_address'] = "smtp.exmail.qq.com";
    gitlab_rails['smtp_port'] = 465;
    gitlab_rails['smtp_user_name'] = "system@***.com";
    gitlab_rails['smtp_password'] = "***";
    gitlab_rails['smtp_domain'] = "exmail.qq.com";
    gitlab_rails['smtp_authentication'] = "login";
    gitlab_rails['smtp_enable_starttls_auto'] = true;
    gitlab_rails['smtp_tls'] = true;
    gitlab_rails['gitlab_email_from'] = 'system@***.com';
    postgresql['enable'] = false;
    redis['enable'] = false;
    prometheus['enable'] = false;
    grafana['enable'] = false;
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gitlab
  name: gitlab
  namespace: public-service
spec:
  selector:
    matchLabels:
      app: gitlab
  template:
    metadata:
      labels:
        app: gitlab
    spec:
      containers:
      - env:
        - name: GITLAB_OMNIBUS_CONFIG
          valueFrom:
            configMapKeyRef:
              key: GITLAB_OMNIBUS_CONFIG
              name: gitlab
              optional: false
        image: gitlab/gitlab-ce:latest
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /-/liveness?token=******
            port: 80
            scheme: HTTP
          initialDelaySeconds: 120
          periodSeconds: 2
          successThreshold: 1
          timeoutSeconds: 2
        name: gitlab
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        - containerPort: 443
          name: https
          protocol: TCP
        - containerPort: 22
          name: ssh
          protocol: TCP
        volumeMounts:
        - mountPath: /etc/gitlab
          name: data
          subPath: config/
        - mountPath: /var/log/gitlab
          name: data
          subPath: logs/
        - mountPath: /var/opt/gitlab
          name: data
          subPath: data/
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: gitlab
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: gitlab
  name: gitlab
  namespace: public-service
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: gitlab
  type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: gitlab
  name: gitlab-internet
  namespace: public-service
spec:
  ports:
  - name: ssh
    port: 22
    protocol: TCP
    targetPort: 22
  selector:
    app: gitlab
  type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 200m
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  name: gitlab
  namespace: public-service
spec:
  rules:
  - host: ***.com
    http:
      paths:
      - backend:
          serviceName: gitlab
          servicePort: 80
        path: /
  tls:
  - secretName: ***.com

 

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

上一篇

发表评论

评论列表

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