Skip to content
代码片段 群组 项目

比较版本

更改显示为版本正在合并到目标版本。了解更多关于比较版本的信息。

来源

选择目标项目
No results found

目标

选择目标项目
  • AlexFly666/myiac
  • itzdd/myiac
  • devopsluo2/myiac
  • chenpangpang1986/myiac
  • fxkjnj/fxkj-myiac
  • ray.zw.liang/myiac
  • devnetming/myiac
  • ned/myiac
  • zhangnan/myiac
  • hitotech/myiac
  • jaytangtl/myiac
  • happyjay23/myiac
  • devopszxb/myiac
  • yuchenno7/myiac
  • jiaoben/myiac
  • risingwen/myiac
  • 4c3/myiac
  • zuu/myiac
  • zhangnan/myiac-new
  • devops6224939/myiac
  • NETXS2000/myiac-copy
  • 13794521695/myiac
  • xuelangos/myiac
  • rtsfan1024/myiac
  • devopsluo/myiac
  • specialivan/myiac
  • devopsvvip/myiac
  • ruigao1988/myiac
  • stsimon/myiac
  • Chrismasman/myiac
  • devopsvvip1/myiac
  • sunzhi/myiac
32 个结果
显示更改
源代码提交(30)
......@@ -17,3 +17,10 @@ terraform apply
# 仅部署某个资源
terraform apply -target=docker_container.sonarqube
````
### 部署说明
- Step1 : Deploy Kubernetes cluster
- Step2 : Deploy ArgoCD
- Step3 : Deploy Jenkins
- Step4 : Deploy GitLab
\ No newline at end of file
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: gitlab
namespace: argocd
spec:
destination:
namespace: gitlab
server: https://kubernetes.default.svc
project: default
source:
path: devops/gitlab/manifests
repoURL: https://jihulab.com/devopsvip/myiac.git
targetRevision: main
directory:
recurse: false
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
\ No newline at end of file
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: gitlab-runner
namespace: argocd
spec:
destination:
namespace: gitlab
server: https://kubernetes.default.svc
project: default
source:
path: devops/gitlab/runner-manifests
repoURL: https://jihulab.com/devopsvip/myiac.git
targetRevision: main
directory:
recurse: false
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
\ No newline at end of file
---
kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: gitlab
name: gitlab
namespace: gitlab
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: gitlab
template:
metadata:
labels:
k8s-app: gitlab
namespace: gitlab
name: gitlab
spec:
containers:
- name: gitlab
image: gitlab/gitlab-ce:16.2.2-ce.0
imagePullPolicy: IfNotPresent
env:
- name: GITLAB_HOME
value: /var/lib/gitlab
- name: GITLAB_PORT
value: "80"
- name: GITLAB_SSH_PORT
value: "22"
- name: EXTERNAL_URL
value: "http://gitlab.idevops.site"
- name: GITLAB_OMNIBUS_CONFIG
value: "external_url 'http://gitlab.idevops.site';"
ports:
- containerPort: 80
name: web
protocol: TCP
- containerPort: 22
name: ssh
protocol: TCP
resources:
limits:
cpu: 2000m
memory: 8Gi
requests:
cpu: 500m
memory: 512Mi
# livenessProbe:
# httpGet:
# path: /users/sign_in
# port: 80
# initialDelaySeconds: 60
# timeoutSeconds: 5
# failureThreshold: 12
# readinessProbe:
# httpGet:
# path: /users/sign_in
# port: 80
# initialDelaySeconds: 60
# timeoutSeconds: 5
# failureThreshold: 12
volumeMounts:
- name: gitlab-home
mountPath: /etc/gitlab
subPath: config
- name: gitlab-home
mountPath: /var/log/gitlab
subPath: logs
- name: gitlab-home
mountPath: /var/opt/gitlab
subPath: data
volumes:
- name: gitlab-home
persistentVolumeClaim:
claimName: gitlab
serviceAccountName: gitlab
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: gitlab
name: gitlab
namespace: gitlab
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: gitlab
name: gitlab
namespace: gitlab
spec:
ports:
- name: web
port: 80
targetPort: 80
- name: ssh
port: 22
targetPort: 22
selector:
k8s-app: gitlab
\ No newline at end of file
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gitlab-server-ingress
namespace: gitlab
annotations:
kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "700m"
spec:
rules:
- host: gitlab.idevops.site
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gitlab
port:
name: web
\ No newline at end of file
apiVersion: v1
kind: PersistentVolume
metadata:
name: gitlab
spec:
capacity:
storage: 20Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
storageClassName: ""
# mountOptions:
# - hard
# - nfsvers=4.1
nfs:
path: /data/storage/kubernetes/gitlab
server: 192.168.1.200
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitlab
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 20Gi
storageClassName: ""
\ No newline at end of file
## NFS
## Gitlab
mkdir -p /data/storage/kubernetes/gitlab/{config,logs,data}
chmod 777 -R /data/storage/kubernetes/gitlab/
## GitLab Runner
mkdir -p /data/storage/kubernetes/gitlab-runner
chmod 777 -R /data/storage/kubernetes/gitlab-runner
## Docker images
docker pull gitlab/gitlab-ce:16.2.2-ce.0
docker pull gitlab/gitlab-runner:alpine-v16.2.0
## LoadDockerImage
kind load docker-image gitlab/gitlab-ce:16.2.2-ce.0 --name devopscluster
kind load docker-image gitlab/gitlab-runner:alpine-v16.2.0 --name devopscluster
## ArgoAPP
kubectl -n argocd apply -f gitlab-argoapp.yaml
\ No newline at end of file
---
kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: gitlab-runner
name: gitlab-runner
namespace: gitlab
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: gitlab-runner
template:
metadata:
labels:
k8s-app: gitlab-runner
namespace: gitlab
name: gitlab-runner
spec:
hostAliases:
- ip: "192.168.1.200"
hostnames:
- "gitlab.idevops.site"
containers:
- name: gitlab-runner
image: gitlab/gitlab-runner:alpine-v16.2.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8093
name: session
protocol: TCP
resources:
limits:
cpu: 2000m
memory: 8Gi
requests:
cpu: 500m
memory: 512Mi
volumeMounts:
- name: gitlab-runner
mountPath: /home/gitlab-runner/.gitlab-runner
volumes:
- name: gitlab-runner
persistentVolumeClaim:
claimName: gitlab-runner
serviceAccountName: gitlab-runner
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: gitlab-runner
name: gitlab-runner
namespace: gitlab
---
# kind: Service
# apiVersion: v1
# metadata:
# labels:
# k8s-app: gitlab
# name: gitlab
# namespace: gitlab
# spec:
# type: NodePort
# ports:
# - name: web
# port: 80
# targetPort: 80
# - name: ssh
# port: 22
# targetPort: 22
# selector:
# k8s-app: gitlab
\ No newline at end of file
apiVersion: v1
kind: PersistentVolume
metadata:
name: gitlab-runner
spec:
capacity:
storage: 20Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
storageClassName: ""
# mountOptions:
# - hard
# - nfsvers=4.1
nfs:
path: /data/storage/kubernetes/gitlab-runner
server: 192.168.1.200
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitlab-runner
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 20Gi
storageClassName: ""
\ No newline at end of file
......@@ -19,6 +19,10 @@ spec:
namespace: devops
name: jenkinsagent
spec:
hostAliases:
- ip: "192.168.1.200"
hostnames:
- "gitlab.idevops.site"
containers:
- name: jenkinsagent
image: jenkins/inbound-agent
......