mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-13 19:28:55 +00:00
Cleanup kustomizations (#2274)
- Remove dead newName specification - Un-hardcode namespace from resources - Create 'bundle' kustomization that keeps namespace hardcoding This should be used (as a base) to generate static manifests - Turn 'release' directory into kustomization that is only place with version numbers Signed-off-by: James Callahan <jamescallahan@bitgo.com>
This commit is contained in:
parent
4990122f1c
commit
95786f5033
15 changed files with 55 additions and 31 deletions
2
Makefile
2
Makefile
|
@ -219,7 +219,7 @@ kustomize-crd:
|
|||
# guidance https://github.com/kyverno/kyverno/wiki/Generate-a-Release
|
||||
release:
|
||||
kustomize build ./definitions > ./definitions/install.yaml
|
||||
kustomize build ./definitions > ./definitions/release/install.yaml
|
||||
kustomize build ./definitions/release > ./definitions/release/install.yaml
|
||||
|
||||
release-notes:
|
||||
@bash -c 'while IFS= read -r line ; do if [[ "$$line" == "## "* && "$$line" != "## $(VERSION)" ]]; then break ; fi; echo "$$line"; done < "CHANGELOG.md"' \
|
||||
|
|
13
definitions/bundle/kustomization.yaml
Normal file
13
definitions/bundle/kustomization.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: kyverno
|
||||
|
||||
transformers:
|
||||
- labels.yaml
|
||||
|
||||
resources:
|
||||
- ../crds/
|
||||
- ../manifest/
|
||||
- ../k8s-resource/
|
||||
- namespace.yaml
|
|
@ -9,7 +9,6 @@ labels:
|
|||
app.kubernetes.io/managed-by: Kustomize
|
||||
app.kubernetes.io/name: kyverno
|
||||
app.kubernetes.io/part-of: kyverno
|
||||
app.kubernetes.io/version: v1.4.2
|
||||
fieldSpecs:
|
||||
- path: metadata/labels
|
||||
create: true
|
|
@ -1,6 +1,9 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: kyverno
|
||||
|
||||
resources:
|
||||
- ../crds/
|
||||
- ../k8s-resource/
|
||||
- ../k8s-resource/
|
||||
- namespace.yaml
|
||||
|
|
7
definitions/debug/namespace.yaml
Normal file
7
definitions/debug/namespace.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
kind: Namespace
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
labels:
|
||||
app: kyverno
|
||||
name: kyverno
|
|
@ -12,7 +12,6 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -27,7 +26,6 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -42,7 +40,6 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -57,7 +54,6 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -72,7 +68,6 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -87,4 +82,3 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
|
@ -8,4 +8,3 @@ metadata:
|
|||
labels:
|
||||
app: kyverno
|
||||
name: init-config
|
||||
namespace: kyverno
|
||||
|
|
|
@ -5,6 +5,5 @@ resources:
|
|||
- ./clusterroles.yaml
|
||||
- ./clusterrolebindings.yaml
|
||||
- ./configmap.yaml
|
||||
- ./namespace.yaml
|
||||
- ./service.yaml
|
||||
- ./serviceaccount.yaml
|
||||
- ./serviceaccount.yaml
|
||||
|
|
|
@ -4,7 +4,6 @@ kind: Service
|
|||
metadata:
|
||||
labels:
|
||||
app: kyverno
|
||||
namespace: kyverno
|
||||
name: kyverno-svc
|
||||
spec:
|
||||
ports:
|
||||
|
@ -21,7 +20,6 @@ kind: Service
|
|||
metadata:
|
||||
labels:
|
||||
app: kyverno
|
||||
namespace: kyverno
|
||||
name: kyverno-svc-metrics
|
||||
spec:
|
||||
ports:
|
||||
|
@ -31,4 +29,4 @@ spec:
|
|||
selector:
|
||||
app: kyverno
|
||||
# do not remove
|
||||
app.kubernetes.io/name: kyverno
|
||||
app.kubernetes.io/name: kyverno
|
||||
|
|
|
@ -5,4 +5,3 @@ metadata:
|
|||
labels:
|
||||
app: kyverno
|
||||
name: kyverno-service-account
|
||||
namespace: kyverno
|
15
definitions/kustomization.yaml
Executable file → Normal file
15
definitions/kustomization.yaml
Executable file → Normal file
|
@ -1,18 +1,5 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
transformers:
|
||||
- labels.yaml
|
||||
|
||||
resources:
|
||||
- ./crds/
|
||||
- ./manifest/
|
||||
- ./k8s-resource/
|
||||
|
||||
images:
|
||||
- name: ghcr.io/kyverno/kyverno
|
||||
newName: ghcr.io/kyverno/kyverno
|
||||
newTag: v1.4.2
|
||||
- name: ghcr.io/kyverno/kyvernopre
|
||||
newName: ghcr.io/kyverno/kyvernopre
|
||||
newTag: v1.4.2
|
||||
- ./release
|
||||
|
|
|
@ -6,7 +6,6 @@ metadata:
|
|||
app: kyverno
|
||||
# do not remove
|
||||
app.kubernetes.io/name: kyverno
|
||||
namespace: kyverno
|
||||
name: kyverno
|
||||
spec:
|
||||
selector:
|
||||
|
|
14
definitions/release/kustomization.yaml
Executable file
14
definitions/release/kustomization.yaml
Executable file
|
@ -0,0 +1,14 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../bundle/
|
||||
|
||||
transformers:
|
||||
- labels.yaml
|
||||
|
||||
images:
|
||||
- name: ghcr.io/kyverno/kyverno
|
||||
newTag: v1.4.2
|
||||
- name: ghcr.io/kyverno/kyvernopre
|
||||
newTag: v1.4.2
|
13
definitions/release/labels.yaml
Normal file
13
definitions/release/labels.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
apiVersion: builtin
|
||||
kind: LabelTransformer
|
||||
metadata:
|
||||
name: labelTransformer
|
||||
labels:
|
||||
app.kubernetes.io/version: v1.4.2
|
||||
fieldSpecs:
|
||||
- path: metadata/labels
|
||||
create: true
|
||||
- kind: Deployment
|
||||
path: spec/template/metadata/labels
|
||||
create: true
|
Loading…
Add table
Reference in a new issue