Skip to content

Commit

Permalink
feat: add example provider config
Browse files Browse the repository at this point in the history
* reformat code

Signed-off-by: patst <[email protected]>
  • Loading branch information
patst committed Feb 28, 2024
1 parent 5a2cc79 commit f08feef
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
name: kubernetes-provider
spec:
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: cluster-config
key: kubeconfig
identity:
type: AzureWorkloadIdentityCredentials
source: Secret
secretRef:
name: azure-credentials
namespace: crossplane-system
key: credentials.json
---
apiVersion: v1
kind: Secret
metadata:
name: azure-credentials
namespace: crossplane-system
stringData:
# serverId hardcoded to AKS ID, see https://azure.github.io/kubelogin/concepts/aks.html#azure-kubernetes-service-aad-server
credentials.json: |
{
"tenantId": "<aad-tenant-id>",
"serverId": "6dae42f8-4368-4678-94ff-3960e28e3630",
"clientId": "<client-id>",
"federatedTokenFile": "/var/run/secrets/azure/tokens/azure-identity-token",
"authorityHost": "https://login.microsoftonline.com/"
}
3 changes: 2 additions & 1 deletion internal/clients/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package azure
import (
"context"
"encoding/json"
apisv1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/v1alpha1"
"net/http"

"github.com/Azure/kubelogin/pkg/token"
"github.com/pkg/errors"
"github.com/spf13/pflag"
"k8s.io/client-go/rest"

apisv1alpha1 "github.com/crossplane-contrib/provider-kubernetes/apis/v1alpha1"
)

// Credentials Secret content is a json whose keys are below.
Expand Down

0 comments on commit f08feef

Please sign in to comment.