Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Adding First Release To Use In-Cluster
Browse files Browse the repository at this point in the history
**This change addresses the need by:**

* closes #50

Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Aug 25, 2018
1 parent b62fc1a commit 1f3d5d5
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 86 deletions.
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ project_name: aws-operator
before:
hooks:
- make codegen
- make update-bindata

# Builds the binary for each platform
builds:
Expand Down Expand Up @@ -43,7 +42,7 @@ release:

# Creates a Docker container with the operator packaged into it for distribution
dockers:
- image: christopherhein/aws-operator
- image: 915347744415.dkr.ecr.us-west-2.amazonaws.com/aws-operator
binary: aws-operator
dockerfile: Dockerfile
tag_templates:
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ release:
rm -fr dist
goreleaser

.PHONY: install-bindata
install-bindata:
go get -u github.com/jteeuwen/go-bindata/...

.PHONY: install-aws-codegen
install-aws-codegen:
go get -u github.com/christopherhein/aws-operator-codegen

# .PHONY: update-bindata
# update-bindata:
# go generate ./pkg/cloudformation/

.PHONY: aws-codegen
aws-codegen:
aws-operator-codegen process
Expand Down
166 changes: 90 additions & 76 deletions configs/aws-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,78 +1,92 @@
---
kind: Namespace
apiVersion: v1
metadata:
name: aws-operator
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: aws-operator
namespace: aws-operator
rules:
- apiGroups:
- extensions
resources:
- thirdpartyresources
verbs:
- get
- list
- watch
- create
- delete
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- operator.aws
resources:
- "*"
verbs:
- "*"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: aws-operator
namespace: aws-operator
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: aws-operator
namespace: aws-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: aws-operator
subjects:
kind: List
items:
- kind: Namespace
apiVersion: v1
metadata:
name: aws-operator

- kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: aws-operator
namespace: aws-operator
rules:
- apiGroups:
- v1
resources:
- secrets
- pods
- configmaps
- services
verbs:
- get
- list
- watch
- create
- delete
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- operator.aws
resources:
- "*"
verbs:
- "*"

- kind: ServiceAccount
name: aws-operator
namespace: default
# TODO: Uncomment when you have an image to deploy
# ---
# apiVersion: apps/v1beta1
# kind: Deployment
# metadata:
# name: aws-operator
# namespace: aws-operator
# spec:
# replicas: 1
# template:
# metadata:
# labels:
# app: aws-operator
# spec:
# serviceAccountName: aws-operator
# containers:
# - name: aws-operator
# image: christopherhein/aws-operator:VERSION_NUMBER
# imagePullPolicy: Always
apiVersion: v1
metadata:
name: aws-operator
namespace: aws-operator

- kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: aws-operator
namespace: aws-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: aws-operator
subjects:
- kind: ServiceAccount
name: aws-operator
namespace: default

- kind: Deployment
apiVersion: apps/v1beta1
metadata:
name: aws-operator
namespace: aws-operator
spec:
replicas: 1
template:
metadata:
labels:
app: aws-operator
spec:
serviceAccountName: aws-operator
containers:
- name: aws-operator
image: <account-id>.dkr.ecr.us-west-2.amazonaws.com/aws-operator:v0.0.1.alpha1
imagePullPolicy: Always
env:
- name: AWS_ACCESS_KEY_ID
value:
- name: AWS_SECRET_ACCESS_KEY
value:
args:
- --cluster-name=<cluster-name>
- --region=<region>
- --bucket=<bucket-name>
- --account-id=<account-id>

0 comments on commit 1f3d5d5

Please sign in to comment.