Skip to content

Commit ed9e8ae

Browse files
Helm direct example / renaming (#9)
1 parent d6849ce commit ed9e8ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+203
-161
lines changed

β€Ž.devcontainer/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
99
'poetry==1.6.1' \
1010
'pre-commit==3.6.0' \
1111
'pip==23.2.1'
12-
RUN npm install -g @devcontainers/[email protected]
1312
ENV DEBIAN_FRONTEND=noninteractive
1413
RUN sudo apt-get update -y && sudo apt-get install -y \
1514
iputils-ping \
1615
traceroute \
1716
kmod \
1817
vim
19-
ENV PATH="/home/vscode/.local/bin/:$PATH"
20-
ENV EDITOR=vim
18+
ENV PATH="/home/vscode/.local/bin/:$PATH"
19+
ENV EDITOR=vim
20+
ENV HOMEBREW_NO_AUTO_UPDATE=1
21+
ENV HOMEBREW_NO_INSTALL_UPGRADE=1

β€Ž.devcontainer/ci/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/python-3/.devcontainer/base.Dockerfile
2+
ARG VARIANT="3.11"
3+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} as devcontainer

β€Ž.devcontainer/ci/devcontainer.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"remoteUser": "vscode",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"target": "devcontainer",
6+
"context": "..",
7+
"args": {
8+
"VARIANT": "3.11",
9+
"INSTALL_NODE": "true",
10+
"NODE_VERSION": "18.7"
11+
}
12+
},
13+
"runArgs": [
14+
"--network=host",
15+
],
16+
"features": {
17+
"ghcr.io/devcontainers/features/terraform:1": {
18+
"version": "1.6.2"
19+
},
20+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
21+
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
22+
"helm": "3.14.0",
23+
"version": "1.27"
24+
},
25+
"ghcr.io/rio/features/k3d:1": {},
26+
}
27+
}

β€Ž.devcontainer/devcontainer.json

+2-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"postCreateCommand": "make post-create",
3-
"postStartCommand": "make post-start",
42
"remoteUser": "vscode",
53
"customizations": {
64
"vscode": {
@@ -9,10 +7,7 @@
97
"python.pythonPath": "/usr/local/bin/python"
108
},
119
"extensions": [
12-
"ms-python.python",
1310
"mutantdino.resourcemonitor",
14-
"github.copilot",
15-
"github.copilot-chat"
1611
]
1712
}
1813
},
@@ -31,9 +26,9 @@
3126
"version": "1.6.2"
3227
},
3328
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
34-
"ghcr.io/devcontainers-contrib/features/kind:1": {},
3529
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
36-
"version": "1.25.6"
30+
"helm": "3.14.0",
31+
"version": "1.27"
3732
},
3833
"ghcr.io/rio/features/k3d:1": {},
3934
"ghcr.io/devcontainers-contrib/features/terraform-docs:1": {
@@ -47,20 +42,4 @@
4742
"ghcr.io/devcontainers-contrib/features/argo-cd:1": {
4843
},
4944
},
50-
"mounts": [
51-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
52-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
53-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
54-
// "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind,consistency=cached",
55-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.zsh_history,target=/home/vscode/.zsh_history,type=bind,consistency=cached",
56-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshrc,target=/home/vscode/.zshrc,type=bind,consistency=cached",
57-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshenv,target=/home/vscode/.zshenv,type=bind,consistency=cached",
58-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.terraform.d,target=/home/vscode/.terraform.d,type=bind,consistency=cached",
59-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.azure,target=/home/vscode/.azure,type=bind,consistency=cached",
60-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/infracost,target=/home/vscode/.config/infracost,type=bind,consistency=cached",
61-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/gcloud,target=/home/vscode/.config/gcloud,type=bind,consistency=cached",
62-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/starship.toml,target=/home/vscode/.config/starship.toml,type=bind,consistency=cached",
63-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.kube,target=/home/vscode/.kube,type=bind,consistency=cached",
64-
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached",
65-
]
6645
}

β€Ž.devcontainer/vm/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
99
'poetry==1.6.1' \
1010
'pre-commit==3.6.0' \
1111
'pip==23.2.1'
12-
RUN npm install -g @devcontainers/cli@v0.30.0
12+
RUN npm install -g @devcontainers/cli@v0.57.0
1313
ENV DEBIAN_FRONTEND=noninteractive
1414
RUN sudo apt-get update -y && sudo apt-get install -y \
1515
iputils-ping \
1616
traceroute \
1717
kmod \
1818
vim
19-
ENV PATH="/home/vscode/.local/bin/:$PATH"
20-
ENV EDITOR=vim
19+
ENV PATH="/home/vscode/.local/bin/:$PATH"
20+
ENV EDITOR=vim
21+
ENV HOMEBREW_NO_AUTO_UPDATE=1
22+
ENV HOMEBREW_NO_INSTALL_UPGRADE=1

β€Ž.devcontainer/vm/devcontainer.json

+5-18
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,27 @@
2626
"NODE_VERSION": "18.7"
2727
}
2828
},
29-
"runArgs": [ // maybe remove this
29+
"runArgs": [
3030
"--network=host",
3131
],
3232
"features": {
33-
"ghcr.io/devcontainers-contrib/features/cloudflared:1": {},
34-
"ghcr.io/devcontainers/features/go:1": {
35-
},
36-
"ghcr.io/devcontainers/features/aws-cli": {
37-
"version": "2.6.3"
33+
"ghcr.io/meaningful-ooo/devcontainer-features/homebrew:2": {
34+
"shallowClone": true
3835
},
3936
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
4037
"omzPlugins": "zsh-syntax-highlighting zsh-autosuggestions"
4138
},
4239
"ghcr.io/devcontainers-contrib/features/starship-homebrew:1": {},
43-
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
44-
"version": "2.59.0"
45-
},
46-
"ghcr.io/devcontainers/features/azure-cli:1": {},
4740
"ghcr.io/devcontainers/features/terraform:1": {
4841
"version": "1.6.2"
4942
},
5043
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
51-
"ghcr.io/devcontainers-contrib/features/kind:1": {},
52-
"ghcr.io/devcontainers-contrib/features/packer-asdf:2": {},
5344
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
54-
"version": "1.25.6"
45+
"helm": "3.14.0",
46+
"version": "1.27"
5547
},
5648
"ghcr.io/rio/features/k3d:1": {},
5749
// "ghcr.io/devcontainers/features/nix:1": {},
58-
"ghcr.io/devcontainers-contrib/features/infracost:1": {
59-
"version": "0.10.30"
60-
},
61-
"ghcr.io/dhoeric/features/google-cloud-cli:1": {
62-
},
6350
"ghcr.io/devcontainers-contrib/features/terraform-docs:1": {
6451
},
6552
"ghcr.io/devcontainers/features/github-cli:1": {

β€Ž.github/workflows/test.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: test
2+
on:
3+
# schedule:
4+
# - cron: 0 13 * * 1 # Every Monday at 1PM UTC (9AM EST)
5+
pull_request:
6+
jobs:
7+
run-example:
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v2
11+
- run: npm install -g @devcontainers/[email protected]
12+
- run: devcontainer up --workspace-folder=. --config .devcontainer/ci/devcontainer.json
13+
- run: devcontainer exec --workspace-folder=. --config .devcontainer/ci/devcontainer.json ./scripts/test.sh
14+
test-codespace:
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- uses: actions/checkout@v2
18+
- run: npm install -g @devcontainers/[email protected]
19+
- run: devcontainer up --workspace-folder=.

β€ŽMakefile

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ SHELLOPTS := $(if $(SHELLOPTS),$(SHELLOPTS):, )xtrace pipefail errexit nounset
22

33
.PHONY: post-create
44
post-create:
5-
@echo "post-create"
6-
brew install helm-docs
7-
./scripts/setup-krew.sh
5+
./scripts/post-create.sh
86

97
.PHONY: post-start
108
post-start:
@@ -41,14 +39,17 @@ k3d-delete:
4139
k3d cluster delete dev
4240

4341
TIMESTAMP := $(shell date -u "+%Y-%m-%d-T%H-%M-%S")
44-
VERSION := 0.1-$(TIMESTAMP)
45-
42+
GIT_TAG := $(shell git describe --tags `git rev-list --tags --max-count=1` | sed 's/^v//')
43+
VERSION ?= $(if $(filter $(PROD),true),$(GIT_TAG),$(GIT_TAG)-dev+$(TIMESTAMP))
4644
build-chart:
47-
rm -rf helm/treebeard-kubeflow-*.tgz
48-
helm package helm/treebeard-kubeflow -d helm --version $(VERSION)
45+
rm -rf helm/*.tgz
46+
helm package helm/kubeflow-core -d helm --version $(VERSION)
47+
yq eval '.targetRevision = "$(VERSION)"' -i helm/kubeflow/values.yaml
48+
helm package helm/kubeflow -d helm --version $(VERSION)
4949

5050
push-chart: build-chart
51-
helm push helm/treebeard-kubeflow-*.tgz oci://ghcr.io/treebeardtech/helm
51+
helm push helm/kubeflow-core-$(VERSION).tgz oci://ghcr.io/treebeardtech/helm
52+
helm push helm/kubeflow-$(VERSION).tgz oci://ghcr.io/treebeardtech/helm
5253

5354
helm-repo-login:
5455
echo $(GHCR_PAT) | docker login ghcr.io -u alex-treebeard --password-stdin

β€ŽREADME.md

+14-2

β€Žexamples/eks-https-loadbalancer/kubeflow.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module "treebeardkf" {
22
count = var.enable_treebeardkf ? 1 : 0
33
source = "../.."
4-
bootstrap_values = [
4+
kubeflow_values = [
55
<<EOF
66
sources:
77
- repoURL: 'https://github.com/treebeardtech/treebeard-kubeflow-gitops'

β€Žexamples/helm-direct/README.md

+3

β€Žexamples/helm-direct/main.tf

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
terraform {
3+
required_providers {
4+
helm = {
5+
source = "hashicorp/helm"
6+
version = "~> 2.12.1"
7+
}
8+
}
9+
backend "local" {
10+
}
11+
}
12+
13+
variable "kubeconfig" {
14+
type = string
15+
}
16+
17+
provider "helm" {
18+
kubernetes {
19+
config_path = var.kubeconfig
20+
}
21+
}
22+
23+
resource "helm_release" "argo_cd" {
24+
name = "argocd"
25+
namespace = "argocd"
26+
chart = "argo-cd"
27+
repository = "https://argoproj.github.io/argo-helm"
28+
version = "6.4.1"
29+
create_namespace = true
30+
values = [
31+
<<EOF
32+
dex:
33+
enabled: false
34+
EOF
35+
]
36+
}
37+
38+
resource "helm_release" "kubeflow" {
39+
name = "kubeflow"
40+
namespace = "argocd"
41+
chart = "${path.module}/../../helm/kubeflow"
42+
values = [
43+
<<EOF
44+
EOF
45+
]
46+
depends_on = [
47+
helm_release.argo_cd
48+
]
49+
}

β€Žexamples/k3s-existing-istio/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ resource "null_resource" "completed" {
102102

103103
module "treebeardkf" {
104104
source = "../.."
105-
bootstrap_values = [
105+
kubeflow_values = [
106106
<<EOF
107107
valuesObject:
108108
certManager:

β€Žexamples/k3s-gitops/main.tf

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ locals {
2626

2727
module "treebeardkf" {
2828
source = "../.."
29-
bootstrap_values = [
29+
kubeflow_values = [
3030
<<EOF
3131
sources:
3232
- repoURL: 'https://github.com/treebeardtech/treebeard-kubeflow-gitops'
@@ -37,8 +37,7 @@ valueFiles:
3737
valuesObject:
3838
# example of inline config where terraform vars can be injected
3939
debug: ${local.debug}
40-
syncPolicy: null
41-
40+
# syncPolicy: null # uncomment to debug
4241
EOF
4342
]
4443
depends_on = [
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
apiVersion: v2
2-
name: treebeard-kubeflow
2+
name: kubeflow-core
33
version: 0.1-0

β€Žhelm/treebeard-kubeflow/README.md renamed to β€Žhelm/kubeflow-core/README.md

+5-1

β€Žhelm/treebeard-kubeflow/templates/000-debug-secret.yaml renamed to β€Žhelm/kubeflow-core/templates/000-debug-secret.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: kubeflow-helm-debug
5+
name: kubeflow-debug
66
type: Opaque
77
stringData:
88
helm-values: |
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
apiVersion: v2
2-
name: bootstrap
2+
name: kubeflow
33
version: 0.1.0

0 commit comments

Comments
Β (0)