No description
Find a file
2024-03-06 15:27:17 +01:00
.gitlab/agents reformat common-services 2024-02-29 09:46:37 +01:00
examples Modification nom de domaine final 2023-02-07 08:55:37 +00:00
flux/staging/flux-system reformat common-services 2024-02-28 17:08:16 +01:00
manifests manage helm app versions 2024-03-06 15:27:17 +01:00
namespaces reformat common-services 2024-02-28 17:08:16 +01:00
secrets manage helm app versions 2024-03-06 14:52:57 +01:00
tmp-common-services manage helm app versions 2024-03-06 12:01:26 +01:00
.gitlab-ci.yml manage helm app versions 2024-03-06 12:05:20 +01:00
README.md manage helm app versions 2024-03-05 15:27:27 +01:00

Cluster K8s

Init flux agent

Install flux CLI

curl -s https://fluxcd.io/install.sh | sudo bash 

Create flux agent for staging

You need to be connected in dev-cluster-k8s by kubeconfig.

export GITLAB_TOKEN=<cluster-k8s-flux-token-api>
flux bootstrap gitlab \
--hostname=lab.s-web.fr \
--owner=ldc-web \
--repository=cluster-k8s \
--branch=deploy/staging \
--path=flux/staging \
--deploy-token-auth

Then you need to add a Kustomization resource for each root folder you want to synchronize with the cluster at the end of the file flux/staging/gotk-sync.yaml. For staging environment:

---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: namespaces
  namespace: flux-system
spec:
  interval: 1m0s
  path: ./namespaces
  prune: true
  sourceRef:
    kind: GitRepository
    name: cluster-k8s
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: common-services
  namespace: flux-system
spec:
  interval: 1m0s
  path: ./manifests/common-services
  prune: true
  sourceRef:
    kind: GitRepository
    name: cluster-k8s

Create flux agent for production

You need to be connected in cluster-k8s by kubeconfig.

export GITLAB_TOKEN=<cluster-k8s-flux-token-api>
flux bootstrap gitlab \
--hostname=lab.s-web.fr \
--owner=ldc-web \
--repository=cluster-k8s \
--branch=deploy/production \
--path=flux/production \
--deploy-token-auth

Then the resources to add in flux/production/gotk-sync.yaml for production environment:

---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: namespaces
  namespace: flux-system
spec:
  interval: 1m0s
  path: ./namespaces
  prune: true
  sourceRef:
    kind: GitRepository
    name: cluster-k8s
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: common-services
  namespace: flux-system
spec:
  interval: 1m0s
  path: ./manifests
  prune: true
  sourceRef:
    kind: GitRepository
    name: cluster-k8s

Note that in production we follow the entire folder ./manifests to deploy services as velero or custom services for ldc web.