
近期前前前前前前前同事M先森找博主问了个问题:gitea这个仓库怎么配置webhook?老实说这东西2019年曾使用过,当时是由土豪P整的cicd组合(gitea+drone),一个字:轻量~,后来被博主干掉了,好像pass的原因是因为这个仓库和cicd流水线的权限管理上的不足,具体啥来者博主自己都忘了。。。催的紧,留个篇章记录下
用helm快速安装一个体验下
helm安装
1 2 3
| [root@k8s-master gitea]# curl -fsSL -o get_helm.sh [root@k8s-master gitea]# https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 [root@k8s-master gitea]# chmod 700 get_helm.sh [root@k8s-master gitea]# ./get_helm.sh
|
helm部署gitea
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
| [root@k8s-master gitea]# helm repo add gitea https://dl.gitea.io/charts [root@k8s-master gitea]# helm repo update [root@k8s-master gitea]# helm show values gitea/gitea > values.yaml
[root@k8s-master gitea]# egrep -v '^$^[[:space:]]{0,4}#' values.yaml global: imageRegistry: "" imagePullSecrets: [] storageClass: "" replicaCount: 1 clusterDomain: cluster.local image: registry: "" repository: gitea/gitea tag: "" pullPolicy: IfNotPresent rootless: false # only possible when running 1.14 or later imagePullSecrets: [] podSecurityContext: fsGroup: 1000 containerSecurityContext: {} securityContext: {} service: http: type: NodePort port: 3000 clusterIP: None loadBalancerIP: nodePort: externalTrafficPolicy: externalIPs: ipFamilyPolicy: ipFamilies: loadBalancerSourceRanges: [] annotations: {} ssh: type: ClusterIP port: 22 clusterIP: None loadBalancerIP: nodePort: externalTrafficPolicy: externalIPs: ipFamilyPolicy: ipFamilies: hostPort: loadBalancerSourceRanges: [] annotations: {} ingress: enabled: false className: annotations: {} hosts: - host: git.example.com paths: - path: / pathType: Prefix tls: [] resources: {} schedulerName: "" nodeSelector: {} tolerations: [] affinity: {} dnsConfig: {} statefulset: env: [] terminationGracePeriodSeconds: 60 labels: {} annotations: {} persistence: enabled: true existingClaim: size: 20Gi accessModes: - ReadWriteOnce labels: {} annotations: {} storageClass: nfs-storage subPath: extraVolumes: [] extraContainerVolumeMounts: [] extraInitVolumeMounts: [] extraVolumeMounts: [] initPreScript: "" signing: enabled: false gpgHome: /data/git/.gnupg gitea: admin: existingSecret: username: gitea_admin password: r8sA8CPHD9!bt6d email: "gitea@local.domain" metrics: enabled: false serviceMonitor: enabled: false # additionalLabels: # prometheus-release: prom1 ldap: [] oauth: [] config: {} additionalConfigSources: [] additionalConfigFromEnvs: [] podAnnotations: {} livenessProbe: enabled: true tcpSocket: port: http initialDelaySeconds: 200 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 10 readinessProbe: enabled: true tcpSocket: port: http initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 startupProbe: enabled: false tcpSocket: port: http initialDelaySeconds: 60 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 10 memcached: enabled: true service: port: 11211 postgresql: enabled: true global: postgresql: postgresqlDatabase: gitea postgresqlUsername: gitea postgresqlPassword: gitea servicePort: 5432 persistence: size: 10Gi storageClass: nfs-storage mysql: enabled: false root: password: gitea db: user: gitea password: gitea name: gitea service: port: 3306 persistence: size: 10Gi mariadb: enabled: false auth: database: gitea username: gitea password: gitea rootPassword: gitea primary: service: port: 3306 persistence: size: 10Gi checkDeprecation: true
# 开始安装 [root@k8s-master gitea]# helm install gitea -f values.yaml gitea/gitea [root@k8s-master gitea]# helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION gitea default 1 2022-11-10 10:59:10.133232185 +0800 CST deployed gitea-6.0.3 1.17.3
|
webhook
如何对接drone