You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add ip masq merger to pipeline yaml
* add azure ip masq merger to signed binaries (acn official build) pipeline
todo: add azureIpMasqMergerVersion pipeline version somewhere
* add script and changes to signed pipeline
* add README to azure ip masq merger
* modify dockerfile to be consistent with binary naming
tested merged config live cluster with tcpdump
* update dockerfiles
* remove unused dockerfile components
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:b46476be0b5c9691ad20f78871819950c01433bdfad81d72c61618f4a6202b25 AS mariner-core
10
-
11
7
FROM go AS azure-ip-masq-merger
12
8
ARG OS
13
9
ARG VERSION
14
10
WORKDIR /azure-ip-masq-merger
15
11
COPY ./azure-ip-masq-merger .
16
12
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/ip-masq-merger -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" .
17
13
18
-
# TODO: Replace with scratch later
19
-
FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:b46476be0b5c9691ad20f78871819950c01433bdfad81d72c61618f4a6202b25 AS linux
FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows
`azure-ip-masq-merger` is a utility for merging multiple ip-masq-agent configuration files into a single, valid configuration for use in Kubernetes clusters.
4
+
5
+
## Description
6
+
7
+
The goal of this program is to periodically scan a directory for configuration fragments (YAML or JSON files starting with `ip-masq`), validate and merge them, and write the resulting configuration to a target directory for consumption. This allows us to combine non-masquerade CIDRs and related options between multiple files, for example if we had one ip masq config managed by the cloud provider and another supplied by the user.
8
+
9
+
## Usage
10
+
11
+
Follow the steps below to build and run the program:
12
+
13
+
1. Build the binary using `make`:
14
+
```bash
15
+
make azure-ip-masq-merger
16
+
```
17
+
or make an image:
18
+
```bash
19
+
make azure-ip-masq-merger-image
20
+
```
21
+
22
+
2. Deploy or copy the binary to your node(s).
23
+
24
+
3. Prepare your configuration fragments in the input directory (see below for defaults). Each file should be named with the prefix `ip-masq` and contain valid YAML or JSON for the ip-masq-agent config.
- The `--input` flag specifies the directory to scan for config fragments. Default: `/etc/config/`
31
+
- The `--output` flag specifies where to write the merged config. Default: `/etc/merged-config/`
32
+
33
+
5. The merged configuration will be written to the output directory as `ip-masq-agent`. If no valid configs are found, any existing merged config will be removed.
34
+
35
+
## Manual Testing
36
+
37
+
You can test the merger locally by creating sample config files in your input directory and running the merger.
38
+
39
+
## Configuration File Format
40
+
41
+
Each config fragment should be a YAML or JSON file that may have the following fields:
42
+
```yaml
43
+
nonMasqueradeCIDRs:
44
+
- 10.0.0.0/8
45
+
- 192.168.0.0/16
46
+
masqLinkLocal: true
47
+
masqLinkLocalIPv6: false
48
+
```
49
+
- `nonMasqueradeCIDRs`: List of CIDRs that should not be masqueraded. Appended between configs.
50
+
- `masqLinkLocal`: Boolean to enable/disable masquerading of link-local addresses. OR'd between configs.
51
+
- `masqLinkLocalIPv6`: Boolean to enable/disable masquerading of IPv6 link-local addresses. OR'd between configs.
52
+
53
+
## Debugging
54
+
55
+
Logs are output to standard error. Increase verbosity with the `-v` flag:
0 commit comments