Skip to content

Commit 7e989d1

Browse files
committed
Enable awsecr-creds addon which will setup credentials to AWS ECR for downloading docker images
1 parent a9bfc57 commit 7e989d1

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ $ minikube addons list
279279
- dashboard: enabled
280280
- kube-dns: enabled
281281
- heapster: disabled
282+
- awsecr-creds: disabled
282283
283284
# minikube must be running for these commands to take effect
284285
$ minikube addons enable heapster
@@ -294,6 +295,7 @@ The currently supported addons include:
294295
* [Kubernetes Dashboard](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard)
295296
* [Kube-dns](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns)
296297
* [Heapster](https://github.com/kubernetes/heapster): [Troubleshooting Guide](https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md) Note:You will need to login to Grafana as admin/admin in order to access the console
298+
* [AWS ECR Credentials](https://github.com/upmc-enterprises/awsecr-creds): Allow for AWS ECR credentials to be refreshed inside your Kubernetes cluster via ImagePullSecrets [NOTE: Requires k8s secret to function](https://github.com/upmc-enterprises/awsecr-creds/blob/master/k8s/secret.yaml)
297299

298300
If you would like to have minikube properly start/restart custom addons, place the addon(s) you wish to be launched with minikube in the `.minikube/addons` directory. Addons in this folder will be moved to the minikubeVM and launched each time minikube is started/restarted.
299301

cmd/minikube/cmd/config/config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ var settings = []Setting{
142142
validations: []setFn{IsValidAddon},
143143
callbacks: []setFn{EnableOrDisableAddon},
144144
},
145+
{
146+
name: "awsecr-creds",
147+
set: SetBool,
148+
validations: []setFn{IsValidAddon},
149+
callbacks: []setFn{EnableOrDisableAddon},
150+
},
145151
}
146152

147153
var ConfigCmd = &cobra.Command{
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
apiVersion: v1
3+
kind: ReplicationController
4+
metadata:
5+
name: awsecr-creds
6+
namespace: kube-system
7+
labels:
8+
app: awsecr-creds
9+
version: v1.1
10+
kubernetes.io/cluster-service: "true"
11+
kubernetes.io/minikube-addons: awsecr-creds
12+
spec:
13+
replicas: 1
14+
selector:
15+
app: awsecr-creds
16+
version: v1.1
17+
kubernetes.io/cluster-service: "true"
18+
template:
19+
metadata:
20+
labels:
21+
app: awsecr-creds
22+
version: v1.1
23+
kubernetes.io/cluster-service: "true"
24+
spec:
25+
containers:
26+
- image: upmcenterprises/awsecr-creds:1.1
27+
name: awsecr-creds
28+
imagePullPolicy: Always
29+
env:
30+
- name: AWS_ACCESS_KEY_ID
31+
valueFrom:
32+
secretKeyRef:
33+
name: awsecr-creds
34+
key: AWS_ACCESS_KEY_ID
35+
- name: AWS_SECRET_ACCESS_KEY
36+
valueFrom:
37+
secretKeyRef:
38+
name: awsecr-creds
39+
key: AWS_SECRET_ACCESS_KEY
40+
- name: awsaccount
41+
valueFrom:
42+
secretKeyRef:
43+
name: awsecr-creds
44+
key: aws-account

docs/minikube_config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Configurable fields:
2727
* kube-dns
2828
* heapster
2929
* ingress
30+
* awsecr-creds
3031

3132
```
3233
minikube config SUBCOMMAND [flags]

pkg/minikube/assets/addons.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ var Addons = map[string]*Addon{
130130
"ingress-svc.yaml",
131131
"0640"),
132132
}, false, "ingress"),
133+
"awsecr-creds": NewAddon([]*MemoryAsset{
134+
NewMemoryAsset(
135+
"deploy/addons/awsecr-creds/awsecr-creds-rc.yaml",
136+
constants.AddonsPath,
137+
"awsecr-creds-rc.yaml",
138+
"0640"),
139+
}, false, "awsecr-creds"),
133140
}
134141

135142
func AddMinikubeAddonsDirToAssets(assetList *[]CopyableFile) {

0 commit comments

Comments
 (0)