Skip to content
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

Rename hept.io authenticator to aws authenticator #5421

Merged
merged 2 commits into from
Jul 11, 2018
Merged
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
16 changes: 8 additions & 8 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ spec:
rbac: {}
```

## Heptio Authenticator for AWS
## AWS IAM Authenticator

If you want to turn on Heptio Authenticator for AWS, you can add this block
If you want to turn on AWS IAM Authenticator, you can add this block
to your cluster:

```
authentication:
heptio: {}
aws: {}
```

For example:
Expand All @@ -51,14 +51,14 @@ metadata:
name: cluster.example.com
spec:
authentication:
heptio: {}
aws: {}
authorization:
rbac: {}
```

Once the cluster is up you will need to create the heptio authenticator
Once the cluster is up you will need to create the AWS IAM authenticator
config as a config map. (This can also be done when boostrapping a cluster using addons)
For more details on heptio authenticator please visit (heptio/authenticator)[https://github.com/heptio/authenticator]
For more details on AWS IAM authenticator please visit (kubernetes-sigs/aws-iam-authenticator)[https://github.com/kubernetes-sigs/aws-iam-authenticator]
Example config:

```
Expand All @@ -67,9 +67,9 @@ apiVersion: v1
kind: ConfigMap
metadata:
namespace: kube-system
name: heptio-authenticator-aws
name: aws-iam-authenticator
labels:
k8s-app: heptio-authenticator-aws
k8s-app: aws-iam-authenticator
data:
config.yaml: |
# a unique-per-cluster identifier to prevent replay attacks
Expand Down
20 changes: 10 additions & 10 deletions nodeup/pkg/model/kube_apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,35 +158,35 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte
return nil
}

if b.Cluster.Spec.Authentication.Heptio != nil {
id := "heptio-authenticator-aws"
if b.Cluster.Spec.Authentication.Aws != nil {
id := "aws-iam-authenticator"
b.Cluster.Spec.KubeAPIServer.AuthenticationTokenWebhookConfigFile = fi.String(PathAuthnConfig)

{
caCertificate, err := b.NodeupModelContext.KeyStore.FindCert(fi.CertificateId_CA)
if err != nil {
return fmt.Errorf("error fetching Heptio Authentication CA certificate from keystore: %v", err)
return fmt.Errorf("error fetching AWS IAM Authentication CA certificate from keystore: %v", err)
}
if caCertificate == nil {
return fmt.Errorf("Heptio Authentication CA certificate %q not found", fi.CertificateId_CA)
return fmt.Errorf("AWS IAM Authentication CA certificate %q not found", fi.CertificateId_CA)
}

cluster := kubeconfig.KubectlCluster{
Server: "https://127.0.0.1:21362/authenticate",
}
context := kubeconfig.KubectlContext{
Cluster: "heptio-authenticator-aws",
Cluster: "aws-iam-authenticator",
User: "kube-apiserver",
}

cluster.CertificateAuthorityData, err = caCertificate.AsBytes()
if err != nil {
return fmt.Errorf("error encoding Heptio Authentication CA certificate: %v", err)
return fmt.Errorf("error encoding AWS IAM Authentication CA certificate: %v", err)
}

config := kubeconfig.KubectlConfig{}
config.Clusters = append(config.Clusters, &kubeconfig.KubectlClusterWithName{
Name: "heptio-authenticator-aws",
Name: "aws-iam-authenticator",
Cluster: cluster,
})
config.Users = append(config.Users, &kubeconfig.KubectlUserWithName{
Expand Down Expand Up @@ -226,7 +226,7 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte
}

c.AddTask(&nodetasks.File{
Path: "/srv/kubernetes/heptio-authenticator-aws/cert.pem",
Path: "/srv/kubernetes/aws-iam-authenticator/cert.pem",
Contents: fi.NewBytesResource(certificateData),
Type: nodetasks.FileType_File,
Mode: fi.String("600"),
Expand All @@ -248,7 +248,7 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte
}

c.AddTask(&nodetasks.File{
Path: "/srv/kubernetes/heptio-authenticator-aws/key.pem",
Path: "/srv/kubernetes/aws-iam-authenticator/key.pem",
Contents: fi.NewBytesResource(keyData),
Type: nodetasks.FileType_File,
Mode: fi.String("600"),
Expand Down Expand Up @@ -427,7 +427,7 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
}

if b.Cluster.Spec.Authentication != nil {
if b.Cluster.Spec.Authentication.Kopeio != nil || b.Cluster.Spec.Authentication.Heptio != nil {
if b.Cluster.Spec.Authentication.Kopeio != nil || b.Cluster.Spec.Authentication.Aws != nil {
addHostPathMapping(pod, container, "authn-config", PathAuthnConfig)
}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@ type ExecContainerAction struct {

type AuthenticationSpec struct {
Kopeio *KopeioAuthenticationSpec `json:"kopeio,omitempty"`
Heptio *HeptioAuthenticationSpec `json:"heptio,omitempty"`
Aws *AwsAuthenticationSpec `json:"aws,omitempty"`
}

func (s *AuthenticationSpec) IsEmpty() bool {
return s.Kopeio == nil && s.Heptio == nil
return s.Kopeio == nil && s.Aws == nil
}

type KopeioAuthenticationSpec struct {
}

type HeptioAuthenticationSpec struct {
type AwsAuthenticationSpec struct {
}

type AuthorizationSpec struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/kops/v1alpha1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ type ExecContainerAction struct {

type AuthenticationSpec struct {
Kopeio *KopeioAuthenticationSpec `json:"kopeio,omitempty"`
Heptio *HeptioAuthenticationSpec `json:"heptio,omitempty"`
Aws *AwsAuthenticationSpec `json:"aws,omitempty"`
}

func (s *AuthenticationSpec) IsEmpty() bool {
return s.Kopeio == nil && s.Heptio == nil
return s.Kopeio == nil && s.Aws == nil
}

type KopeioAuthenticationSpec struct {
}

type HeptioAuthenticationSpec struct {
type AwsAuthenticationSpec struct {
}

type AuthorizationSpec struct {
Expand Down
60 changes: 30 additions & 30 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

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

38 changes: 19 additions & 19 deletions pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go

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

6 changes: 3 additions & 3 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@ type ExecContainerAction struct {

type AuthenticationSpec struct {
Kopeio *KopeioAuthenticationSpec `json:"kopeio,omitempty"`
Heptio *HeptioAuthenticationSpec `json:"heptio,omitempty"`
Aws *AwsAuthenticationSpec `json:"aws,omitempty"`
}

func (s *AuthenticationSpec) IsEmpty() bool {
return s.Kopeio == nil && s.Heptio == nil
return s.Kopeio == nil && s.Aws == nil
}

type KopeioAuthenticationSpec struct {
}

type HeptioAuthenticationSpec struct {
type AwsAuthenticationSpec struct {
}

type AuthorizationSpec struct {
Expand Down
Loading