Skip to content

Commit

Permalink
Add CI and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Jun 5, 2018
1 parent 1bf38b0 commit a4e054b
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
jobs:
build:
docker:
# https://circleci.com/docs/2.0/building-docker-images/#docker-version
- image: docker:17.11.0-ce
steps:
- checkout
- setup_remote_docker: {docker_layer_caching: true}
# just a simple build for now, but will use skaffold if it gets more complex
- run: docker build .
52 changes: 52 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM golang:1.10-alpine AS build

RUN apk add --update \
curl \
git \
make \
py-pip \
python \
python-dev \
&& true

RUN mkdir /out
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb --root /out \
alpine-baselayout \
busybox \
ca-certificates \
coreutils \
git \
libc6-compat \
libgcc \
libstdc++ \
python \
&& true

RUN go get github.com/jteeuwen/go-bindata/go-bindata

ENV EKSCTL $GOPATH/src/github.com/weaveworks/eksctl
RUN mkdir -p "$(dirname ${EKSCTL})"
COPY . $EKSCTL

WORKDIR $EKSCTL
RUN make \
&& cp ./eksctl /out/usr/local/bin/eksctl

RUN go build ./vendor/github.com/heptio/authenticator/cmd/heptio-authenticator-aws \
&& cp ./heptio-authenticator-aws /out/usr/local/bin/heptio-authenticator-aws

RUN pip install --root=/out awscli==1.15.28

WORKDIR /out

ENV KUBECTL_VERSION v1.10.3
RUN curl --silent --location "https://dl.k8s.io/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" --output usr/local/bin/kubectl \
&& chmod +x usr/local/bin/kubectl

#COPY pkg/eks/assets/1.10.0/2018-05-09/eks-2017-11-01.normal.json /out/etc/
#COPY add-model.sh /out/etc/profile.d/

FROM scratch
CMD eksctl
COPY --from=build /out /
168 changes: 165 additions & 3 deletions Gopkg.lock

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

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
name = "k8s.io/kops"
version = "1.9.1"

[[constraint]]
branch = "master"
name = "github.com/heptio/authenticator"

[prune]
go-tests = true
unused-packages = true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build:
build: update-bindata
go build ./cmd/eksctl

update-bindata:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

> ***CURRENT STATE: EARLY PROTOTYPE***
[![Circle CI](https://circleci.com/gh/weaveworks/eksctl/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/eksctl/tree/master)

What is `eksctl`? It's a simple CLI tool for creating EKS clusters, for most common use-cases.

It's inspired by `kubectl`. It provides a simple way to create and manage clusters, and aims to implement a [Cluster API](https://github.com/kubernetes-sigs/cluster-api) controller for EKS also (`eksctld`).
Expand Down
5 changes: 5 additions & 0 deletions add-model.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

#aws configure add-model \
# --service-mode file:///etc/eks-2017-11-01.normal.json \
# --service-name eks
9 changes: 9 additions & 0 deletions cmd/heptio-authenticator-aws-fake/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

// this is to keep dep happy, as we want authenticator cmd vendored

import (
_ "github.com/heptio/authenticator/cmd/heptio-authenticator-aws"
)

func main() {}
3 changes: 3 additions & 0 deletions pkg/eks/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import (

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"k8s.io/kops/upup/pkg/fi/utils"

_ "github.com/heptio/authenticator/pkg/token"
)

func (c *Config) nodeAuthConfigMap() (*corev1.ConfigMap, error) {
Expand Down

0 comments on commit a4e054b

Please sign in to comment.