use flux filename instead of gotk

Signed-off-by: Rémy Léone <rleone@scaleway.com>
pull/4205/head
Rémy Léone 2 years ago
parent 1730f3c46b
commit 7e52163c63

@ -136,7 +136,7 @@ jobs:
mkdir -p ./ghcr.io/flux-system mkdir -p ./ghcr.io/flux-system
flux install --registry=ghcr.io/fluxcd \ flux install --registry=ghcr.io/fluxcd \
--components-extra=image-reflector-controller,image-automation-controller \ --components-extra=image-reflector-controller,image-automation-controller \
--export > ./ghcr.io/flux-system/gotk-components.yaml --export > ./ghcr.io/flux-system/flux-components.yaml
cd ./ghcr.io && flux push artifact \ cd ./ghcr.io && flux push artifact \
oci://ghcr.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \ oci://ghcr.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
@ -148,7 +148,7 @@ jobs:
mkdir -p ./docker.io/flux-system mkdir -p ./docker.io/flux-system
flux install --registry=docker.io/fluxcd \ flux install --registry=docker.io/fluxcd \
--components-extra=image-reflector-controller,image-automation-controller \ --components-extra=image-reflector-controller,image-automation-controller \
--export > ./docker.io/flux-system/gotk-components.yaml --export > ./docker.io/flux-system/flux-components.yaml
cd ./docker.io && flux push artifact \ cd ./docker.io && flux push artifact \
oci://docker.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \ oci://docker.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \

@ -127,7 +127,7 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
{ {
APIGroup: "rbac.authorization.k8s.io", APIGroup: "rbac.authorization.k8s.io",
Kind: "User", Kind: "User",
Name: fmt.Sprintf("gotk:%s:reconciler", ns), Name: fmt.Sprintf("flux:%s:reconciler", ns),
}, },
{ {
Kind: "ServiceAccount", Kind: "ServiceAccount",

@ -40,7 +40,7 @@ type statusable interface {
// oldConditions represents the deprecated API which is sunsetting. // oldConditions represents the deprecated API which is sunsetting.
type oldConditions interface { type oldConditions interface {
// this is usually implemented by GOTK API objects because it's used by pkg/apis/meta // this is usually implemented by flux API objects because it's used by pkg/apis/meta
GetStatusConditions() *[]metav1.Condition GetStatusConditions() *[]metav1.Condition
} }

@ -152,7 +152,7 @@ data:
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})", "expr": "count(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"

@ -68,7 +68,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})", "expr": "count(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"

@ -85,7 +85,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})", "expr": "count(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -142,7 +142,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "sum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"})", "expr": "sum(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -203,7 +203,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"})", "expr": "count(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"})\n-\nsum(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -260,7 +260,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "sum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"})", "expr": "sum(flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -324,7 +324,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)", "expr": "sum(rate(flux_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)\n/\n sum(rate(flux_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)",
"interval": "", "interval": "",
"legendFormat": "{{kind}}", "legendFormat": "{{kind}}",
"refId": "A" "refId": "A"
@ -388,7 +388,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind)", "expr": "sum(rate(flux_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind)\n/\n sum(rate(flux_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind)",
"interval": "", "interval": "",
"legendFormat": "{{kind}}", "legendFormat": "{{kind}}",
"refId": "A" "refId": "A"
@ -496,7 +496,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"}", "expr": "flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"}",
"format": "table", "format": "table",
"instant": true, "instant": true,
"interval": "", "interval": "",
@ -624,7 +624,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}", "expr": "flux_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}",
"format": "table", "format": "table",
"instant": true, "instant": true,
"interval": "", "interval": "",
@ -735,7 +735,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)", "expr": "sum(rate(flux_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)\n/\n sum(rate(flux_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "{{kind}}/{{name}}", "legendFormat": "{{kind}}/{{name}}",
@ -835,7 +835,7 @@
"targets": [ "targets": [
{ {
"exemplar": true, "exemplar": true,
"expr": "sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)", "expr": "sum(rate(flux_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)\n/\n sum(rate(flux_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|OCIRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "{{kind}}/{{name}}", "legendFormat": "{{kind}}/{{name}}",
@ -904,7 +904,7 @@
] ]
}, },
"datasource": "$DS_PROMETHEUS", "datasource": "$DS_PROMETHEUS",
"definition": "label_values(gotk_reconcile_condition, namespace)", "definition": "label_values(flux_reconcile_condition, namespace)",
"description": null, "description": null,
"error": null, "error": null,
"hide": 0, "hide": 0,
@ -914,7 +914,7 @@
"name": "operator_namespace", "name": "operator_namespace",
"options": [], "options": [],
"query": { "query": {
"query": "label_values(gotk_reconcile_condition, namespace)", "query": "label_values(flux_reconcile_condition, namespace)",
"refId": "StandardVariableQuery" "refId": "StandardVariableQuery"
}, },
"refresh": 2, "refresh": 2,
@ -940,7 +940,7 @@
] ]
}, },
"datasource": "$DS_PROMETHEUS", "datasource": "$DS_PROMETHEUS",
"definition": "label_values(gotk_reconcile_condition, exported_namespace)", "definition": "label_values(flux_reconcile_condition, exported_namespace)",
"description": null, "description": null,
"error": null, "error": null,
"hide": 0, "hide": 0,
@ -950,7 +950,7 @@
"name": "namespace", "name": "namespace",
"options": [], "options": [],
"query": { "query": {
"query": "label_values(gotk_reconcile_condition, exported_namespace)", "query": "label_values(flux_reconcile_condition, exported_namespace)",
"refId": "StandardVariableQuery" "refId": "StandardVariableQuery"
}, },
"refresh": 2, "refresh": 2,

@ -52,7 +52,7 @@ func MakeDefaultOptions() Options {
LogLevel: "info", LogLevel: "info",
BaseURL: "https://github.com/fluxcd/flux2/releases", BaseURL: "https://github.com/fluxcd/flux2/releases",
NotificationController: "notification-controller", NotificationController: "notification-controller",
ManifestFile: "gotk-components.yaml", ManifestFile: "flux-components.yaml",
Timeout: time.Minute, Timeout: time.Minute,
TargetPath: "", TargetPath: "",
ClusterDomain: "cluster.local", ClusterDomain: "cluster.local",

@ -43,7 +43,7 @@ func MakeDefaultOptions() Options {
Namespace: "flux-system", Namespace: "flux-system",
Branch: "main", Branch: "main",
Secret: "flux-system", Secret: "flux-system",
ManifestFile: "gotk-sync.yaml", ManifestFile: "flux-sync.yaml",
TargetPath: "", TargetPath: "",
} }
} }

@ -142,8 +142,8 @@ Apply a `kustomize` patch which prevents the use of HTTP connections:
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- gotk-components.yaml - flux-components.yaml
- gotk-sync.yaml - flux-sync.yaml
patches: patches:
- patch: | - patch: |
- op: add - op: add

@ -143,8 +143,8 @@ func installFlux(ctx context.Context, kubeClient client.Client, kubeconfigPath,
kustomizeYaml := ` kustomizeYaml := `
resources: resources:
- gotk-components.yaml - flux-components.yaml
- gotk-sync.yaml - flux-sync.yaml
patchesStrategicMerge: patchesStrategicMerge:
- |- - |-
apiVersion: apps/v1 apiVersion: apps/v1
@ -178,8 +178,8 @@ patchesStrategicMerge:
files := make(map[string]io.Reader) files := make(map[string]io.Reader)
files["clusters/e2e/flux-system/kustomization.yaml"] = strings.NewReader(kustomizeYaml) files["clusters/e2e/flux-system/kustomization.yaml"] = strings.NewReader(kustomizeYaml)
files["clusters/e2e/flux-system/gotk-components.yaml"] = strings.NewReader("") files["clusters/e2e/flux-system/flux-components.yaml"] = strings.NewReader("")
files["clusters/e2e/flux-system/gotk-sync.yaml"] = strings.NewReader("") files["clusters/e2e/flux-system/flux-sync.yaml"] = strings.NewReader("")
err = commitAndPushAll(repo, files, defaultBranch) err = commitAndPushAll(repo, files, defaultBranch)
if err != nil { if err != nil {
return fmt.Errorf("error committing and pushing manifests: %w", err) return fmt.Errorf("error committing and pushing manifests: %w", err)

@ -12,14 +12,14 @@ import (
func main() { func main() {
ks := "test-cluster/flux-system/kustomization.yaml" ks := "test-cluster/flux-system/kustomization.yaml"
patchName := "test-cluster/flux-system/gotk-patches.yaml" patchName := "test-cluster/flux-system/flux-patches.yaml"
ksContent := `apiVersion: kustomize.config.k8s.io/v1beta1 ksContent := `apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- gotk-components.yaml - flux-components.yaml
- gotk-sync.yaml - flux-sync.yaml
patches: patches:
- path: gotk-patches.yaml - path: flux-patches.yaml
target: target:
kind: Deployment` kind: Deployment`
patchContent := `apiVersion: apps/v1 patchContent := `apiVersion: apps/v1

Loading…
Cancel
Save