Sign inSign up

ucsdets/group-sync

By ucsdets

•Updated over 2 years ago

Image
0

100K+

ucsdets/group-sync repository overview

Sync groups to DSMLP from AWSEd. Creates workspaces and pod security policies (superceded by OPA)

Usage:

docker run --rm -it --network host \
-e AWSED_API_KEY=key \
-v admin.conf:/root/.kube/config:ro \
ucsd-ets/group-sync:latest
kubectl delete pod group-sync -n group-sync
kubectl run group-sync -it \
--namespace=group-sync \
--generator=run-pod/v1 \
--image=ucsdets/group-sync:latest \
--image-pull-policy=Always \
--env AWSED_ENDPOINT=https://awsed-dev.ucsd.edu/api \
--env AWSED_API_KEY=XYZ \
--env AWSED_API_SLUG=dsmlp \
--env COURSE_IDS=BIPN162_S120_A00 \
--env PSP_ENABLED=False \
--env HOMES_ENABLED=True \
--env FORCE_CREATE=False \
--serviceaccount default \
--requests=cpu=100m,memory=256Mi

Config

  • Kubernetes config is expected in ~/.kube/config or supplied as a config map
  • Specify AWSED_API_KEY as an environment variable
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: {{ include "group-sync.fullname" . }}
rules:
- apiGroups: ["extensions", "policy"]
  resources: ["podsecuritypolicies"]
  verbs: ["get", "patch", "update"]
- apiGroups: [""]
  resources:
  - persistentvolumeclaims
  verbs:
  - list
  - create
  - get
- apiGroups: [""]
  resources:
  - persistentvolumes
  verbs:
  - get
  - list
  - create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "group-sync.fullname" . }}
subjects:
- kind: ServiceAccount
  namespace: group-sync
  name: default
roleRef:
  kind: ClusterRole #this must be Role or ClusterRole
  name: group-sync # this must match the name of the Role or ClusterRole you wish to bind to
  apiGroup: rbac.authorization.k8s.io

⁠Dev Environment

⁠Ubuntu/WSL 2

<cd to repository base>
sudo apt install python3.8-venv

⁠macOS with Homebrew⁠

<cd to repository base>
brew install [email protected]

⁠On both platforms:

python3.8 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

⁠Tests

For unit tests:
tox

For integration tests:
./run_integration_tests.sh

NOTE: Docker required for integration tests

⁠Compile protos

tox -e protoc

Tag summary

Content type

Image

Digest

sha256:f1064becb…

Size

367 MB

Last updated

over 2 years ago

docker pull ucsdets/group-sync