-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom authenticator support (#295)
* add custom authenticator support and example yaml * fix minor toolchain issues and update DEVELOPER_GUIDE.md
- Loading branch information
1 parent
3da75e9
commit 85f1cb1
Showing
9 changed files
with
1,943 additions
and
18 deletions.
There are no files selected for viewing
1,867 changes: 1,866 additions & 1 deletion
1,867
operator/charts/kit-operator/crds/control-plane-crd.yaml
Large diffs are not rendered by default.
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,37 @@ | ||
# To create this cluster, run: | ||
# * export KUBECONFIG=<management-cluster> | ||
# * export GUEST_CLUSTER_NAME="foobar" | ||
# * envsubst < custom-authenticator.yaml | kubectl --kubeconfig $KUBECONFIG apply -f - | ||
# * k certificate approve $(k get csr | grep "Pending" | awk '{print $1}') | ||
|
||
apiVersion: kit.k8s.sh/v1alpha1 | ||
kind: ControlPlane | ||
metadata: | ||
name: $GUEST_CLUSTER_NAME | ||
spec: | ||
master: | ||
apiServer: | ||
replicas: 3 | ||
authenticator: | ||
spec: | ||
containers: | ||
- name: aws-iam-authenticator | ||
image: public.ecr.aws/eks-distro/kubernetes-sigs/aws-iam-authenticator:v0.5.9-eks-1-19-22 | ||
securityContext: | ||
runAsUser: 10000 | ||
runAsGroup: 10000 | ||
args: | ||
- --backend-mode=MountedFile,EKSConfigMap | ||
# TODO: scope down permissions | ||
# There are 3 kubeconfigish flags for the authenticator: | ||
# * --kubeconfig -> this is configuring one direction communication from authenticator to kube-apiserver | ||
# * --generate-kubeconfig -> this is configuring communication from kube-apiserver to authenticator (this is the token file passed to kube-apiserver). | ||
# * --kubeconfig-pregenerated -> a boolean flag if we don't want the --kubeconfig flag to generate a new kubeconfig. | ||
- --kubeconfig=/var/aws-iam-authenticator/auth-to-k8s-kubeconfig/config | ||
volumeMounts: | ||
- mountPath: /var/aws-iam-authenticator/auth-to-k8s-kubeconfig/ | ||
name: auth-to-k8s-kubeconfig | ||
volumes: | ||
- secret: | ||
secretName: $GUEST_CLUSTER_NAME-kube-admin-config | ||
name: auth-to-k8s-kubeconfig |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
set -eux -o pipefail | ||
|
||
main() { | ||
tools | ||
|
@@ -11,7 +11,7 @@ tools() { | |
go install github.com/ahmetb/[email protected] | ||
go install github.com/fzipp/gocyclo/cmd/[email protected] | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
go install github.com/google/ko@v0.10.0 | ||
go install github.com/google/ko@v0.11.2 | ||
go install github.com/mikefarah/yq/[email protected] | ||
go install github.com/mitchellh/[email protected] | ||
go install github.com/onsi/ginkgo/[email protected] | ||
|
@@ -32,4 +32,4 @@ kubebuilder() { | |
find $KUBEBUILDER_ASSETS | ||
} | ||
|
||
main "$@" | ||
main "$@" |
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
5 changes: 5 additions & 0 deletions
5
operator/pkg/apis/controlplane/v1alpha1/zz_generated.deepcopy.go
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