Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Assorted improvements #7

Merged
merged 9 commits into from
Dec 12, 2018
Merged

Conversation

grenzr
Copy link
Contributor

@grenzr grenzr commented Oct 5, 2018

This PR adds quite a few bits of new functionality and refactor (some of which might be a step too far for you, but I thought I'd give it a go anyway :)

  • chart renamed to vsts-agent instead of helm-vsts-agent
  • make helm-package task added to create package (can now use helm repo add vsts-agent https://raw.githubusercontent.com/grenzr/helm-vsts-agent/assorted_improvements/charts/ to pull in the repo)
  • add extraEnv variable to add more env vars into the vsts-agent container
  • add cleanRun which resets vsts-agent container upon completion of each build (resets the working environment)
  • add extraContainers variable which allows sidecar of additional containers into the vsts-agent pod
  • add volumes/volumeMounts variable which allows ability to mount arbitrary volumes into the vsts-agent container or elesewhere in the pod

Our example use is to sidecar our own docker DIND image instead of using the k8s hosts docker service (which imo is not a good approach). This way guarantees consistency from k8s deployment to deployment :

resources:
  limits:
    cpu: 1
    memory: 1Gi
  requests:
    cpu: 1
    memory: 1Gi

cleanRun: true

extraEnv:
  DOCKER_HOST: tcp://localhost:2375

extraContainers:
- name: dind-daemon
  image: docker:18.05.0-dind
  args: ["--mtu=1450"]
  resources:
    requests:
      memory: 1Gi
  securityContext:
      privileged: true
  volumeMounts:
    - name: docker-graph-storage
      mountPath: /var/lib/docker

volumes:
- name: docker-graph-storage
  emptyDir: {}

volumeMounts: []

@vglafirov
Copy link
Contributor

vglafirov commented Oct 26, 2018

@grenzr Please rebase to master

@vglafirov
Copy link
Contributor

@grenzr Thanks for your PR. It might take a while to test your changes.

@grenzr
Copy link
Contributor Author

grenzr commented Nov 7, 2018

Hi @vglafirov I will look at rebasing shortly

This allows you to specify additional custom pod volumes and
vsts-agent container volumeMounts in the deployment
Allows you to sidecar additional containers in the vsts-agent pod
Don't really need helm- in the name?
make helm-packge requires chart name to be same as chart dir name
@grenzr grenzr force-pushed the assorted_improvements branch from ae17b64 to 19d76f1 Compare November 7, 2018 14:42
@grenzr
Copy link
Contributor Author

grenzr commented Nov 7, 2018

Ok, its rebased now, but the 1.0.0 tgz doesn't currently contain the storageclass changes.. I could do it as part of the PR if you like (since I've put one there in this PR), but I think going forward it would probably be best you cut your own tgz's after merging 1 or many PRs when you're ready to declare a new release.

@grenzr
Copy link
Contributor Author

grenzr commented Nov 8, 2018

I have another commit behind this, in a different branch, which allows you to provide your own additional volumeClaimTemplates too.

grenzr@e84b078

Can pull it in this PR too if you want? (This also has a newly built 1.0.0 tgz)
Or can deal with it in a separate PR.. up to you.

@vglafirov vglafirov merged commit 9e758a6 into Azure:master Dec 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants