2022-02-13:k8s安装gitlab,yaml如何写?
答案2022-02-13:
yaml如下:
apiVersion: apps/v1kind: Deploymentmetadata: labels: app: gitlab name: gitlab namespace: moonfddspec: replicas: 1 selector: matchLabels: app: gitlab template: metadata: labels: app: gitlab spec: containers: - image: 'gitlab/gitlab-ce' imagePullPolicy: IfNotPresent name: gitlab securityContext: privileged: true volumeMounts: - mountPath: /etc/gitlab name: volv1 - mountPath: /var/log/gitlab name: volv2 - mountPath: /var/opt/gitlab name: volv3 volumes: - hostPath: path: /root/k8s/moonfdd/gitlab/etc/gitlab type: DirectoryOrCreate name: volv1 - hostPath: path: /root/k8s/moonfdd/gitlab/var/log/gitlab type: DirectoryOrCreate name: volv2 - hostPath: path: /root/k8s/moonfdd/gitlab/var/opt/gitlab type: DirectoryOrCreate name: volv3---apiVersion: v1kind: Servicemetadata: labels: app: gitlab name: gitlab namespace: moonfddspec: ports: - port: 80 protocol: TCP targetPort: 80 selector: app: gitlab type: NodePort
结果如下:
gitlab的yaml