diff --git a/README.md b/README.md index 020e3bb9..262042a9 100644 --- a/README.md +++ b/README.md @@ -93,38 +93,40 @@ sequenceDiagram ## Sample buildkite pipeline -```yaml! +```yaml steps: -- label: build image - plugins: - - kubernetes: - podSpec: - containers: - - image: gradle:latest - command: [gradle] - args: - - jib - - --image=ttl.sh/example:1h + - label: build image + agents: + queue: kubernetes + plugins: + - kubernetes: + podSpec: + containers: + - image: gradle:latest + command: [gradle] + args: + - jib + - --image=ttl.sh/example:1h ``` ## Cloning repos via SSH To use SSH to clone your repos, you'll need to add a secret reference via an [EnvFrom](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#envfromsource-v1-core) to your pipeline to specify where to mount your SSH private key from. -```yaml! +```yaml steps: -- label: build image - plugins: - - kubernetes: - gitEnvFrom: - - secretRef: {name: agent-stack-k8s} # <-- - podSpec: - containers: - - image: gradle:latest - command: [gradle] - args: - - jib - - --image=ttl.sh/example:1h + - label: build image + plugins: + - kubernetes: + gitEnvFrom: + - secretRef: { name: agent-stack-k8s } # <-- + podSpec: + containers: + - image: gradle:latest + command: [gradle] + args: + - jib + - --image=ttl.sh/example:1h ``` ## Development diff --git a/charts/agent-stack-k8s/values.yaml b/charts/agent-stack-k8s/values.yaml index 6ea053d8..c1a515b8 100644 --- a/charts/agent-stack-k8s/values.yaml +++ b/charts/agent-stack-k8s/values.yaml @@ -1,6 +1,6 @@ agentToken: "" graphqlToken: "" -image: "ghcr.io/buildkite/agent-stack-k8s:latest" +image: "ghcr.io/buildkite/agent-stack-k8s:v0.1.0" config: org: "" diff --git a/cmd/controller/controller.go b/cmd/controller/controller.go index dd1df060..3d513e6b 100644 --- a/cmd/controller/controller.go +++ b/cmd/controller/controller.go @@ -35,7 +35,7 @@ func addFlags(cmd *cobra.Command) { cmd.Flags().StringSlice("tags", []string{"queue=kubernetes"}, `A comma-separated list of tags for the agent (for example, "linux" or "mac,xcode=8")`) cmd.Flags().String("namespace", api.DefaultNamespace, "kubernetes namespace to create resources in") cmd.Flags().Bool("debug", false, "debug logs") - cmd.Flags().Int("max-in-flight", 1, "max jobs in flight, 0 means no max") + cmd.Flags().Int("max-in-flight", 25, "max jobs in flight, 0 means no max") cmd.Flags().Duration("job-ttl", 10*time.Minute, "time to retain kubernetes jobs after completion") cmd.Flags().String("agent-token-secret", "buildkite-agent-token", "name of the Buildkite agent token secret") } diff --git a/justfile b/justfile index 4e54f0a4..bb175c87 100644 --- a/justfile +++ b/justfile @@ -30,20 +30,18 @@ agent repo=("ghcr.io/buildkite/agent-k8s") tag=("latest"): docker buildx build --tag {{repo}}:{{tag}} --platform linux/arm64,linux/amd64 --push . rm buildkite-agent-linux* -publish: - ko publish -P +publish *FLAGS: + ko publish -P {{FLAGS}} deploy *FLAGS: #!/usr/bin/env bash set -euxo pipefail - image=$(just publish) helm upgrade agent-stack-k8s charts/agent-stack-k8s \ --namespace buildkite \ --install \ --create-namespace \ --wait \ - --set image=$image \ {{FLAGS}}