Skip to content

Commit

Permalink
create namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
davejrt committed Jul 16, 2021
1 parent 6a4264a commit a7f8c64
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .buildkite/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ if [[ "${VERBOSE:-"false"}" == "true" ]]; then
TEST_ARGS+=("-v")
fi

kubectl create ns ns-sourcegraph

TEST_ARGS+=("./...")

echo "--- Running integration tests"
Expand Down
39 changes: 39 additions & 0 deletions base/blackbox-exporter/blackbox-exporter.ConfigMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: blackbox-exporter
data:
blackbox.yml: |
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: [] # Defaults to 2xx
method: GET
no_follow_redirects: false
fail_if_not_ssl: true
tls_config:
insecure_skip_verify: true
preferred_ip_protocol: "ip4" # defaults to "ip6"
ip_protocol_fallback: false # no fallback to "ip6"
http_2xx_custom_headers:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: [] # Defaults to 2xx
method: GET
headers:
Accept: "application/vnd.sourcegraph.api+json;version=20180621"
no_follow_redirects: false
fail_if_not_ssl: true
tls_config:
insecure_skip_verify: false
preferred_ip_protocol: "ip4" # defaults to "ip6"
ip_protocol_fallback: false # no fallback to "ip6"
48 changes: 48 additions & 0 deletions base/blackbox-exporter/blackbox-exporter.Deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
description: Collect metrics on http endpoints.
labels:
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: blackbox-exporter
spec:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: blackbox-exporter
strategy:
type: Recreate
template:
metadata:
labels:
deploy: sourcegraph
app: blackbox-exporter
spec:
containers:
- image: prom/blackbox-exporter:v0.17.0@sha256:d3e823580333ceedceadaa2bfea10c8efd4700c8ec0415df72f83c34e1f93314
name: blackbox
command: ["/bin/blackbox_exporter","--config.file=/config/blackbox.yml"]
ports:
- containerPort: 9115
name: blackbox
volumeMounts:
- mountPath: /config
name: config
resources:
limits:
cpu: "1"
memory: 1G
requests:
cpu: 500m
memory: 500m
securityContext:
runAsUser: 0
volumes:
- configMap:
defaultMode: 0777
name: blackbox-exporter
name: config
14 changes: 14 additions & 0 deletions base/blackbox-exporter/blackbox-exporter.Service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: blackbox-exporter
spec:
ports:
- port: 9115
targetPort: 9115
selector:
app: blackbox-exporter
type: ClusterIP
11 changes: 11 additions & 0 deletions sc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# base/sourcegraph.StorageClass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: sourcegraph
labels:
deploy: sourcegraph
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd # This configures SSDs (recommended).
reclaimPolicy: Delete
11 changes: 10 additions & 1 deletion tests/integration/fresh/step1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ const storageClass = new k8s.storage.v1.StorageClass(
{ provider: k8sProvider }
)

const nameSpace = new k8s.v1.nameSpace(
'sourcegraph-namespace',
{
metadata: {
}
},
{ provider: k8sProvider }
)

const globOptions = {
ignore: ['**/kustomization.yaml'],
}
Expand All @@ -39,7 +48,7 @@ baseFiles.then(
},
{
providers: { kubernetes: k8sProvider },
dependsOn: [storageClass],
dependsOn: [storageClass,nameSpace],
}
)
)
Expand Down

0 comments on commit a7f8c64

Please sign in to comment.