Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Aug 2018 21:43:39 +0000 (UTC)
From:      Danilo Egea Gondolfo <danilo@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r477450 - in head/sysutils: . eksctl eksctl/files
Message-ID:  <201808172143.w7HLhdMa085468@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danilo
Date: Fri Aug 17 21:43:38 2018
New Revision: 477450
URL: https://svnweb.freebsd.org/changeset/ports/477450

Log:
  - New port: sysutils/eksctl
  
  eksctl is a simple CLI tool for creating clusters on EKS - Amazon's
  new managed Kubernetes service for EC2. It is written in Go,
  and based on Amazon's official CloudFormation templates.

Added:
  head/sysutils/eksctl/
  head/sysutils/eksctl/Makefile   (contents, props changed)
  head/sysutils/eksctl/distinfo   (contents, props changed)
  head/sysutils/eksctl/files/
  head/sysutils/eksctl/files/patch-pkg_eks_auth.go   (contents, props changed)
  head/sysutils/eksctl/files/patch-pkg_utils_kubectl.go   (contents, props changed)
  head/sysutils/eksctl/pkg-descr   (contents, props changed)
Modified:
  head/sysutils/Makefile

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Fri Aug 17 21:07:58 2018	(r477449)
+++ head/sysutils/Makefile	Fri Aug 17 21:43:38 2018	(r477450)
@@ -300,6 +300,7 @@
     SUBDIR += ec2-scripts
     SUBDIR += edid-decode
     SUBDIR += eject
+    SUBDIR += eksctl
     SUBDIR += endian
     SUBDIR += enteruser
     SUBDIR += entr

Added: head/sysutils/eksctl/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/eksctl/Makefile	Fri Aug 17 21:43:38 2018	(r477450)
@@ -0,0 +1,39 @@
+# Created by: Danilo Egea Gondolfo <danilo@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	eksctl
+PORTVERSION=	0.1.0
+CATEGORIES=	sysutils
+
+MAINTAINER=	danilo@FreeBSD.org
+COMMENT=	CLI for Amazon EKS
+
+LICENSE=	APACHE20
+
+RUN_DEPENDS=	kubectl:sysutils/kubectl \
+		aws-iam-authenticator:security/aws-iam-authenticator
+
+USES=		go
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	weaveworks
+
+PLIST_FILES=	bin/${PORTNAME}
+
+post-patch:
+	${LN} -s ${WRKSRC}/vendor ${WRKSRC}/src
+	${MKDIR} ${WRKSRC}/src/github.com/weaveworks/eksctl
+	${LN} -s ${WRKSRC}/pkg ${WRKSRC}/src/github.com/weaveworks/eksctl/pkg
+
+do-build:
+	cd ${WRKSRC}/cmd/${PORTNAME} && \
+		GOPATH=${WRKSRC} go build \
+		-ldflags="-X main.gitCommit=${PORTVERSION} \
+		-X main.builtAt=$$(date +'%s')"
+
+do-install:
+	${INSTALL_PROGRAM} \
+		${WRKSRC}/cmd/${PORTNAME}/${PORTNAME} \
+		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>

Added: head/sysutils/eksctl/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/eksctl/distinfo	Fri Aug 17 21:43:38 2018	(r477450)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1534530868
+SHA256 (weaveworks-eksctl-0.1.0_GH0.tar.gz) = 81ed110dcb67df9105034243453debba42aaf013d4dfe72ce292a52076bad023
+SIZE (weaveworks-eksctl-0.1.0_GH0.tar.gz) = 15217839

Added: head/sysutils/eksctl/files/patch-pkg_eks_auth.go
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/eksctl/files/patch-pkg_eks_auth.go	Fri Aug 17 21:43:38 2018	(r477450)
@@ -0,0 +1,11 @@
+--- pkg/eks/auth.go.orig	2018-08-17 20:19:48 UTC
++++ pkg/eks/auth.go
+@@ -192,7 +192,7 @@ func (c *ClientConfig) WithExecHeptioAuthenticator() *
+ 	x := clientConfigCopy.Client.AuthInfos[c.ContextName]
+ 	x.Exec = &clientcmdapi.ExecConfig{
+ 		APIVersion: "client.authentication.k8s.io/v1alpha1",
+-		Command:    "heptio-authenticator-aws",
++		Command:    "aws-iam-authenticator",
+ 		Args:       []string{"token", "-i", c.Cluster.ClusterName},
+ 		/*
+ 			Args:       []string{"token", "-i", c.Cluster.ClusterName, "-r", c.roleARN},

Added: head/sysutils/eksctl/files/patch-pkg_utils_kubectl.go
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/eksctl/files/patch-pkg_utils_kubectl.go	Fri Aug 17 21:43:38 2018	(r477450)
@@ -0,0 +1,45 @@
+--- pkg/utils/kubectl.go.orig	2018-08-17 19:52:51 UTC
++++ pkg/utils/kubectl.go
+@@ -46,22 +46,12 @@ func CheckKubectlVersion(env []string) error {
+ 	return nil
+ }
+ 
+-func CheckHeptioAuthenticatorAWS() error {
+-	path, err := exec.LookPath("heptio-authenticator-aws")
+-	if err == nil {
+-		logger.Debug("heptio-authenticator-aws: %q", path)
+-	} else {
+-		return fmt.Errorf("heptio-authenticator-aws not installed")
+-	}
+-	return nil
+-}
+-
+ func CheckAllCommands(kubeconfigPath string, isContextSet bool, contextName string, env []string) error {
+ 	if err := CheckKubectlVersion(env); err != nil {
+ 		return err
+ 	}
+ 
+-	if err := CheckHeptioAuthenticatorAWS(); err != nil {
++	if err := checkAuthenticator(); err != nil {
+ 		return err
+ 	}
+ 
+@@ -97,4 +87,18 @@ func CheckAllCommands(kubeconfigPath string, isContext
+ 	}
+ 
+ 	return nil
++}
++
++// checkAuthenticator checks for the authenticator binary existence.
++func checkAuthenticator() error {
++	binaries := []string{"heptio-authenticator-aws", "aws-iam-authenticator"}
++	for _, bin := range binaries {
++		path, err := exec.LookPath(bin)
++		if err == nil {
++			// binary was found
++			logger.Debug("%s: %q", bin, path)
++			return nil
++		}
++	}
++	return fmt.Errorf("neither aws-iam-authenticator nor heptio-authenticator-aws are installed")
+ }

Added: head/sysutils/eksctl/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/eksctl/pkg-descr	Fri Aug 17 21:43:38 2018	(r477450)
@@ -0,0 +1,5 @@
+eksctl is a simple CLI tool for creating clusters on EKS - Amazon's
+new managed Kubernetes service for EC2. It is written in Go,
+and based on Amazon's official CloudFormation templates.
+
+WWW: https://eksctl.io/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808172143.w7HLhdMa085468>