Last active
July 17, 2022 20:51
-
-
Save dbones/77ad77ce5a220205724429e125ff5ba6 to your computer and use it in GitHub Desktop.
k3d-example
This file contains hidden or 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
k3d cluster create --config ./config.yaml |
This file contains hidden or 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
kubectl -n cattle-system patch deployments cattle-cluster-agent --patch '{ | |
"spec": { | |
"template": { | |
"spec": { | |
"hostAliases": [ | |
{ | |
"hostnames": | |
[ | |
"{{ rancher_server_hostname }}" | |
], | |
"ip": "{{ rancher_server_ip }}" | |
} | |
] | |
} | |
} | |
} | |
}' | |
kubectl -n cattle-system patch daemonsets cattle-node-agent --patch '{ | |
"spec": { | |
"template": { | |
"spec": { | |
"hostAliases": [ | |
{ | |
"hostnames": | |
[ | |
"{{ rancher_server_hostname }}" | |
], | |
"ip": "{{ rancher_server_ip }}" | |
} | |
] | |
} | |
} | |
} | |
}' |
This file contains hidden or 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
# k3d configuration file, saved as e.g. /home/me/myk3dcluster.yaml | |
apiVersion: k3d.io/v1alpha2 # this will change in the future as we make everything more stable | |
kind: Simple # internally, we also have a Cluster config, which is not yet available externally | |
name: prod # name that you want to give to your cluster (will still be prefixed with `k3d-`) | |
# servers: 1 # same as `--servers 1` | |
# agents: 3 # same as `--agents 3` | |
ports: | |
- port: 31443:443 | |
nodeFilters: | |
- loadbalancer | |
- port: 31080:8080 | |
nodeFilters: | |
- loadbalancer | |
- port: 41002:40002 | |
nodeFilters: | |
- loadbalancer | |
- port: 41003:40003 | |
nodeFilters: | |
- loadbalancer | |
- port: 41004:40004 | |
nodeFilters: | |
- loadbalancer | |
- port: 41005:40005 | |
nodeFilters: | |
- loadbalancer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment