# Deployment apiVersion: apps/v1 kind: Deployment metadata: name: gitlab-deployment namespace: dev-environment labels: app: gitlab-dev spec: strategy: type: Recreate replicas: 1 selector: matchLabels: app: gitlab-dev template: metadata: labels: app: gitlab-dev spec: containers: - name: gitlab image: gitlab/gitlab-ce:14.0.5-ce.0 resources: requests: memory: "2Gi" cpu: "1" limits: memory: "4Gi" cpu: "4" ports: - containerPort: 80 name: gitlab-http protocol: TCP volumeMounts: - mountPath: /etc/gitlab name: gitlab-pv-config-dev - mountPath: /var/log/gitlab name: gitlab-pv-logs-dev - mountPath: /var/opt/gitlab name: gitlab-pv-data-dev livenessProbe: failureThreshold: 3 httpGet: path: / port: gitlab-http scheme: HTTP initialDelaySeconds: 300 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 readinessProbe: failureThreshold: 3 httpGet: path: / port: gitlab-http scheme: HTTP initialDelaySeconds: 300 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 3 volumes: - name: gitlab-pv-config-dev persistentVolumeClaim: claimName: gitlab-pvc-config-dev - name: gitlab-pv-logs-dev persistentVolumeClaim: claimName: gitlab-pvc-logs-dev - name: gitlab-pv-data-dev persistentVolumeClaim: claimName: gitlab-pvc-data-dev --- # Persistent Volume Claims description apiVersion: v1 kind: PersistentVolumeClaim metadata: name: gitlab-pvc-config-dev namespace: dev-environment labels: app: gitlab-dev spec: storageClassName: longhorn accessModes: - ReadWriteOnce resources: requests: storage: 2Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: gitlab-pvc-logs-dev namespace: dev-environment labels: app: gitlab-dev spec: storageClassName: longhorn accessModes: - ReadWriteOnce resources: requests: storage: 2Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: gitlab-pvc-data-dev namespace: dev-environment labels: app: gitlab-dev spec: storageClassName: longhorn accessModes: - ReadWriteOnce resources: requests: storage: 2Gi --- # Service description kind: Service apiVersion: v1 metadata: namespace: dev-environment name: gitlab-service spec: selector: app: gitlab-dev ports: - name: gitlab-http port: 80 targetPort: gitlab-http type: NodePort --- # Ingress description apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: gitlab-dev-ingress namespace: dev-environment annotations: kubernetes.io/ingress.class: "traefik" spec: rules: - host: gitlab-dev.k3s.semapp.lan http: paths: - backend: service: name: gitlab-service port: number: 80 path: / pathType: ImplementationSpecific