Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add configsync #4

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions nephio-configsync/Kptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kpt.dev/v1
kind: Kptfile
metadata:
name: nephio-configsync
annotations:
config.kubernetes.io/local-config: "true"
info:
site: https://nephio.org
description: Package for the ConfigSync on Nephio workload clusters.
pipeline:
mutators:
- image: gcr.io/kpt-fn/apply-replacements:v0.1.1
configPath: apply-replacements.yaml
21 changes: 21 additions & 0 deletions nephio-configsync/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# nephio-configsync

## Description
Package for the ConfigSync on Nephio workload clusters.

To use this package in your own environment, you should modify the `repo` field
in the `rootsync.yaml` file to point to your GitHub user. The repo name itself
will be changed during `kpt fn render` to point to the repo with the same name
as the package instance.

Thus, you could clone this package from the upstream Nephio repository, and
modify the `repo` value, then store it in your organizational repository and
consume it from there in the future. This would eliminate any need to customize
package on each instantiation. If you are using a different type of repository
with a different `repo` URL format, you may also have to adjust the
configuration of in `apply-replacements.yaml`.

This package is also configured for no Git authentication or authorization. See
the Config Sync
[documentation](https://cloud.google.com/anthos-config-management/docs/how-to/installing-config-sync#git-creds-secret)
for details.
19 changes: 19 additions & 0 deletions nephio-configsync/apply-replacements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: fn.kpt.dev/v1alpha1
kind: ApplyReplacements
metadata:
name: replacements-fn-config
replacements:
- source:
kind: ConfigMap
name: kptfile.kpt.dev
fieldPath: data.name
targets:
- select:
group: configsync.gke.io
kind: RootSync
name: nephio-workload-cluster-sync
fieldPaths:
- spec.git.repo
options:
delimiter: /
index: 4
459 changes: 459 additions & 0 deletions nephio-configsync/config-management-operator.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions nephio-configsync/configsync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: configmanagement.gke.io/v1
kind: ConfigManagement
metadata:
name: config-management
annotations:
config.kubernetes.io/depends-on: apiextensions.k8s.io/CustomResourceDefinition/configmanagements.configmanagement.gke.io
spec:
enableMultiRepo: true
8 changes: 8 additions & 0 deletions nephio-configsync/package-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: kptfile.kpt.dev
annotations:
config.kubernetes.io/local-config: "true"
data:
name: example
13 changes: 13 additions & 0 deletions nephio-configsync/rootsync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: configsync.gke.io/v1beta1
kind: RootSync
metadata:
name: nephio-workload-cluster-sync
namespace: config-management-system
annotations:
config.kubernetes.io/depends-on: apiextensions.k8s.io/CustomResourceDefinition/rootsyncs.configsync.gke.io
spec:
sourceFormat: unstructured
git:
repo: https://github.com/nephio-johnbelamaric/test-edge-01
branch: main
auth: none