Skip to content

Commit

Permalink
Sessions namespace controller - Queries ISPyB database, creates/delet…
Browse files Browse the repository at this point in the history
…es namespaces with session names, creates roles and service accounts
  • Loading branch information
iamvigneshwars committed May 17, 2024
1 parent 5475c98 commit 622f456
Show file tree
Hide file tree
Showing 16 changed files with 3,338 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM docker.io/library/rust:1.78.0-bookworm

RUN rustup component add rustfmt clippy

# Download and install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x kubectl && \
mv kubectl /usr/local/bin/kubectl

# Download and install Krew
RUN set -x; cd "$(mktemp -d)" && \
OS="$(uname | tr '[:upper:]' '[:lower:]')" && \
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \
KREW="krew-${OS}_${ARCH}" && \
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \
tar zxvf "${KREW}.tar.gz" && \
./"${KREW}" install krew && \
mv "${KREW}" /usr/local/bin/krew

# Add krew to the PATH
ENV PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

RUN krew install oidc-login

# Download and install vcluster
RUN wget https://github.com/loft-sh/vcluster/releases/download/v0.19.5/vcluster-linux-amd64 -O /usr/local/bin/vcluster && \
chmod +x /usr/local/bin/vcluster

RUN mv /usr/local/bin/vcluster /bin/vcluster

COPY ./config_argus /root/.kube/config

COPY ./ca.crt /root/ca.crt
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/common-utils:2.4.2": {
"version": "2.4.2",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:bebfdcd6097a35506bf0f064a31e52ad4205467d9d7a226a688f51b851c88b65",
"integrity": "sha256:bebfdcd6097a35506bf0f064a31e52ad4205467d9d7a226a688f51b851c88b65"
}
}
}
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Workflows",
"build": {
"context": ".",
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"ms-kubernetes-tools.vscode-kubernetes-tools"
]
}
},
// "features": {
// "ghcr.io/devcontainers/features/common-utils:2.4.2": {}
// },
"runArgs": [
"--security-opt=label=type:container_runtime_t",
"--env-file=.devcontainer/.env"
],
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"workspaceFolder": "${localWorkspaceFolder}"
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Secrets
.env
.vscode
# k8s configs
ca.crt
config_argus
# vcluster config
kubeconfig.yaml
1 change: 1 addition & 0 deletions sessionspaces/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
Loading

0 comments on commit 622f456

Please sign in to comment.