diff --git a/cluster/infra.yaml b/cluster/infra.yaml new file mode 100644 index 0000000..803d4a2 --- /dev/null +++ b/cluster/infra.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra + namespace: flux-system +spec: + interval: 10m0s + sourceRef: + kind: GitRepository + name: flux-system + path: ./infra + prune: true + wait: true diff --git a/infra/kustomization.yaml b/infra/kustomization.yaml new file mode 100644 index 0000000..d9f72f9 --- /dev/null +++ b/infra/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - nginx.yaml diff --git a/infra/nginx.yaml b/infra/nginx.yaml new file mode 100644 index 0000000..5a26145 --- /dev/null +++ b/infra/nginx.yaml @@ -0,0 +1,56 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: nginx-ingress-controller +--- +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: nginx + namespace: nginx-ingress-controller +spec: + interval: 24h + url: https://helm.nginx.com/stable +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: nginx-ingress + namespace: nginx-ingress-controller +spec: + interval: 30m + chart: + spec: + chart: nginx-ingress + version: 2.0.1 + sourceRef: + kind: HelmRepository + name: nginx + namespace: nginx-ingress-controller + interval: 12h + values: + controller: + resources: + requests: + cpu: 0 + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + + ingressClass: + create: true + setAsDefaultIngress: true + + service: + create: true + type: LoadBalancer + # Requirement for sharing ip with other service + externalTrafficPolicy: Cluster + ipFamilyPolicy: RequireDualStack + annotations: + # Share IP with gitea ssh so we can have the same domain for both port + lbipam.cilium.io/sharing-key: gitea + lbipam.cilium.io/sharing-cross-namespace: gitea + lbipam.cilium.io/ips: 10.44.0.0,2001:470:61a3:400::1