Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 integration fixes #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,14 @@ data:
{{- end }}
{{- else }}
#!/bin/bash -x
git clone $GIT_CLONE_PARAM /tmp/spinnaker/.hal
GIT_USER=`echo $GIT_USER | sed 's/ *$//g'`
GIT_TOKEN=`echo $GIT_TOKEN | sed 's/ *$//g'`
DYNAMIC_ACCOUNTS_REPO=`echo $DYNAMIC_ACCOUNTS_REPO | sed 's/ *$//g'`
AWS_ACCESS_KEY_ID=$S3_KEY AWS_SECRET_ACCESS_KEY=$S3_SECRET aws s3 cp s3://s3haldir/config /tmp/spinnaker/.hal/config
AWS_ACCESS_KEY_ID=$S3_KEY AWS_SECRET_ACCESS_KEY=$S3_SECRET aws s3 cp s3://s3haldir/default/ /tmp/spinnaker/.hal/default --recursive
AWS_ACCESS_KEY_ID=$S3_KEY AWS_SECRET_ACCESS_KEY=$S3_SECRET aws s3 cp s3://s3haldir/halyard.yaml /tmp/spinnaker/.hal/halyard.yaml
sed -i s/SPINNAKER_NAMESPACE/${SPINNAKER_NAMESPACE}/ /tmp/spinnaker/.hal/config
{{- if .Values.gitopsHalyard.mTLS.enabled }}
sed -i s/SPINNAKER_NAMESPACE/${SPINNAKER_NAMESPACE}/g /tmp/spinnaker/.hal/default/service-settings/*
{{- end }}
sed -i s/RELEASE_NAME/{{ .Release.Name }}/g /tmp/spinnaker/.hal/config
sed -i s/GIT_USER/${GIT_USER}/g /tmp/spinnaker/.hal/default/profiles/spinnakerconfig.yml
sed -i s/GIT_TOKEN/${GIT_TOKEN}/g /tmp/spinnaker/.hal/default/profiles/spinnakerconfig.yml
sed -i 's|DYNAMIC_ACCOUNTS_REPO|'"${DYNAMIC_ACCOUNTS_REPO}"'|' /tmp/spinnaker/.hal/default/profiles/spinnakerconfig.yml
sed -i s/RELEASE_NAME/{{ .Release.Name }}/g /tmp/spinnaker/.hal/default/service-settings/redis.yml
sed -i s/RELEASE_NAME/{{ .Release.Name }}/g /tmp/spinnaker/.hal/default/profiles/fiat-local.yml
printf 'server.address: 0.0.0.0\n' > /tmp/config/halyard-local.yml
Expand Down
20 changes: 5 additions & 15 deletions charts/oes/charts/spinnaker/templates/statefulsets/halyard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
initContainers:
- name: "create-halyard-local"
{{- if .Values.gitopsHalyard.enabled }}
image: alpine/git:v2.26.2
image: amazon/aws-cli
{{- else }}
image: {{ .Values.halyard.image.repository }}:{{ .Values.halyard.image.tag }}
{{- end }}
Expand All @@ -58,26 +58,16 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: GIT_CLONE_PARAM
- name: S3_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.gitopsHalyard.secretName }}
key: gitcloneparam
- name: GIT_USER
key: s3accesskey
- name: S3_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.gitopsHalyard.secretName }}
key: gituser
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Values.gitopsHalyard.secretName }}
key: gittoken
- name: DYNAMIC_ACCOUNTS_REPO
valueFrom:
secretKeyRef:
name: {{ .Values.gitopsHalyard.secretName }}
key: dynamicaccountsgituri
key: s3secretkey
{{- end }}
volumeMounts:
- name: halyard-config
Expand Down
9 changes: 2 additions & 7 deletions charts/oes/templates/secrets/opsmx-gitops-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{{ if .Values.spinnaker.gitopsHalyard.enabled }}
apiVersion: v1
data:
# Repo uri to fetch halyard configuration
gitcloneparam: https://<gituserID>:<gittoken>@github.com/opsmx/gitops-haldir.git # In base64 format

# Repo details to fetch dynamic configuration
dynamicaccountsgituri: <dynamicAccountsGitUrl>
gittoken: <gittoken>
gituser: <gituserID>
s3accesskey: QUtJQUlMRk8zVEkyQUFTVERRWFE=
s3secretkey: SHhiNkdJVmZ1VTRjby9HOUE5L0Z3bFp5QVM4Q09LSnN4OVVHb0ZHTQ==
kind: Secret
metadata:
name: opsmx-gitops-auth
Expand Down
10 changes: 5 additions & 5 deletions charts/oes/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ imagePullSecret: opsmxdev-secret
## Docker registry credentials to create imagePullSecret
##
imageCredentials:
registry: https://index.docker.io/v1/
username: dockerID # Docker hub username
password: dockerPassword # Docker hub password
registry: https://quay.io/
username: quayID # Docker hub username
password: quayPassword # Docker hub password
email: [email protected] # email corresponding to docker hub ID

rbac:
Expand Down Expand Up @@ -789,12 +789,12 @@ spinnaker:

# Initialize gitOps style Halyard
gitopsHalyard:
enabled: false
enabled: true
mTLS:
enabled: false # Enable mTLS for Spinnaker Services and SSL for Deck and Gate
deckIngressHost: spindeck.{{ .Release.Name }}.domain.com # Used by OES to create ingress for deck
gateIngressHost: spingate.{{ .Release.Name }}.domain.com # Used by OES to create ingress for gate
repo-type: git # git, S3, vault, only git support at this point
repo-type: s3 # git, S3, vault, only git support at this point
secretName: opsmx-gitops-auth
# Max time(in secs) that an init container of halyard should wait
# to fetch External Load Balancer IP of spin-deck and spin-gate
Expand Down