Last active
September 13, 2023 21:09
-
-
Save juliusl/171e2f65e2d71f3a32b1f16966f7160c to your computer and use it in GitHub Desktop.
Enable Pre-Installed ACR Mirror
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 | |
systemctl enable --now acr-mirror | |
// Uncomment to enable Node Monitoring | |
// systemctl enable --now acr-nodemon | |
# 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 *.azurecr.io | |
curl -X PUT 'localhost:8578/config?ns=_default&enable_suffix=azurecr.io&stream_format=overlaybd&enable_containerd=true' | |
# Enable overlaybd | |
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