generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
4cd365b
commit 05d9942
Showing
5 changed files
with
75 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "BW k8s Operator", | ||
"image": "mcr.microsoft.com/devcontainers/go:1.21", | ||
"runArgs": ["--network=host"], // needed for kind | ||
"postCreateCommand": "sudo .devcontainer/common/postCreateCommand.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"golang.go", | ||
"ms-kubernetes-tools.vscode-kubernetes-tools", | ||
"ms-azuretools.vscode-docker" | ||
], | ||
"settings": {} | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": { | ||
"runArgs": [ | ||
"--privileged" | ||
] | ||
}, | ||
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": { | ||
"fisher": true | ||
}, | ||
"ghcr.io/devcontainers-contrib/features/kind:1": {}, | ||
}, | ||
"secrets": { | ||
}, | ||
"mounts": [ | ||
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" | ||
], | ||
"remoteEnv": { | ||
"BWS_ACCESS_TOKEN": "${localEnv:BWS_ACCESS_TOKEN}", | ||
"BW_API_URL": "${localEnv:BW_API_URL}", | ||
"BW_IDENTITY_API_URL": "${localEnv:BW_IDENTITY_API_URL}", | ||
"BW_SECRETS_MANAGER_REFRESH_INTERVAL": "${localEnv:BW_SECRETS_MANAGER_REFRESH_INTERVAL}", | ||
}, | ||
"remoteUser": "root" // needed for kind: https://github.com/kubernetes-sigs/kind/issues/3196#issuecomment-1537260166 | ||
} |
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,10 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
networking: | ||
# WARNING: It is _strongly_ recommended that you keep this the default | ||
# (127.0.0.1) for security reasons. However it is possible to change this. | ||
apiServerAddress: "127.0.0.1" | ||
# By default the API server listens on a random open port. | ||
# You may choose a specific port but probably don't need to in most cases. | ||
# Using a random port makes it easier to spin up multiple clusters. | ||
apiServerPort: 8573 |
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,21 @@ | ||
#!/usr/bin/env bash | ||
apt-get update | ||
apt-get install -y kubernetes-client musl-tools # kubectl | ||
kind create cluster --config .devcontainer/common/kind-config.yaml | ||
# kind export kubeconfig | ||
|
||
PATH="$PATH:/usr/local/go/bin" make setup | ||
PATH="$PATH:/usr/local/go/bin" make install | ||
|
||
# shellcheck disable=SC2016 | ||
echo ' | ||
devcontainer setup complete! | ||
Be sure to set the following environment variables: | ||
export BWS_ACCESS_TOKEN= | ||
export BW_API_URL= | ||
export BW_IDENTITY_API_URL= | ||
And run the following before attempting to set the Bitwarden access token secret: | ||
kubectl create secret generic bw-auth-token -n some-namespace --from-literal=token="$BWS_ACCESS_TOKEN" | ||
' |
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