I'm trying to deploy bazel-remote, but when I try to:
curl http://bazel-remote.dev.azr.myhost.com:80/status
into the ingress host, I'm getting:
<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>
back. For reference, I've tried:
curl http://bazel-remote.dev.azr.myhost.com:8080/status
but it gave the same results as when I specified the port number as any arbitrary port, and timed out.
I checked the status of each of the pods, services, ingresses on lens, and they all seem to be running fine. Similar story for the volumes. I've deployed them through Terraform, and they all seem to be operating fine.
Strange things I don't get:
- The pods enter
CrashLoop
when I try specifyBAZEL_REMOTE_HOST
in the ConfigMap. Most likely due to this. http://bazel-remote.dev.azr.myhost.com:8080/metrics
is accessible via my web browser, detailing the bazel-remote caching capabilities.- When I specified in
.bazelrc
:build --remote_cache=http://bazel-remote.dev.azr.myhost.com:8080
, it didn't work, but when I took the pod IP addresses directly, and put that instead, the remote caching worked as intended.
Suspects: I suspect there is something wrong with my ingress, since the pods are definitely up, and functioning if I target them directly.
Ingress:
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
namespace: infra--bazel-remote-cache
name: bazel-remote-cache
annotations:
kubernetes.io/ingress.class: nginx-internal
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
cert-manager.io/cluster-issuer: selfsigned-cluster-issuer
spec:
tls:
- hosts:
- bazel-remote.dev.azr.myhost.com
secretName: tls-secret
rules:
- host: bazel-remote.dev.azr.myhost.com:
http:
paths:
- backend:
serviceName: bazel-remote-service
servicePort: 8080
path: /(.*)
Configmap
apiVersion: v1
kind: ConfigMap
metadata:
name: bazel-remote-cache-config
namespace: infra--bazel-remote-cache
data:
BAZEL_REMOTE_DIR: /mnt/bazel_remote_backend
BAZEL_REMOTE_MAX_SIZE: "10"
BAZEL_REMOTE_GRPC_PORT: "9092"
BAZEL_REMOTE_PORT: "8080"
BAZEL_REMOTE_ENABLE_ENDPOINT_METRICS: "true"
BAZEL_REMOTE_EXPERIMENTAL_REMOTE_ASSET_API: "true"
Deployment & Service
apiVersion: apps/v1
kind: Deployment
metadata:
name: bazel-remote-cache
namespace: infra--bazel-remote-cache
spec:
replicas: 1
selector:
matchLabels:
app: bazel-remote-cache
template:
metadata:
labels:
app: bazel-remote-cache
spec:
containers:
- name: bazel-remote-cache
image: buchgr/bazel-remote-cache:v2.1.1
resources:
limits:
memory: 256Mi
cpu: "200m"
requests:
memory: 256Mi
cpu: "200m"
volumeMounts:
- mountPath: "/mnt/bazel_remote_backend"
name: bazel-remote-cache
ports:
- containerPort: 8080
protocol: TCP
envFrom:
- configMapRef:
name: bazel-remote-cache-config
volumes:
- name: bazel-remote-cache
persistentVolumeClaim:
claimName: pvc-bazel-remote
---
apiVersion: v1
kind: Service
metadata:
name: bazel-remote-service
namespace: infra--bazel-remote-cache
spec:
type: ClusterIP
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: bazel-remote-cache