generated from validatedpatterns/multicloud-gitops
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from mbaldessari/common-automatic-update
common automatic update
- Loading branch information
Showing
80 changed files
with
6,640 additions
and
1,615 deletions.
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
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
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
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
161 changes: 161 additions & 0 deletions
161
common/acm/templates/policies/private-repo-policies.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,161 @@ | ||
# We copy the vp-private-repo-credentials from the "openshift-gitops" namespace | ||
# to the "open-cluster-management" via the "private-hub-policy" | ||
# | ||
# Then we copy the secret from the "open-cluster-management" namespace to the | ||
# managed clusters "openshift-gitops" instance | ||
# | ||
# And we also copy the same secret to the namespaced argo's namespace | ||
{{ if $.Values.global.privateRepo }} | ||
{{ if .Values.clusterGroup.isHubCluster }} | ||
--- | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: Policy | ||
metadata: | ||
name: private-hub-policy | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
argocd.argoproj.io/compare-options: IgnoreExtraneous | ||
spec: | ||
remediationAction: enforce | ||
disabled: false | ||
policy-templates: | ||
- objectDefinition: | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: ConfigurationPolicy | ||
metadata: | ||
name: private-hub-config | ||
spec: | ||
remediationAction: enforce | ||
severity: medium | ||
namespaceSelector: | ||
include: | ||
- default | ||
object-templates: | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
kind: Secret | ||
apiVersion: v1 | ||
type: Opaque | ||
metadata: | ||
name: vp-private-repo-credentials | ||
namespace: open-cluster-management | ||
labels: | ||
argocd.argoproj.io/secret-type: repository | ||
data: '{{ `{{copySecretData "openshift-gitops" "vp-private-repo-credentials"}}` }}' | ||
--- | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: PlacementBinding | ||
metadata: | ||
name: private-hub-placement-binding | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
placementRef: | ||
name: private-hub-placement | ||
kind: PlacementRule | ||
apiGroup: apps.open-cluster-management.io | ||
subjects: | ||
- name: private-hub-policy | ||
kind: Policy | ||
apiGroup: policy.open-cluster-management.io | ||
--- | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: PlacementRule | ||
metadata: | ||
name: private-hub-placement | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
spec: | ||
clusterConditions: | ||
- status: 'True' | ||
type: ManagedClusterConditionAvailable | ||
clusterSelector: | ||
matchExpressions: | ||
- key: local-cluster | ||
operator: In | ||
values: | ||
- 'true' | ||
--- | ||
{{ end }}{{- /* if .Values.clusterGroup.isHubCluster */}} | ||
{{- range .Values.clusterGroup.managedClusterGroups }} | ||
{{- $group := . }} | ||
{{- if not .hostedArgoSites }} | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: Policy | ||
metadata: | ||
name: private-{{ .name }}-policy | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
argocd.argoproj.io/compare-options: IgnoreExtraneous | ||
spec: | ||
remediationAction: enforce | ||
disabled: false | ||
policy-templates: | ||
- objectDefinition: | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: ConfigurationPolicy | ||
metadata: | ||
name: private-{{ .name }}-config | ||
spec: | ||
remediationAction: enforce | ||
severity: medium | ||
namespaceSelector: | ||
include: | ||
- default | ||
object-templates: | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
kind: Secret | ||
apiVersion: v1 | ||
type: Opaque | ||
metadata: | ||
name: vp-private-repo-credentials | ||
namespace: openshift-gitops | ||
labels: | ||
argocd.argoproj.io/secret-type: repository | ||
data: '{{ `{{hub copySecretData "open-cluster-management" "vp-private-repo-credentials" hub}}` }}' | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
kind: Secret | ||
apiVersion: v1 | ||
type: Opaque | ||
metadata: | ||
name: vp-private-repo-credentials | ||
namespace: {{ $.Values.global.pattern }}-{{ .name }} | ||
labels: | ||
argocd.argoproj.io/secret-type: repository | ||
data: '{{ `{{hub copySecretData "open-cluster-management" "vp-private-repo-credentials" hub}}` }}' | ||
--- | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: PlacementBinding | ||
metadata: | ||
name: private-{{ .name }}-placement-binding | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
placementRef: | ||
name: private-{{ .name }}-placement | ||
kind: PlacementRule | ||
apiGroup: apps.open-cluster-management.io | ||
subjects: | ||
- name: private-{{ .name }}-policy | ||
kind: Policy | ||
apiGroup: policy.open-cluster-management.io | ||
--- | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: PlacementRule | ||
metadata: | ||
name: private-{{ .name }}-placement | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
spec: | ||
clusterConditions: | ||
- status: 'True' | ||
type: ManagedClusterConditionAvailable | ||
clusterSelector: | ||
matchExpressions: | ||
- key: local-cluster | ||
operator: NotIn | ||
values: | ||
- 'true' | ||
{{- end }}{{- /* if not .hostedArgoSites */}} | ||
{{- end }}{{- /* range .Values.clusterGroup.managedClusterGroups */}} | ||
{{- end }}{{- /* if $.Values.global.privateRepo */}} |
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
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
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
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
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
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
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
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
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
12 changes: 12 additions & 0 deletions
12
common/clustergroup/templates/plumbing/argocd-cmp-plugin-cms.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,12 @@ | ||
{{- range $cmp := $.Values.clusterGroup.argoCD.configManagementPlugins }} | ||
{{- if $cmp.pluginConfig }} | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: "argocd-cmp-{{ $cmp.name }}" | ||
namespace: {{ $.Values.global.pattern }}-{{ $.Values.clusterGroup.name }} | ||
data: | ||
"plugin.yaml": | {{ tpl $cmp.pluginConfig $ | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.