File tree 2 files changed +26
-2
lines changed
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 21
21
// "forwardPorts": [],
22
22
23
23
// This should create the cluster on first run, then never again.
24
- "onCreateCommand" : " k3d cluster create --registry-create myregistry > k3d_creation.log 2>&1 " ,
24
+ "onCreateCommand" : " k3d cluster create --registry-create myregistry 2>&1 | tee k3d_creation.log" ,
25
25
// Add the following to auto deploy manifests: --volume /tmp/test-manifests:/var/lib/rancher/k3s/server/manifests/test
26
26
// Uncomment the next line to run commands after the container is created.
27
27
// "postCreateCommand": "lein deps",
Original file line number Diff line number Diff line change 1
1
(ns user
2
2
(:require [clojure.string :as str]
3
3
[clojure.set :as set]
4
- ))
4
+ [clojure.java.shell :refer [sh]]
5
+ [clojure.java.io :as io]
6
+ [kubernetes-api.core :as k8s]))
7
+
8
+ (defn get-config []
9
+ (:out (sh " k3d" " kubeconfig" " get" " k3s-default" )))
10
+
11
+ (comment
12
+ (def cf (get-config ))
13
+ (def api-server
14
+ (-> (re-seq #"server: (.*)" cf) first second str/trim))
15
+ (spit " ca.crt" (-> (re-seq #"certificate-authority-data: (.*)" cf) first second str/trim))
16
+ (spit " client-cert.pem" (-> (re-seq #"client-certificate-data: (.*)" cf) first second str/trim))
17
+ ; ; This next one might need to be a java keystore
18
+ (spit " client.key" (-> (re-seq #"client-key-data: (.*)" cf) first second str/trim))
19
+
20
+ (def ca-path (.getAbsolutePath (io/file " ca.crt" )))
21
+ (def client-cert-path (.getAbsolutePath (io/file " client-cert.pem" )))
22
+ (def client-key-path (.getAbsolutePath (io/file " client.key" )))
23
+
24
+ (def k8s (k8s/client api-server {:ca-cert ca-path
25
+ :client-cert client-cert-path
26
+ :client-key client-key-path}))
27
+ ; ; end comment
28
+ )
You can’t perform that action at this time.
0 commit comments