Last active
June 16, 2023 01:11
-
-
Save juliusl/bd7b012bd89f96c7b763b07f059b012a to your computer and use it in GitHub Desktop.
Deploy ACR Mirror via Daemonset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Builds/Installs mirror from source | |
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: nsenter-actions | |
labels: | |
app: nsenter | |
data: | |
wasm: | | |
#!/usr/bin/env bash | |
set -xe | |
if [[ -f /opt/sentinel ]]; then | |
if [[ ! -z "$1" ]]; then | |
echo "received positional argument, forcing cleanup" | |
rm /opt/sentinel || true | |
else | |
echo "Already ran, exiting" | |
exit 0 | |
fi | |
fi | |
sudo apt-get update | |
pushd /tmp || exit 1 | |
wget 'https://github.com/juliusl/lifec_registry/releases/download/v0.1.0-test-build-1/acr-mirror-2204-v0.1.0-test-build-1-ad25f.deb' | |
sudo apt-get install './acr-mirror-2204-v0.1.0-test-build-1-ad25f.deb' -y | |
rm './acr-mirror-2204-v0.1.0-test-build-1-ad25f.deb' | |
popd | |
# These libraries are needed for overlaybd-tcmu | |
sudo /opt/acr/tools/overlaybd/install.sh | |
sudo /opt/acr/tools/overlaybd/enable-http-auth.sh | |
modprobe target_core_user | |
# Enabling mirror for teleportmetricstest | |
curl -X PUT 'localhost:8578/config?ns=teleportmetricstest.azurecr.io&stream_format=overlaybd&enable_containerd=true' | |
sudo /opt/acr/tools/overlaybd/enable.sh | |
touch /opt/sentinel | |
--- | |
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: &name nsenter | |
labels: | |
app: *name | |
spec: | |
selector: | |
matchLabels: | |
app: *name | |
template: | |
metadata: | |
labels: | |
app: *name | |
spec: | |
hostNetwork: true | |
hostPID: true | |
containers: | |
- image: docker.io/alexeldeib/nsenter:latest # https://github.com/alexeldeib/azbench/blob/main/images/nsenter/entrypoint.sh | |
imagePullPolicy: Always | |
name: *name | |
args: ["wasm"] | |
resources: | |
requests: | |
cpu: 0.5 | |
memory: 2000Mi | |
limits: | |
cpu: 0.5 | |
memory: 2000Mi | |
securityContext: | |
privileged: true | |
volumeMounts: | |
- name: actions | |
mountPath: "/opt/actions" | |
- name: hostmount | |
mountPath: "/mnt/actions" | |
volumes: | |
- name: hostmount | |
hostPath: | |
path: /opt/actions | |
type: DirectoryOrCreate | |
- name: actions | |
configMap: | |
name: nsenter-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Release - https://github.com/juliusl/lifec_registry/releases/tag/v0.1.0-dev-19