Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #46 from kurtosis-tech/egomes/add-local-flake
Browse files Browse the repository at this point in the history
fix: add local flake
  • Loading branch information
lostbean authored Sep 26, 2024
2 parents 2f93ac4 + 55a9dec commit d305325
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 18 deletions.
174 changes: 174 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
description = "Go development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
kardinal.url = "github:kurtosis-tech/kardinal/4be70324e7b2";
};
outputs = {
self,
nixpkgs,
flake-utils,
unstable,
kardinal,
...
}:
flake-utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
kardinal = kardinal.outputs.packages.${system};
})
];
};
in {
devShells.default = let
start-local-cluster = pkgs.writeShellApplication {
name = "start-local-cluster";
runtimeInputs = with pkgs; [minikube istioctl kubectl];
text = ''
kubectl config set-context minikube
minikube start --driver=docker
minikube addons enable ingress
minikube addons enable metrics-server
istioctl install --set profile=minimal --set meshConfig.accessLogFile=/dev/stdout -y
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.10/samples/addons/prometheus.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.10/samples/addons/grafana.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.10/samples/addons/jaeger.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.10/samples/addons/kiali.yaml
kubectl rollout status deployment/kiali -n istio-system
'';
};

kardinal-cli = pkgs.stdenv.mkDerivation {
name = "kardinal";
dontUnpack = true;
buildInputs = [pkgs.kardinal.kardinal-cli];
installPhase = ''
mkdir -p $out/bin
ln -s ${pkgs.kardinal.kardinal-cli}/bin/kardinal.cli $out/bin/kardinal
'';
};
in
pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
go-tools
golangci-lint
reflex

# local demo tools
kardinal-cli
minikube
kubectl
istioctl
telepresence2

# Scripts
start-local-cluster
];

shellHook = ''
source <(kardinal completion bash)
echo "Go development environment loaded"
go version
'';
};
}
);
}
40 changes: 22 additions & 18 deletions obd-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,7 @@ spec:
protocol: TCP
appProtocol: HTTP
targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: frontend-external
annotations:
kardinal.dev.service/ingress: "true"
kardinal.dev.service/host: "baseline.app.localhost"
spec:
type: LoadBalancer
selector:
app: frontend
ports:
- name: http
port: 80
targetPort: 8080
protocol: TCP
appProtocol: HTTP

---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -332,3 +315,24 @@ spec:
targetPort: 8070
protocol: TCP
appProtocol: HTTP

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kardinal.dev.service/ingress: "true"
name: ingress
spec:
rules:
- host: web.app.localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80

0 comments on commit d305325

Please sign in to comment.