-
Notifications
You must be signed in to change notification settings - Fork 0
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
Deploy policies as an app #6
+89
−0
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ac4a771
Add structure and CI for app packaging
stone-z e09f033
Update CircleCI order
stone-z fe90fc3
Touch circle
stone-z 4daaeeb
Set kustomize version
stone-z e2a5b09
Update kustomize install
stone-z 9a66358
Use kustomize v3@latest
stone-z 6c28a10
Try kustomize v4
stone-z da53f08
Try v4 latest
stone-z 8a37de2
Make clusterpolicies a go module
stone-z 936cc9f
Remove kustomize plugins
stone-z 9d435a0
Empty kustomize for kvm
stone-z a3a7fc8
Set architect context
stone-z d2c080b
Use control plane test catalog
stone-z dcb319f
Push common to catalog
stone-z 31d1fec
Do not kustomize kyverno policies
stone-z 4b7d9d2
Revert test chart versions
stone-z 4d32e3c
Test skip lint orb (#8)
stone-z 9967c70
Clean up circleci config
stone-z 5dd80e2
Remove go module packaging
stone-z c7efdd6
Update Kubeadm policies
stone-z 8bb726c
Newlines
stone-z 6d0c7d3
Merge branch 'main' into make-app
stone-z File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add structure and CI for app packaging
commit ac4a77191e07d92af6b85ce503f51954c679f852
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
|
||
version: 2.1 | ||
|
||
orbs: | ||
architect: giantswarm/architect@2.4.2 | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: quay.io/giantswarm/architect | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install kustomize | ||
command: | | ||
CGO_ENABLED=0 go install sigs.k8s.io/kustomize/kustomize/v3 | ||
# - run: | ||
# name: Install releaseNotesURLTransformer kustomize plugin | ||
# command: | | ||
# CGO_ENABLED=0 go get github.com/giantswarm/kustomize-plugin-releasenotesurlannotationtransformer@v0.2.0 | ||
# mkdir -p "$PLUGIN_PATH" | ||
# cp /go/bin/kustomize-plugin-releasenotesurlannotationtransformer "$PLUGIN_PATH/releaseNotesURLAnnotationTransformer" | ||
# environment: | ||
# PLUGIN_PATH: "./kustomize/plugin/giantswarm.io/v1/releasenotesurlannotationtransformer" | ||
- run: | ||
name: Kustomize helm charts | ||
command: | | ||
export XDG_CONFIG_HOME=$(pwd) | ||
for i in aws azure common kvm vmware; do mkdir -p helm/policies-$i/templates; kustomize build --enable_alpha_plugins ./$i > helm/policies-$i/templates/policies.yaml; done | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- helm | ||
# validate: | ||
# docker: | ||
# - image: quay.io/giantswarm/architect | ||
# steps: | ||
# - checkout | ||
# - run: | ||
# name: Validate policies | ||
# command: CGO_ENABLED=0 go test ./... | ||
|
||
workflows: | ||
workflow: | ||
jobs: | ||
- validate | ||
- build | ||
# KVM | ||
- architect/push-to-app-catalog: | ||
name: push-policies-kvm-to-policies-catalog | ||
app_catalog: policies-test-catalog | ||
app_catalog_test: policies-test-catalog | ||
attach_workspace: true | ||
chart: policies-kvm | ||
explicit_allow_chart_name_mismatch: true | ||
on_tag: false | ||
requires: | ||
- build | ||
- validate | ||
# - architect/push-to-app-collection: | ||
# name: push-policies-to-kvm-app-collection | ||
# app_catalog: policies | ||
# app_name: policies-kvm | ||
# app_collection_repo: kvm-app-collection | ||
# requires: | ||
# - push-policies-kvm-to-policies-catalog | ||
# filters: | ||
# # Trigger the job on merge to master. | ||
# branches: | ||
# only: master | ||
# AWS | ||
- architect/push-to-app-catalog: | ||
name: push-policies-aws-to-policies-catalog | ||
app_catalog: policies-test-catalog | ||
app_catalog_test: policies-test-catalog | ||
attach_workspace: true | ||
chart: policies-aws | ||
explicit_allow_chart_name_mismatch: true | ||
on_tag: false | ||
requires: | ||
- build | ||
- validate | ||
- push-policies-kvm-to-policies-catalog | ||
# - architect/push-to-app-collection: | ||
# name: push-policies-to-aws-app-collection | ||
# app_catalog: policies | ||
# app_name: policies-aws | ||
# app_collection_repo: aws-app-collection | ||
# requires: | ||
# - push-policies-aws-to-policies-catalog | ||
# # - push-policies-to-kvm-app-collection | ||
# filters: | ||
# # Trigger the job on merge to master. | ||
# branches: | ||
# only: master | ||
# Azure | ||
- architect/push-to-app-catalog: | ||
name: push-policies-azure-to-policies-catalog | ||
app_catalog: policies-test-catalog | ||
app_catalog_test: policies-test-catalog | ||
attach_workspace: true | ||
chart: policies-azure | ||
explicit_allow_chart_name_mismatch: true | ||
on_tag: false | ||
requires: | ||
- build | ||
- validate | ||
- push-policies-aws-to-policies-catalog | ||
# - architect/push-to-app-collection: | ||
# name: push-policies-to-azure-app-collection | ||
# app_catalog: policies | ||
# app_name: policies-azure | ||
# app_collection_repo: azure-app-collection | ||
# requires: | ||
# - push-policies-azure-to-policies-catalog | ||
# # - push-policies-to-aws-app-collection | ||
# filters: | ||
# # Trigger the job on merge to master. | ||
# branches: | ||
# only: master |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resources: | ||
- AWSCluster.yaml | ||
- AWSMachine.yaml | ||
- AWSMachineTemplate.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resources: | ||
- CAPI |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resources: | ||
- AzureCluster.yaml | ||
- AzureMachine.yaml | ||
- AzureMachineDeployment.yaml |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resources: | ||
- Cluster.yaml | ||
- ClusterResourceSet.yaml | ||
- ClusterResourceSetBinding.yaml | ||
- KubeadmConfig.yaml | ||
- KubeadmConfigTemplate.yaml | ||
- KubeadmControlplane.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
name: policies-aws | ||
version: [[ .Version ]] | ||
appVersion: master | ||
description: Giant Swarm policies for aws. | ||
home: https://github.com/giantswarm/clusterpolicies |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
name: policies-azure | ||
version: [[ .Version ]] | ||
appVersion: master | ||
description: Giant Swarm policies for azure. | ||
home: https://github.com/giantswarm/clusterpolicies |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
name: policies-common | ||
version: [[ .Version ]] | ||
appVersion: master | ||
description: Giant Swarm policies for all clusters. | ||
home: https://github.com/giantswarm/clusterpolicies |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
name: policies-kvm | ||
version: [[ .Version ]] | ||
appVersion: master | ||
description: Giant Swarm policies for kvm. | ||
home: https://github.com/giantswarm/clusterpolicies |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
name: policies-vmware | ||
version: [[ .Version ]] | ||
appVersion: master | ||
description: Giant Swarm policies for vmware. | ||
home: https://github.com/giantswarm/clusterpolicies |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resources: | ||
- VSphereCluster.yaml | ||
- VSphereMachine.yaml | ||
- VSphereMachineTemplate.yaml | ||
- VSphereVM.yaml |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need to prefix everything with
policies
? Especially for folders it seems redundant as the repo is already calledclusterpolicies
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.
In places where the name is actually used I think it will make more sense. Like with opsctl it would currently be
opsctl deploy -i <whatever> policies-kvm
. I tried to keep this similar to thereleases
structureThere 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 understand that - but the folders in
releases
also don't have a prefix. Maybe I am missing something.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.
The folders for the actual helm charts do https://github.com/giantswarm/releases/tree/master/helm
The outer folders are
kustomized
in, which we can't do withClusterPolicy
CRs because it alphabetizes things and re-quotes strings which break kyverno