mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 16:46:51 +02:00
fix(setup): Fix configuration for ecr credential helper
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: cluster_setup
|
name: cluster_setup
|
||||||
version: 0.6.0
|
version: 0.6.1
|
||||||
type: application
|
type: application
|
||||||
description: "Initial cluster setup"
|
description: "Initial cluster setup"
|
||||||
maintainers:
|
maintainers:
|
||||||
@@ -8,8 +8,8 @@ maintainers:
|
|||||||
url: https://2martens.de
|
url: https://2martens.de
|
||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/changes: |
|
artifacthub.io/changes: |
|
||||||
- kind: added
|
- kind: fixed
|
||||||
description: Add support for ECR private registries
|
description: Fixed ecr configuration
|
||||||
artifacthub.io/signKey: |
|
artifacthub.io/signKey: |
|
||||||
fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8
|
fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8
|
||||||
url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc
|
url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.ecr.enabled -}}
|
{{- if .Values.ecr.enabled -}}
|
||||||
{{- range .Values.ecr.applicationNamespaces }}
|
{{- range .Values.ecr.applicationNamespaces -}}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
@@ -12,6 +12,7 @@ kind: Role
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: ecr-token-helper
|
name: ecr-token-helper
|
||||||
|
namespace: {{ .name }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "template.labels" $ | nindent 4 }}
|
{{- include "template.labels" $ | nindent 4 }}
|
||||||
rules:
|
rules:
|
||||||
@@ -30,6 +31,7 @@ kind: RoleBinding
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: ecr-token-helper
|
name: ecr-token-helper
|
||||||
|
namespace: {{ .name }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "template.labels" $ | nindent 4 }}
|
{{- include "template.labels" $ | nindent 4 }}
|
||||||
subjects:
|
subjects:
|
||||||
@@ -44,13 +46,28 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: sa-ecr-token-helper
|
name: sa-ecr-token-helper
|
||||||
|
namespace: {{ .name }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "template.labels" $ | nindent 4 }}
|
{{- include "template.labels" $ | nindent 4 }}
|
||||||
---
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
type: Opaque
|
||||||
|
metadata:
|
||||||
|
name: aws-credentials
|
||||||
|
namespace: {{ .name }}
|
||||||
|
labels:
|
||||||
|
{{- include "template.labels" $ | nindent 4 }}
|
||||||
|
data:
|
||||||
|
AWS_ACCESS_KEY_ID: {{ $.Values.ecr.accessKey.id | b64enc }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: {{ $.Values.ecr.accessKey.secret | b64enc }}
|
||||||
|
ACCOUNT: {{ $.Values.ecr.account | b64enc }}
|
||||||
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
metadata:
|
metadata:
|
||||||
name: ecr-token-helper
|
name: ecr-token-helper
|
||||||
|
namespace: {{ .name }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "template.labels" $ | nindent 4 }}
|
{{- include "template.labels" $ | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
@@ -75,18 +92,15 @@ spec:
|
|||||||
--namespace={{ .name }}
|
--namespace={{ .name }}
|
||||||
kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$SECRET_NAME'"}]}' -n {{ .name }}
|
kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$SECRET_NAME'"}]}' -n {{ .name }}
|
||||||
env:
|
env:
|
||||||
- name: AWS_SECRET_ACCESS_KEY
|
|
||||||
value: {{- $.Values.ecr.accessKey.secret }}
|
|
||||||
- name: AWS_ACCESS_KEY_ID
|
|
||||||
value: {{- $.Values.ecr.accessKey.id }}
|
|
||||||
- name: ACCOUNT
|
|
||||||
value: {{- $.Values.ecr.account }}
|
|
||||||
- name: SECRET_NAME
|
- name: SECRET_NAME
|
||||||
value: 'ecrcred'
|
value: 'ecrcred'
|
||||||
- name: REGION
|
- name: REGION
|
||||||
value: eu-central-1
|
value: eu-central-1
|
||||||
- name: ECR_REPOSITORY
|
- name: ECR_REPOSITORY
|
||||||
value: {{ $.Values.ecr.repository }}
|
value: {{ $.Values.ecr.repository }}
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: aws-credentials
|
||||||
image: gtsopour/awscli-kubectl:latest
|
image: gtsopour/awscli-kubectl:latest
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: ecr-token-helper
|
name: ecr-token-helper
|
||||||
|
|||||||
Reference in New Issue
Block a user