Skip to content

WIP: Add Azure VAP #321

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
123 changes: 123 additions & 0 deletions openshift/infrastructure-components-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11023,3 +11023,126 @@ spec:
targetPort: webhook-server
selector:
cluster.x-k8s.io/provider: infrastructure-azure
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azurecluster
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- '*'
operations:
- DELETE
resources:
- azureclusters
paramKind:
apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azurecluster
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azurecluster
validationActions:
- Deny
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azureclusteridentities
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- '*'
operations:
- DELETE
resources:
- azureclusteridentities
paramKind:
apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azureclusteridentities
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azureclusteridentities
validationActions:
- Deny
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azureclustersecrets
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups:
- ""
apiVersions:
- '*'
operations:
- DELETE
resources:
- secret
resourceNames:
- capz-manager-bootstrap-credentials
- capz-manager-cluster-credential
paramKind:
apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azureclustersecrets
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azureclustersecrets
validationActions:
- Deny
Original file line number Diff line number Diff line change
Expand Up @@ -11025,6 +11025,129 @@ data:
targetPort: webhook-server
selector:
cluster.x-k8s.io/provider: infrastructure-azure
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azurecluster
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- '*'
operations:
- DELETE
resources:
- azureclusters
paramKind:
apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azurecluster
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azurecluster
validationActions:
- Deny
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azureclusteridentities
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- '*'
operations:
- DELETE
resources:
- azureclusteridentities
paramKind:
apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azureclusteridentities
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azureclusteridentities
validationActions:
- Deny
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azureclustersecrets
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups:
- ""
apiVersions:
- '*'
operations:
- DELETE
resources:
- secrets
resourceNames:
- capz-manager-bootstrap-credentials
- capz-manager-cluster-credential
paramKind:
apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azureclustersecrets
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azureclustersecrets
validationActions:
- Deny
kind: ConfigMap
metadata:
annotations:
Expand Down