Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .buildkite/verify-overlays.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eu
pushd "$(dirname "${BASH_SOURCE[0]}")"/..

OVERLAYS=()
mapfile -t OVERLAYS < <(find examples -maxdepth 1 -type d ! -name '.*' ! -name 'monitoring' ! -name 'ingress-controller' ! -name 'examples' -printf '%f\n')
mapfile -t OVERLAYS < <(find examples -maxdepth 1 -type d ! -name '.*' ! -name 'demo' ! -name 'monitoring' ! -name 'ingress-controller' ! -name 'examples' -printf '%f\n')

for O in "${OVERLAYS[@]}"; do
echo "<<<< GENERATING ${O} OVERLAY >>>>>"
Expand Down
33 changes: 33 additions & 0 deletions components/resources/imagepullsecrets/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patches:
- patch: |-
- op: add
path: /spec/template/spec/imagePullSecrets
value:
name: IMAGE_PULL_SECRET_NAME
target:
group: apps
kind: StatefulSet|Deployment|DaemonSet
version: v1
replacements:
- source:
fieldPath: data.IMAGE_PULL_SECRET_NAME
kind: ConfigMap
name: sourcegraph-kustomize-build-config
targets:
- fieldPaths:
- spec.template.spec.imagePullSecrets.name
select:
group: apps
kind: Deployment
- fieldPaths:
- spec.template.spec.imagePullSecrets.name
select:
group: apps
kind: StatefulSet
- fieldPaths:
- spec.template.spec.imagePullSecrets.name
select:
group: apps
kind: DaemonSet
35 changes: 35 additions & 0 deletions examples/demo/private-registry/buildConfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
################################################################################################
# [BUILD CONFIGURATIONS]
# Some components read the configuration values in this file during the Kustomize build-process
#
# HOW TO USE:
# Enter the configuration values as instructed by components used in your kustomization.yaml
# Always refer to the component’s documentation or comments before updating
################################################################################################
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
description: Some components read the configuration values from the "data" field below during the build process. You only need to update this file if you are using components that require specific CONFIG_KEYS. If no components in your overlay require extra configuration, no update is necessary.
labels:
deploy: sourcegraph
name: sourcegraph-kustomize-build-config
data:
# example:
EXAMPLE_CONFIG_KEY: example
#-------- Update config options below ---------#
# AWS_MANAGED_CERT_ARN: __placeholder__
# GKE_MANAGED_CERT_NAME: __placeholder__
# HOST_DOMAIN: __placeholder__
# NEW_REDIS_CACHE_ENDPOINT: __placeholder__
# NEW_REDIS_STORE_ENDPOINT: __placeholder__
PRIVATE_REGISTRY: my-private-registry.io
IMAGE_PULL_SECRET_NAME: secret-registry-key
# SSD_NODE_PATH: __placeholder__
# STORAGECLASS_NAME: __placeholder__
# STORAGECLASS_PROVISIONER: __placeholder__
# STORAGECLASS_PARAM_TYPE: __placeholder__
# TLS_HOST: __placeholder__
# TLS_INGRESS_CLASS_NAME: __placeholder__
# TLS_CLUSTER_ISSUER: __placeholder__
# TLS_SECRET_NAME: __placeholder__
14 changes: 14 additions & 0 deletions examples/demo/private-registry/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: ns-sourcegraph
# Run all services with default values
resources:
# [REQUIRED: BUILD CONFIG] Update this file when using components that have "CONFIG KEYS"
- buildConfig.yaml # -- Update the CONFIG Key values in buildConfig.yaml when instructed
- ../../base/sourcegraph
- ../../base/monitoring
components:
- ../../components/resources/namespace
- ../../components/monitoring/tracing
- ../../components/enable/private-registry
- ../../components/resources/imagepullsecrets
1 change: 1 addition & 0 deletions instances/template/buildConfig.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data:
# NEW_REDIS_CACHE_ENDPOINT: __placeholder__
# NEW_REDIS_STORE_ENDPOINT: __placeholder__
# PRIVATE_REGISTRY: __placeholder__
# PRIVATE_REGISTRY_SECRET_KEY: __placeholder__
# SSD_NODE_PATH: __placeholder__
# STORAGECLASS_NAME: __placeholder__
# STORAGECLASS_PROVISIONER: __placeholder__
Expand Down
3 changes: 3 additions & 0 deletions instances/template/kustomization.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ components:
# - ../../components/enable/private-registry # -- Update images name to private registry name
# CONFIG KEYS: PRIVATE_REGISTRY
#
# - ../../components/resources/imagepullsecrets # -- Add imagePullSecrets field to all resources
# CONFIG KEYS: IMAGE_PULL_SECRET_NAME
#
# ------------------------------------------------------------------------
# Permission Configurations
# IMPORTANT: Keep the components below as the LAST components
Expand Down