-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding cluster principal and credentails prvider
- Loading branch information
1 parent
27f33d5
commit 045fad3
Showing
27 changed files
with
1,082 additions
and
18 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha3 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:path=azureclusterprincipals,scope=Namespaced,categories=cluster-api | ||
// +kubebuilder:storageversion | ||
|
||
// AzureClusterPrincipal represents a reference to an Azure access key ID and | ||
// secret access key, stored in a secret. | ||
type AzureClusterPrincipal struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec for this AzureClusterPrincipalSpec. | ||
Spec AzureClusterPrincipalSpec `json:"spec,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// AzureClusterPrincipalList contains a list of AzureClusterPrincipal | ||
type AzureClusterPrincipalList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []AzureClusterPrincipal `json:"items"` | ||
} | ||
|
||
// AzureClusterPrincipalSpec defines the fileds of the Azure cluster principal | ||
type AzureClusterPrincipalSpec struct { | ||
Name string `json:"name"` | ||
// Reference to a secret containing the credentials. The secret should | ||
// contain the following data keys: | ||
// tenantID | ||
// clientID | ||
// clientSecret | ||
SecretRef corev1.SecretReference `json:"secretRef"` | ||
// AllowedNamespaces is a selector of namespaces that AzureClusters can | ||
// use this ClusterPrincipal from. This is a standard Kubernetes LabelSelector, | ||
// a label query over a set of resources. The result of matchLabels and | ||
// matchExpressions are ANDed. Controllers must not support AzureClusters in | ||
// namespaces outside this selector. | ||
// | ||
// An empty selector (default) indicates that AzureClusters can use this | ||
// AzureClusterPrincipal from any namespace. This field is intentionally not a | ||
// pointer because the nil behavior (no namespaces) is undesirable here. | ||
// | ||
// +optional | ||
AllowedNamespaces metav1.LabelSelector `json:"allowedNamespaces"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&AzureClusterPrincipal{}, &AzureClusterPrincipalList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.