Skip to content

Commit 080bf70

Browse files
authored
Merge pull request #9 from RedbackThomson/regenerate-helm
Add Helm charts
2 parents 77d66f4 + df8b86d commit 080bf70

10 files changed

+402
-0
lines changed

helm/helm/Chart.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
name: ack-s3-controller
3+
description: A Helm chart for the ACK service controller for s3
4+
version: v0.0.2
5+
appVersion: v0.0.2
6+
home: https://github.com/aws/aws-controllers-k8s
7+
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
8+
sources:
9+
- https://github.com/aws/aws-controllers-k8s
10+
maintainers:
11+
- name: ACK Admins
12+
url: https://github.com/orgs/aws/teams/aws-controllers-for-kubernetes-ack-admins
13+
keywords:
14+
- aws
15+
- kubernetes
16+
- s3
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.4.0
8+
creationTimestamp: null
9+
name: buckets.s3.services.k8s.aws
10+
spec:
11+
group: s3.services.k8s.aws
12+
names:
13+
kind: Bucket
14+
listKind: BucketList
15+
plural: buckets
16+
singular: bucket
17+
scope: Namespaced
18+
versions:
19+
- name: v1alpha1
20+
schema:
21+
openAPIV3Schema:
22+
description: Bucket is the Schema for the Buckets API
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: BucketSpec defines the desired state of Bucket
38+
properties:
39+
acl:
40+
type: string
41+
createBucketConfiguration:
42+
properties:
43+
locationConstraint:
44+
type: string
45+
type: object
46+
grantFullControl:
47+
type: string
48+
grantRead:
49+
type: string
50+
grantReadACP:
51+
type: string
52+
grantWrite:
53+
type: string
54+
grantWriteACP:
55+
type: string
56+
name:
57+
type: string
58+
objectLockEnabledForBucket:
59+
type: boolean
60+
required:
61+
- name
62+
type: object
63+
status:
64+
description: BucketStatus defines the observed state of Bucket
65+
properties:
66+
ackResourceMetadata:
67+
description: All CRs managed by ACK have a common `Status.ACKResourceMetadata`
68+
member that is used to contain resource sync state, account ownership,
69+
constructed ARN for the resource
70+
properties:
71+
arn:
72+
description: 'ARN is the Amazon Resource Name for the resource.
73+
This is a globally-unique identifier and is set only by the
74+
ACK service controller once the controller has orchestrated
75+
the creation of the resource OR when it has verified that an
76+
"adopted" resource (a resource where the ARN annotation was
77+
set by the Kubernetes user on the CR) exists and matches the
78+
supplied CR''s Spec field values. TODO(vijat@): Find a better
79+
strategy for resources that do not have ARN in CreateOutputResponse
80+
https://github.com/aws/aws-controllers-k8s/issues/270'
81+
type: string
82+
ownerAccountID:
83+
description: OwnerAccountID is the AWS Account ID of the account
84+
that owns the backend AWS service API resource.
85+
type: string
86+
required:
87+
- ownerAccountID
88+
type: object
89+
conditions:
90+
description: All CRS managed by ACK have a common `Status.Conditions`
91+
member that contains a collection of `ackv1alpha1.Condition` objects
92+
that describe the various terminal states of the CR and its backend
93+
AWS service API resource
94+
items:
95+
description: Condition is the common struct used by all CRDs managed
96+
by ACK service controllers to indicate terminal states of the
97+
CR and its backend AWS service API resource
98+
properties:
99+
lastTransitionTime:
100+
description: Last time the condition transitioned from one status
101+
to another.
102+
format: date-time
103+
type: string
104+
message:
105+
description: A human readable message indicating details about
106+
the transition.
107+
type: string
108+
reason:
109+
description: The reason for the condition's last transition.
110+
type: string
111+
status:
112+
description: Status of the condition, one of True, False, Unknown.
113+
type: string
114+
type:
115+
description: Type is the type of the Condition
116+
type: string
117+
required:
118+
- status
119+
- type
120+
type: object
121+
type: array
122+
location:
123+
type: string
124+
required:
125+
- ackResourceMetadata
126+
- conditions
127+
type: object
128+
type: object
129+
served: true
130+
storage: true
131+
subresources:
132+
status: {}
133+
status:
134+
acceptedNames:
135+
kind: ""
136+
plural: ""
137+
conditions: []
138+
storedVersions: []

helm/helm/templates/_helpers.tpl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{/* The name of the application this chart installs */}}
2+
{{- define "app.name" -}}
3+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
4+
{{- end -}}
5+
6+
{{/*
7+
Create a default fully qualified app name.
8+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
9+
If release name contains chart name it will be used as a full name.
10+
*/}}
11+
{{- define "app.fullname" -}}
12+
{{- if .Values.fullnameOverride -}}
13+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
14+
{{- else -}}
15+
{{- $name := default .Chart.Name .Values.nameOverride -}}
16+
{{- if contains $name .Release.Name -}}
17+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
18+
{{- else -}}
19+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
20+
{{- end -}}
21+
{{- end -}}
22+
{{- end -}}
23+
24+
{{/* The name and version as used by the chart label */}}
25+
{{- define "chart.name-version" -}}
26+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
27+
{{- end -}}
28+
29+
{{/* The name of the service account to use */}}
30+
{{- define "service-account.name" -}}
31+
{{ default "default" .Values.serviceAccount.name }}
32+
{{- end -}}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: {{ include "app.fullname" . }}
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: {{ include "app.name" . }}
9+
subjects:
10+
- kind: ServiceAccount
11+
name: {{ include "service-account.name" . }}
12+
namespace: {{ .Release.Namespace }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
---
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: ClusterRole
5+
metadata:
6+
creationTimestamp: null
7+
name: ack-s3-controller
8+
rules:
9+
- apiGroups:
10+
- ""
11+
resources:
12+
- configmaps
13+
verbs:
14+
- get
15+
- list
16+
- watch
17+
- apiGroups:
18+
- ""
19+
resources:
20+
- namespaces
21+
verbs:
22+
- get
23+
- list
24+
- watch
25+
- apiGroups:
26+
- s3.services.k8s.aws
27+
resources:
28+
- buckets
29+
verbs:
30+
- create
31+
- delete
32+
- get
33+
- list
34+
- patch
35+
- update
36+
- watch
37+
- apiGroups:
38+
- s3.services.k8s.aws
39+
resources:
40+
- buckets/status
41+
verbs:
42+
- get
43+
- patch
44+
- update

helm/helm/templates/deployment.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "app.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
app.kubernetes.io/name: {{ include "app.name" . }}
8+
app.kubernetes.io/instance: {{ .Release.Name }}
9+
app.kubernetes.io/managed-by: Helm
10+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
11+
k8s-app: {{ include "app.name" . }}
12+
helm.sh/chart: {{ include "chart.name-version" . }}
13+
control-plane: controller
14+
spec:
15+
replicas: 1
16+
selector:
17+
matchLabels:
18+
app.kubernetes.io/name: {{ include "app.name" . }}
19+
app.kubernetes.io/instance: {{ .Release.Name }}
20+
template:
21+
metadata:
22+
annotations:
23+
{{- range $key, $value := .Values.deployment.annotations }}
24+
{{ $key }}: {{ $value | quote }}
25+
{{- end }}
26+
labels:
27+
app.kubernetes.io/name: {{ include "app.name" . }}
28+
app.kubernetes.io/instance: {{ .Release.Name }}
29+
app.kubernetes.io/managed-by: Helm
30+
k8s-app: {{ include "app.name" . }}
31+
{{- range $key, $value := .Values.deployment.labels }}
32+
{{ $key }}: {{ $value | quote }}
33+
{{- end }}
34+
spec:
35+
serviceAccountName: {{ include "service-account.name" . }}
36+
containers:
37+
- command:
38+
- ./bin/controller
39+
args:
40+
- --aws-account-id
41+
- "$(AWS_ACCOUNT_ID)"
42+
- --aws-region
43+
- "$(AWS_REGION)"
44+
- --enable-development-logging
45+
- "$(ACK_ENABLE_DEVELOPMENT_LOGGING)"
46+
- --log-level
47+
- "$(ACK_LOG_LEVEL)"
48+
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
49+
name: controller
50+
ports:
51+
- containerPort: {{ .Values.deployment.containerPort }}
52+
resources:
53+
{{- toYaml .Values.resources | nindent 10 }}
54+
env:
55+
- name: K8S_NAMESPACE
56+
valueFrom:
57+
fieldRef:
58+
fieldPath: metadata.namespace
59+
- name: AWS_REGION
60+
value: {{ .Values.aws.region }}
61+
terminationGracePeriodSeconds: 10

helm/helm/templates/role-reader.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
creationTimestamp: null
6+
name: ack-s3-reader
7+
namespace: {{ .Release.Namespace }}
8+
rules:
9+
- apiGroups:
10+
- s3.services.k8s.aws
11+
resources:
12+
- buckets
13+
verbs:
14+
- get
15+
- list
16+
- watch

helm/helm/templates/role-writer.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
creationTimestamp: null
6+
name: ack-s3-writer
7+
namespace: {{ .Release.Namespace }}
8+
rules:
9+
- apiGroups:
10+
- s3.services.k8s.aws
11+
resources:
12+
- buckets
13+
14+
verbs:
15+
- create
16+
- delete
17+
- get
18+
- list
19+
- patch
20+
- update
21+
- watch
22+
- apiGroups:
23+
- s3.services.k8s.aws
24+
resources:
25+
- buckets
26+
verbs:
27+
- get
28+
- patch
29+
- update
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if .Values.serviceAccount.create }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
labels:
6+
app.kubernetes.io/name: {{ include "app.name" . }}
7+
app.kubernetes.io/instance: {{ .Release.Name }}
8+
app.kubernetes.io/managed-by: Helm
9+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
10+
k8s-app: {{ include "app.name" . }}
11+
helm.sh/chart: {{ include "chart.name-version" . }}
12+
name: {{ include "service-account.name" . }}
13+
annotations:
14+
{{- range $key, $value := .Values.serviceAccount.annotations }}
15+
{{ $key }}: {{ $value | quote }}
16+
{{- end }}
17+
{{- end }}

0 commit comments

Comments
 (0)