Skip to content

Commit

Permalink
azure AD identity support for AzureAD clusters
Browse files Browse the repository at this point in the history
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
  • Loading branch information
erhancagirici committed Dec 5, 2023
1 parent 2898887 commit 8db230f
Show file tree
Hide file tree
Showing 23 changed files with 742 additions and 760 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ GO111MODULE = on
# ====================================================================================
# Setup Kubernetes tools

UP_VERSION = v0.13.0
UP_VERSION = v0.21.0
UP_CHANNEL = stable
KIND_NODE_IMAGE_TAG ?= v1.24.0
USE_HELM3 = true
Expand Down
1 change: 0 additions & 1 deletion apis/release/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 10 additions & 16 deletions apis/release/v1alpha1/zz_generated.managed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/release/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 10 additions & 16 deletions apis/release/v1beta1/zz_generated.managed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion apis/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ type IdentityType string
// Supported identity types.
const (
IdentityTypeGoogleApplicationCredentials = "GoogleApplicationCredentials"

IdentityTypeAzurePrincipalCredentials = "AzurePrincipalCredentials"
)

// Identity used to authenticate.
type Identity struct {
// Type of identity.
// +kubebuilder:validation:Enum=GoogleApplicationCredentials
// +kubebuilder:validation:Enum=GoogleApplicationCredentials;AzurePrincipalCredentials
Type IdentityType `json:"type"`

ProviderCredentials `json:",inline"`
Expand Down
1 change: 0 additions & 1 deletion apis/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"path/filepath"
"time"

"sigs.k8s.io/controller-runtime/pkg/cache"

"github.com/crossplane/crossplane-runtime/pkg/controller"
"github.com/crossplane/crossplane-runtime/pkg/feature"
"github.com/crossplane/crossplane-runtime/pkg/ratelimiter"
Expand Down Expand Up @@ -67,7 +69,9 @@ func main() {
kingpin.FatalIfError(err, "Cannot get API server rest config")

mgr, err := ctrl.NewManager(ratelimiter.LimitRESTConfig(cfg, *maxReconcileRate), ctrl.Options{
SyncPeriod: syncInterval,
Cache: cache.Options{
SyncPeriod: syncInterval,
},

// controller-runtime uses both ConfigMaps and Leases for leader
// election by default. Leases expire after 15 seconds, with a
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: helm.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: helm-provider
spec:
credentials:
source: Secret
secretRef:
name: cluster-config
namespace: crossplane-system
key: kubeconfig
identity:
type: AzurePrincipalCredentials
source: Secret
secretRef:
name: azure-credentials
namespace: crossplane-system
key: credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: helm.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: helm-provider
spec:
credentials:
source: Secret
secretRef:
name: cluster-config
namespace: crossplane-system
key: kubeconfig
identity:
type: GoogleApplicationCredentials
source: Secret
secretRef:
name: gcp-credentials
namespace: crossplane-system
key: credentials.json
2 changes: 1 addition & 1 deletion examples/provider-config/provider-config-with-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
# secretRef:
# name: gcp-credentials
# namespace: crossplane-system
# key: credentials.json
# key: credentials.json
Loading

0 comments on commit 8db230f

Please sign in to comment.