-
Notifications
You must be signed in to change notification settings - Fork 39
/
k3d.yaml
141 lines (121 loc) · 4.91 KB
/
k3d.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#
# Author: Hari Sekhon
# Date: [% DATE # 2023-04-02 21:52:21 +0100 (Sun, 02 Apr 2023) %]
#
# vim:ts=2:sts=2:sw=2:et
#
# run: k3d cluster create --config k3d.yaml
#
# [% URL %]
#
# [% LICENSE %]
#
# [% MESSAGE %]
#
# [% LINKEDIN %]
#
# ============================================================================ #
# K 3 d C o n f i g
# ============================================================================ #
# https://k3d.io/v5.4.9/usage/configfile/#all-options-example
# Tip: $ENVIRONMENT_VARIABLES are expanded in the config file
# Order of precedence overrides:
#
# Internal Setting > CLI Flag > Environment Variable > Config File > (k/v store >) Defaults
# Settings mostly follow --flag-names
---
# schema valiation:
# https://github.com/k3d-io/k3d/blob/main/pkg/config/v1alpha4/schema.json
apiVersion: k3d.io/v1alpha4
kind: Simple
metadata:
name: default
servers: 1 # 2+ will switch k3s internal datastore from sqlite to etcd
#agents: 1 # none by default
#kubeAPI: # same as `--api-port myhost.my.domain:6445` (where the name would resolve to 127.0.0.1)
# host: "myhost.my.domain" # important for the `server` setting in the kubeconfig
# hostIP: "127.0.0.1" # where the Kubernetes API will be listening on
# hostPort: "6445" # where the Kubernetes API listening port will be mapped to on your host system
#image: rancher/k3s:v1.20.4-k3s1 # same as `--image rancher/k3s:v1.20.4-k3s1`
#network: my-custom-net # same as `--network my-custom-net`
#subnet: "172.28.0.0/16" # same as `--subnet 172.28.0.0/16`
#token: superSecretToken # same as `--token superSecretToken`
# mount your local path into the server and all agents
#
#volumes: # repeatable flags are represented as YAML lists
# - volume: /my/host/path:/path/in/node # same as `--volume '/my/host/path:/path/in/node@server:0;agent:*'`
# nodeFilters:
# - server:0
# - agent:*
# Add to /etc/hosts:
#
# 127.0.0.1 myapp.k3d.localhost
#
# then browse to Ingress at
#
# http://myapp.k3d.localhost:8080
#
# or for *.k3d.localhost use Dnsmasq to avoid having to add entries to /etc/hosts each time
#
ports:
- port: 8080:80 # same as `--port '8080:80@loadbalancer'`
nodeFilters:
- loadbalancer
#env:
# - envVar: bar=baz # same as `--env 'bar=baz@server:0'`
# nodeFilters:
# - server:0
#registries: # define how registries should be created or used
# create: # creates a default registry to be used with the cluster; same as `--registry-create registry.localhost`
# name: registry.localhost
# host: "0.0.0.0"
# hostPort: "5000"
# proxy: # omit this to have a "normal" registry, set this to create a registry proxy (pull-through cache)
# remoteURL: https://registry-1.docker.io # mirror the DockerHub registry
# username: "" # unauthenticated
# password: "" # unauthenticated
# volumes:
# - /some/path:/var/lib/registry # persist registry data locally
# use:
# - k3d-myotherregistry:5000 # some other k3d-managed registry; same as `--registry-use 'k3d-myotherregistry:5000'`
# config: | # define contents of the `registries.yaml` file (or reference a file); same as `--registry-config /path/to/config.yaml`
# mirrors:
# "my.company.registry":
# endpoint:
# - http://my.company.registry:5000
#hostAliases: # /etc/hosts style entries to be injected into /etc/hosts in the node containers and in the NodeHosts section in CoreDNS
# - ip: 1.2.3.4
# hostnames:
# - my.host.local
# - that.other.local
# - ip: 1.1.1.1
# hostnames:
# - cloud.flare.dns
options:
k3d: # k3d runtime settings
wait: true # wait for cluster to be usable before returining; same as `--wait` (default: true)
# timeout: "60s" # wait timeout before aborting; same as `--timeout 60s`
# disableLoadbalancer: false # same as `--no-lb`
# disableImageVolume: false # same as `--no-image-volume`
# disableRollback: false # same as `--no-Rollback`
# loadbalancer:
# configOverrides:
# - settings.workerConnections=2048
k3s: # options passed on to K3s itself
# extraArgs: # additional arguments passed to the `k3s server|agent` command; same as `--k3s-arg`
# - arg: "--tls-san=my.host.domain"
# nodeFilters:
# - server:*
# nodeLabels:
# - label: foo=bar # same as `--k3s-node-label 'foo=bar@agent:1'` -> this results in a Kubernetes node label
# nodeFilters:
# - agent:1
kubeconfig:
updateDefaultKubeconfig: true # add new cluster to your default Kubeconfig; same as `--kubeconfig-update-default` (default: true)
switchCurrentContext: true # also set current-context to the new cluster's context; same as `--kubeconfig-switch-context` (default: true)
# runtime: # runtime (docker) specific options
# gpuRequest: all # same as `--gpus all`
# labels:
# - label: bar=baz # same as `--runtime-label 'bar=baz@agent:1'` -> this results in a runtime (docker) container label
# nodeFilters:
# - agent:1