-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
715 additions
and
0 deletions.
There are no files selected for viewing
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
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
71 changes: 71 additions & 0 deletions
71
src/ClusterBootstrap/services/allowlist-manager/allowlist-manager.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: allowlist-manager-configmap | ||
namespace: kube-system | ||
data: | ||
config.yaml: |- | ||
subscription: {{cnf["azure_cluster"]["subscription"]}} | ||
resource_group: {{cnf["azure_cluster"]["resource_group"]}} | ||
nsg_name: {{cnf["azure_cluster"]["nsg_name"]}} | ||
tenant_id: {{cnf["admin-service-principal"]["tenant_id"]}} | ||
client_id: {{cnf["admin-service-principal"]["client_id"]}} | ||
password: {{cnf["admin-service-principal"]["password"]}} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: allowlist-manager | ||
namespace: kube-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: allowlist-manager | ||
template: | ||
metadata: | ||
name: allowlist-manager | ||
labels: | ||
task: access-control | ||
app: allowlist-manager | ||
spec: | ||
hostNetwork: true | ||
nodeSelector: | ||
allowlist-manager: active | ||
containers: | ||
- name: allowlist-manager | ||
image: {{cnf["worker-dockerregistry"]}}/{{cnf["dockerprefix"]}}/{{cnf["allowlistmanager"]}}:{{cnf["dockertag"]}} | ||
command: | ||
- "python3" | ||
- "/allowlist-manager/main.py" | ||
args: | ||
- '--config=/etc/allowlist-manager' | ||
- '--log=/var/log/allowlist-manager' | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- mountPath: /etc/allowlist-manager | ||
name: config-volume | ||
- mountPath: /var/log/allowlist-manager | ||
name: log | ||
{% if cnf["private_docker_registry_username"] %} | ||
imagePullSecrets: | ||
- name: svccred | ||
{% endif %} | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: allowlist-manager-configmap | ||
- name: log | ||
hostPath: | ||
path: /var/log/allowlist-manager | ||
tolerations: | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
- key: node.kubernetes.io/memory-pressure | ||
operator: "Exists" | ||
- key: node.kubernetes.io/disk-pressure | ||
operator: "Exists" | ||
- key: node-role.kubernetes.io/master | ||
operator: "Exists" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
allowlist-manager.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#!/bin/bash |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:3.7 | ||
|
||
RUN pip3 install requests python-dateutil pyyaml pytz | ||
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash | ||
|
||
WORKDIR /allowlist-manager | ||
|
||
ADD main.py /allowlist-manager/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
|
||
from main import RestUtil | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--user", | ||
"-u", | ||
required=True) | ||
parser.add_argument("--ip", | ||
"-i", | ||
required=True) | ||
parser.add_argument("--rest", | ||
"-r", | ||
required=True) | ||
args = parser.parse_args() | ||
|
||
rest_util = RestUtil({"rest_url": args.rest}) | ||
rest_util.add_allow_record(args.user, args.ip) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
|
||
from main import RestUtil | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--user", | ||
"-u", | ||
required=True) | ||
parser.add_argument("--rest", | ||
"-r", | ||
required=True) | ||
args = parser.parse_args() | ||
|
||
rest_util = RestUtil({"rest_url": args.rest}) | ||
rest_util.delete_allow_record(args.user) | ||
|
Oops, something went wrong.