flux cd refactoring enable git repo, and global resources deploy
This commit is contained in:
@@ -1,11 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- backups
|
|
||||||
- nextcloud
|
|
||||||
- onlyoffice
|
|
||||||
- whiteboard
|
|
||||||
generatorOptions:
|
|
||||||
disableNameSuffixHash: true
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: full-stack-sync
|
||||||
|
spec:
|
||||||
|
interval: 1m
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: cloud-limbosolutions-com
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
path: deploy/kustomization.yaml
|
||||||
|
prune: true
|
||||||
|
decryption:
|
||||||
|
provider: sops
|
||||||
|
secretRef:
|
||||||
|
name: flux-sops-age
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: cloud-limbosolutions-com
|
||||||
|
spec:
|
||||||
|
interval: 1m0s
|
||||||
|
url: ssh://git@git.limbosolutions.com:2222/marcio.fernandes/nextcloud.git
|
||||||
|
ref:
|
||||||
|
branch: main
|
||||||
|
secretRef:
|
||||||
|
name: flux-repo-ssh-credentials
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
|
resources:
|
||||||
|
- git-repo.yaml
|
||||||
|
- full-stack-sync.yaml
|
||||||
|
secretGenerator:
|
||||||
|
- name: flux-repo-ssh-credentials
|
||||||
|
files:
|
||||||
|
- "identity=./.env.d/flux-repo-ssh-key"
|
||||||
|
- "known_hosts=./.env.d/flux-repo-ssh-known_hosts"
|
||||||
|
- "pubkey=./.env.d/flux-repo-ssh-key.pub"
|
||||||
|
- name: flux-sops-age
|
||||||
|
files:
|
||||||
|
- "age.agekey=./.env.d/age.agekey"
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
@@ -2,7 +2,6 @@ apiVersion: cert-manager.io/v1
|
|||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: cloud-limbosolutions-com-tls
|
name: cloud-limbosolutions-com-tls
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
spec:
|
spec:
|
||||||
secretName: cloud-limbosolutions-com-tls
|
secretName: cloud-limbosolutions-com-tls
|
||||||
issuerRef:
|
issuerRef:
|
||||||
@@ -10,4 +9,3 @@ spec:
|
|||||||
kind: ClusterIssuer
|
kind: ClusterIssuer
|
||||||
dnsNames:
|
dnsNames:
|
||||||
- cloud.limbosolutions.com
|
- cloud.limbosolutions.com
|
||||||
renewBefore: 360h
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ./certificate.yaml
|
- ./certificate.yaml
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: cilium.io/v2
|
||||||
|
kind: CiliumNetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: allow-same-namespace-ingress
|
||||||
|
spec:
|
||||||
|
endpointSelector: {} # All pods in this namespace
|
||||||
|
ingress:
|
||||||
|
- fromEndpoints:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: k8s:io.kubernetes.pod.namespace
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- cloud-limbosolutions-com
|
||||||
|
|
||||||
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
apiVersion: cilium.io/v2
|
|
||||||
kind: CiliumNetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-same-namespace-ingress
|
|
||||||
spec:
|
|
||||||
endpointSelector: {} # All pods in this namespace
|
|
||||||
ingress:
|
|
||||||
- fromEndpoints:
|
|
||||||
- matchExpressions:
|
|
||||||
- key: k8s:io.kubernetes.pod.namespace
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- cloud-limbosolutions-com
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
apiVersion: cilium.io/v2
|
|
||||||
kind: CiliumNetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-traefik-to-nextcloud-ingress
|
|
||||||
spec:
|
|
||||||
endpointSelector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: nextcloud
|
|
||||||
|
|
||||||
ingress:
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
# Allow Traefik (internal and public) to reach nextcloud web port
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
- fromEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
app.kubernetes.io/name: traefik
|
|
||||||
matchExpressions:
|
|
||||||
- key: k8s:io.kubernetes.pod.namespace
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- traefik
|
|
||||||
- traefik-public
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "80"
|
|
||||||
|
|
||||||
protocol: TCP
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
apiVersion: cilium.io/v2
|
|
||||||
kind: CiliumNetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-traefik-to-onlyoffice-ingress
|
|
||||||
spec:
|
|
||||||
endpointSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: onlyoffice
|
|
||||||
|
|
||||||
ingress:
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
# Allow Traefik (internal and public) to reach onlyoffice web port
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
- fromEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
app.kubernetes.io/name: traefik
|
|
||||||
matchExpressions:
|
|
||||||
- key: k8s:io.kubernetes.pod.namespace
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- traefik
|
|
||||||
- traefik-public
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "80"
|
|
||||||
|
|
||||||
protocol: TCP
|
|
||||||
---
|
|
||||||
apiVersion: cilium.io/v2
|
|
||||||
kind: CiliumNetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-traefik-to-whiteboard-ingress
|
|
||||||
spec:
|
|
||||||
endpointSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: nextcloud-whiteboard
|
|
||||||
|
|
||||||
ingress:
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
# Allow Traefik (internal and public) to reach whiteboard ws
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
- fromEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
app.kubernetes.io/name: traefik
|
|
||||||
matchExpressions:
|
|
||||||
- key: k8s:io.kubernetes.pod.namespace
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- traefik
|
|
||||||
- traefik-public
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "3002"
|
|
||||||
|
|
||||||
protocol: TCP
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- ./ingress-web-public.yaml
|
|
||||||
- ./ingress-web.yaml
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- ./ingress.yaml
|
|
||||||
- ./middlewares.yaml
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- ./middlewares.yaml
|
|
||||||
|
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
namespace: cloud-limbosolutions-com
|
||||||
resources:
|
resources:
|
||||||
- global
|
- global
|
||||||
- nextcloud
|
#- nextcloud
|
||||||
- onlyoffice
|
#- backups
|
||||||
- whiteboard
|
#- onlyoffice
|
||||||
|
#- whiteboard
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
disableNameSuffixHash: true
|
disableNameSuffixHash: true
|
||||||
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
|
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
disableNameSuffixHash: true
|
disableNameSuffixHash: true
|
||||||
@@ -12,6 +11,9 @@ secretGenerator:
|
|||||||
- ./.env.d/nextcloud-mariadb.env
|
- ./.env.d/nextcloud-mariadb.env
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ./storage-limbosolutions-com
|
- storage-limbosolutions-com
|
||||||
- ./mariadb-deploy.yaml
|
- ./mariadb-deploy.yaml
|
||||||
|
- ./ingress-web-public.yaml
|
||||||
|
- ./ingress-web.yaml
|
||||||
|
- ./network-policies.yaml
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: cilium.io/v2
|
||||||
|
kind: CiliumNetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: allow-traefik-to-nextcloud-ingress
|
||||||
|
spec:
|
||||||
|
endpointSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: nextcloud
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Allow Traefik (internal and public) to reach nextcloud web port
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
- fromEndpoints:
|
||||||
|
- matchLabels:
|
||||||
|
app.kubernetes.io/name: traefik
|
||||||
|
matchExpressions:
|
||||||
|
- key: k8s:io.kubernetes.pod.namespace
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- traefik
|
||||||
|
- traefik-public
|
||||||
|
toPorts:
|
||||||
|
- ports:
|
||||||
|
- port: "80"
|
||||||
|
|
||||||
|
protocol: TCP
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
**
|
||||||
|
!.gitignore
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: onlyoffice-web-public
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: traefik-public
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
- match: Host(`office.limbosolutions.com`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: onlyoffice
|
||||||
|
port: 80
|
||||||
|
middlewares:
|
||||||
|
- name: onlyoffice-headers
|
||||||
|
- name: onlyoffice-security-headers
|
||||||
|
- name: rate-limit
|
||||||
|
|
||||||
|
tls:
|
||||||
|
secretName: office-limbosolutions-com-tls
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: office-limbosolutions-com
|
name: onlyoffice-web
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
kubernetes.io/ingress.class: traefik
|
kubernetes.io/ingress.class: traefik
|
||||||
spec:
|
spec:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- websecure
|
- websecure
|
||||||
- public-https
|
|
||||||
routes:
|
routes:
|
||||||
- match: Host(`office.limbosolutions.com`)
|
- match: Host(`office.limbosolutions.com`)
|
||||||
kind: Rule
|
kind: Rule
|
||||||
@@ -8,9 +8,11 @@ secretGenerator:
|
|||||||
|
|
||||||
generatorOptions:
|
generatorOptions:
|
||||||
disableNameSuffixHash: true
|
disableNameSuffixHash: true
|
||||||
namespace: cloud-limbosolutions-com
|
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ./deployment.yaml
|
- ./deployment.yaml
|
||||||
- ./service.yaml
|
- ./service.yaml
|
||||||
- ./pvc.yaml
|
- ./pvc.yaml
|
||||||
|
- ./middlewares.yaml
|
||||||
|
- ./network-policies.yaml
|
||||||
|
- ./ingress-web-public.yaml
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: cilium.io/v2
|
||||||
|
kind: CiliumNetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: allow-traefik-to-onlyoffice-ingress
|
||||||
|
spec:
|
||||||
|
endpointSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: onlyoffice
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Allow Traefik (internal and public) to reach onlyoffice web port
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
- fromEndpoints:
|
||||||
|
- matchLabels:
|
||||||
|
app.kubernetes.io/name: traefik
|
||||||
|
matchExpressions:
|
||||||
|
- key: k8s:io.kubernetes.pod.namespace
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- traefik
|
||||||
|
- traefik-public
|
||||||
|
toPorts:
|
||||||
|
- ports:
|
||||||
|
- port: "80"
|
||||||
|
|
||||||
|
protocol: TCP
|
||||||
|
---
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nextcloud-whiteboard
|
name: whiteboard
|
||||||
labels:
|
labels:
|
||||||
app: nextcloud-whiteboard
|
app: whiteboard
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: nextcloud-whiteboard
|
app: whiteboard
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: nextcloud-whiteboard
|
app: whiteboard
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: whiteboard-ws
|
- name: whiteboard-ws
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: whiteboard-web-public
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: traefik-public
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
tls:
|
||||||
|
secretName: cloud-limbosolutions-com-tls
|
||||||
|
domains:
|
||||||
|
- main: cloud.limbosolutions.com
|
||||||
|
|
||||||
|
routes:
|
||||||
|
|
||||||
|
- match: Host(`cloud.limbosolutions.com`) && PathPrefix(`/whiteboard`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: whiteboard
|
||||||
|
port: 3002
|
||||||
|
middlewares:
|
||||||
|
- name: nextcloud-security-headers
|
||||||
|
- name: rate-limit
|
||||||
|
- name: nextcloud-deny-paths
|
||||||
|
- name: nextcloud-wellknown
|
||||||
|
- name: nextcloud-hostmeta
|
||||||
|
- name: nextcloud-dav
|
||||||
|
- name: strip-whiteboard
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: whiteboard-web
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: traefik
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
tls:
|
||||||
|
secretName: cloud-limbosolutions-com-tls
|
||||||
|
domains:
|
||||||
|
- main: cloud.limbosolutions.com
|
||||||
|
|
||||||
|
routes:
|
||||||
|
|
||||||
|
- match: Host(`cloud.limbosolutions.com`) && PathPrefix(`/whiteboard`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: whiteboard
|
||||||
|
port: 3002
|
||||||
|
middlewares:
|
||||||
|
- name: nextcloud-security-headers
|
||||||
|
- name: rate-limit
|
||||||
|
- name: nextcloud-deny-paths
|
||||||
|
- name: nextcloud-wellknown
|
||||||
|
- name: nextcloud-hostmeta
|
||||||
|
- name: nextcloud-dav
|
||||||
|
- name: strip-whiteboard
|
||||||
@@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
|
|
||||||
secretGenerator:
|
secretGenerator:
|
||||||
- name: nextcloud-whiteboard
|
- name: whiteboard
|
||||||
envs:
|
envs:
|
||||||
- ./.env.d/whiteboard.env
|
- ./.env.d/whiteboard.env
|
||||||
|
|
||||||
@@ -12,3 +12,7 @@ generatorOptions:
|
|||||||
resources:
|
resources:
|
||||||
- ./deployment.yaml
|
- ./deployment.yaml
|
||||||
- ./service.yaml
|
- ./service.yaml
|
||||||
|
- ./middlewares.yaml
|
||||||
|
- ./network-policies.yaml
|
||||||
|
- ./ingress-web-public.yaml
|
||||||
|
- ./ingress-web.yaml
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: cilium.io/v2
|
||||||
|
kind: CiliumNetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: allow-traefik-to-whiteboard-ingress
|
||||||
|
spec:
|
||||||
|
endpointSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: nextcloud-whiteboard
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Allow Traefik (internal and public) to reach whiteboard ws
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
- fromEndpoints:
|
||||||
|
- matchLabels:
|
||||||
|
app.kubernetes.io/name: traefik
|
||||||
|
matchExpressions:
|
||||||
|
- key: k8s:io.kubernetes.pod.namespace
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- traefik
|
||||||
|
- traefik-public
|
||||||
|
toPorts:
|
||||||
|
- ports:
|
||||||
|
- port: "3002"
|
||||||
|
|
||||||
|
protocol: TCP
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: nextcloud-whiteboard
|
name: whiteboard
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: nextcloud-whiteboard
|
app: whiteboard
|
||||||
ports:
|
ports:
|
||||||
- name: ws
|
- name: ws
|
||||||
port: 3002
|
port: 3002
|
||||||
Reference in New Issue
Block a user