diff --git a/README.md b/README.md index e632cb7..01b84be 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,4 @@ Front end for Git, with integrated Container Registry and CI/CD capabilities. This repository only contains configuration used for Kubernetes. + diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index fb249f3..544cfbf 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -9,6 +9,7 @@ data: GITEA__server__DISABLE_SSH: "true" GITEA__security__INSTALL_LOCK: "true" GITEA__service__DISABLE_REGISTRATION: "true" + GITEA__metrics__ENABLED: "true" #app.ini: | # APP_NAME = K8s implementation # RUN_MODE = prod diff --git a/manifests/ingress.yaml b/manifests/ingress.yaml index fce869c..de8c5ba 100644 --- a/manifests/ingress.yaml +++ b/manifests/ingress.yaml @@ -1,23 +1,29 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware metadata: - name: gitea-ingress - namespace: gitea - annotations: - kubernetes.io/ingress.class: "traefik" + name: replace-regex + namespace: gitea spec: - tls: - - secretName: gitea-beta-tls - hosts: - - git.beta.halia.dev - rules: - - host: git.beta.halia.dev - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: gitea-svc - port: - number: 80 + replacePathRegex: + regex: "^/metrics" + replacement: "/" + +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: gitea-ingress + namespace: gitea + annotations: + kubernetes.io/ingress.class: "traefik" +spec: + entryPoints: + - websecure + routes: + - match: Host(`git.beta.halia.dev`) && PathPrefix(`/`) + kind: Rule + middlewares: + - name: replace-regex + services: + - name: gitea-svc + port: 80 diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml index 5d352c3..0719848 100644 --- a/manifests/kustomization.yaml +++ b/manifests/kustomization.yaml @@ -5,6 +5,7 @@ resources: - namespace.yaml - database.yaml - service.yaml + - servicemonitor.yaml - ingress.yaml - configmap.yaml - admin-creator.yaml diff --git a/manifests/service.yaml b/manifests/service.yaml index c088309..1c675ae 100644 --- a/manifests/service.yaml +++ b/manifests/service.yaml @@ -3,6 +3,8 @@ kind: Service metadata: name: gitea-svc namespace: gitea + labels: + app.kubernetes.io/name: gitea spec: ports: - name: http diff --git a/manifests/servicemonitor.yaml b/manifests/servicemonitor.yaml new file mode 100644 index 0000000..dd017c6 --- /dev/null +++ b/manifests/servicemonitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: gitea + namespace: gitea + labels: + team: core +spec: + selector: + matchLabels: + app.kubernetes.io/name: gitea + endpoints: + - port: http + path: /metrics