-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Manifest] Apply kustomize best practices to standalone manifest #3978
Changes from 4 commits
5f50110
67d5ef7
a64a518
4d83a58
5105154
01dd664
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kubeflow-pipelines-cache-deployer-sa | ||
name: kubeflow-pipelines-cache-deployer-sa |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: kubeflow | ||
|
||
resources: | ||
- namespace.yaml | ||
bases: | ||
- ../base/application/cluster-scoped | ||
- ../base/argo/cluster-scoped | ||
- ../base/pipeline/cluster-scoped | ||
- ../base/cache-deployer/cluster-scoped | ||
|
||
resources: | ||
- namespace.yaml | ||
|
||
# Used by Kustomize | ||
configMapGenerator: | ||
- name: pipeline-cluster-scoped-install-config | ||
env: params.env | ||
|
||
vars: | ||
- name: NAMESPACE | ||
objref: | ||
kind: ConfigMap | ||
name: pipeline-cluster-scoped-install-config | ||
apiVersion: v1 | ||
fieldref: | ||
fieldpath: data.namespace | ||
|
||
# NOTE: var name must be unique globally to allow composition of multiple kustomize | ||
# packages. Therefore, we added prefix `kfp-cluster-scoped-` to distinguish it from | ||
# others. | ||
- name: kfp-cluster-scoped-namespace | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wondering whether we just use "kfp-" prefix as it can already solve the concern of global conflict with other components. "kfp-cluster-sopced-namespace" would let me think on whether there is another namespace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, any other suggestions? I wasn't using |
||
objref: | ||
# cache deployer sa's metadata.namespace will be first transformed by namespace field in kustomization.yaml | ||
# so that we only need to change kustomization.yaml's namespace field for namespace customization. | ||
kind: ServiceAccount | ||
name: kubeflow-pipelines-cache-deployer-sa | ||
apiVersion: v1 | ||
fieldref: | ||
fieldpath: metadata.namespace | ||
configurations: | ||
- params.yaml | ||
- params.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: $(NAMESPACE) | ||
name: '$(kfp-cluster-scoped-namespace)' |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,3 @@ | |
varReference: | ||
- path: metadata/name | ||
kind: Namespace | ||
- path: subjects/namespace | ||
kind: ClusterRoleBinding |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
# !!! If you want to customize the namespace, | ||
# please also update sample/kustomization.yaml's namespace field to the same value | ||
namespace: kubeflow | ||
|
||
bases: | ||
# Or github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=1.0.0 | ||
- ../../cluster-scoped-resources | ||
|
||
# Change the value in params.env to yours. | ||
configMapGenerator: | ||
- name: pipeline-cluster-scoped-install-config | ||
env: params.env | ||
behavior: merge |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw in real deployment, the configmap name is pipeline-install-config-xxx. It has a strange post-fix, does it matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No , it won't cause any problems. kustomize adds the suffix automatically to both configmap name and references to it. So that it can support configmap rolling update (updating configmap requires all dependent pods to restart to pick up new changes -- therefore, by adding a suffix, when configmap content changes, all deployments referring to it will use a new configmap name, so they will restart those pods with new configmap.)
configMapKeyRef from a configmap will be preserved in deployment yaml in Kubernetes, that's more kubernetes native way of adding config to a deployment.
This is suggested in https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#command-line-substitution.