You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+129Lines changed: 129 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -676,10 +676,139 @@ config:
676
676
677
677
### Extra volume mounts
678
678
679
+
#### All containers
680
+
679
681
In some situations, for example if you want to use [git mirrors](https://buildkite.com/docs/agent/v3#promoted-experiments-git-mirrors) you may want to attach extra volume mounts (in addition to the `/workspace` one) in all the pod containers.
680
682
681
683
See [this example](internal/integration/fixtures/extra-volume-mounts.yaml), that will declare a new volume in the `podSpec` and mount it in all the containers. The benefit, is to have the same mounted path in all containers, including the `checkout` container.
682
684
685
+
#### `checkout` containers
686
+
687
+
In order to attach extra volumes to your `checkout` containers, define `config.default-checkout-params.extraVolumeMounts` in your configuration. Example:
688
+
```yaml
689
+
# values.yaml
690
+
config:
691
+
default-checkout-params:
692
+
gitCredentialsSecret:
693
+
secretName: my-git-credentials
694
+
extraVolumeMounts:
695
+
- name: checkout-extra-dir
696
+
mountPath: /extra-checkout
697
+
pod-spec-patch:
698
+
containers:
699
+
- name: checkout
700
+
image: "buildkite/agent:latest"
701
+
volumes:
702
+
- name: checkout-extra-dir
703
+
hostPath:
704
+
path: /my/extra/dir/checkout
705
+
type: DirectoryOrCreate
706
+
```
707
+
708
+
Or `checkout.extraVolumeMounts` in the `kubernetes` plugin. Example:
709
+
```yaml
710
+
# pipeline.yml
711
+
...
712
+
kubernetes:
713
+
checkout:
714
+
extraVolumeMounts:
715
+
- name: checkout-extra-dir
716
+
mountPath: /extra-checkout
717
+
podSpecPatch:
718
+
containers:
719
+
- name: checkout
720
+
image: "buildkite/agent:latest"
721
+
volumes:
722
+
- name: checkout-extra-dir
723
+
hostPath:
724
+
path: /my/extra/dir/checkout
725
+
type: DirectoryOrCreate
726
+
```
727
+
728
+
#### `command` containers
729
+
730
+
In order to attach extra volumes to your `container-#` (`command`) containers, define `config.default-command-params.extraVolumeMounts` in your configuration. Example:
731
+
```yaml
732
+
# values.yaml
733
+
config:
734
+
default-command-params:
735
+
extraVolumeMounts:
736
+
- name: command-extra-dir
737
+
mountPath: /extra-command
738
+
pod-spec-patch:
739
+
containers:
740
+
- name: container-0
741
+
image: "buildkite/agent:latest"
742
+
volumes:
743
+
- name: command-extra-dir
744
+
hostPath:
745
+
path: /my/extra/dir/command
746
+
type: DirectoryOrCreate
747
+
```
748
+
749
+
Or `commandParams.extraVolumeMounts` in the `kubernetes` plugin. Example:
750
+
```yaml
751
+
# pipeline.yml
752
+
...
753
+
kubernetes:
754
+
commandParams:
755
+
extraVolumeMounts:
756
+
- name: command-extra-dir
757
+
mountPath: /extra-command
758
+
podSpecPatch:
759
+
containers:
760
+
- name: container-0
761
+
image: "buildkite/agent:latest"
762
+
volumes:
763
+
- name: command-extra-dir
764
+
hostPath:
765
+
path: /my/extra/dir/command
766
+
type: DirectoryOrCreate
767
+
```
768
+
769
+
#### `sidecar` containers
770
+
771
+
In order to attach extra volumes to your `sidecar` containers, define `config.default-sidecar-params.extraVolumeMounts` in your configuration. Example:
772
+
```yaml
773
+
# values.yaml
774
+
config:
775
+
default-sidecar-params:
776
+
extraVolumeMounts:
777
+
- name: sidecar-extra-dir
778
+
mountPath: /extra-sidecar
779
+
pod-spec-patch:
780
+
containers:
781
+
- name: checkout
782
+
image: "buildkite/agent:latest"
783
+
volumes:
784
+
- name: sidecar-extra-dir
785
+
hostPath:
786
+
path: /my/extra/dir/sidecar
787
+
type: DirectoryOrCreate
788
+
```
789
+
790
+
Or `sidecarParams.extraVolumeMounts` in the `kubernetes` plugin. Example:
791
+
```yaml
792
+
# pipeline.yml
793
+
...
794
+
kubernetes:
795
+
sidecars:
796
+
- image: nginx:latest
797
+
sidecarParams:
798
+
extraVolumeMounts:
799
+
- name: sidecar-extra-dir
800
+
mountPath: /extra-sidecar
801
+
podSpecPatch:
802
+
containers:
803
+
- name: checkout
804
+
image: "buildkite/agent:latest"
805
+
volumes:
806
+
- name: sidecar-extra-dir
807
+
hostPath:
808
+
path: /my/extra/dir/sidecar
809
+
type: DirectoryOrCreate
810
+
```
811
+
683
812
### Skipping checkout (v0.13.0 and later)
684
813
685
814
For some steps, you may wish to avoid checkout (cloning a source repository).
0 commit comments