Skip to content

Commit d8c5e20

Browse files
slimeandsoakemSimon Slocombe
andauthored
#221 Propagating insecure registry through the provider (#222)
Co-authored-by: Simon Slocombe <[email protected]>
1 parent 262e2d6 commit d8c5e20

File tree

5 files changed

+920
-946
lines changed

5 files changed

+920
-946
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ test_output
2727
schema-generator
2828
testBinary
2929
.aider*
30+
31+
# Ignore IntelliJ based IDE detritus
32+
.idea/**

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Some drivers require a bit of prerequisite setup, so it's best to visit [https:/
2424

2525
```terraform
2626
provider "minikube" {
27-
kubernetes_version = "v1.30.0"
27+
kubernetes_version = "v1.30.2"
2828
}
2929
```
3030
<br/><!-- schema generated by tfplugindocs -->

docs/resources/cluster.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Used to create a minikube cluster on the current host
1414

1515
```terraform
1616
provider "minikube" {
17-
kubernetes_version = "v1.30.0"
17+
kubernetes_version = "v1.30.2"
1818
}
1919
2020
resource "minikube_cluster" "docker" {
@@ -115,13 +115,13 @@ resource "kubernetes_deployment" "deployment" {
115115
- `cluster_name` (String) The name of the minikube cluster
116116
- `cni` (String) CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)
117117
- `container_runtime` (String) The container runtime to be used. Valid options: docker, cri-o, containerd (default: docker)
118-
- `cpus` (Number) Amount of CPUs to allocate to Kubernetes
118+
- `cpus` (String) Number of CPUs allocated to Kubernetes. Use "max" to use the maximum number of CPUs. Use "no-limit" to not specify a limit (Docker/Podman only)
119119
- `cri_socket` (String) The cri socket path to be used.
120120
- `delete_on_failure` (Boolean) If set, delete the current cluster if start fails and try again. Defaults to false.
121121
- `disable_driver_mounts` (Boolean) Disables the filesystem mounts provided by the hypervisors
122122
- `disable_metrics` (Boolean) If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.
123123
- `disable_optimizations` (Boolean) If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.
124-
- `disk_size` (String) Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g).
124+
- `disk_size` (String) Disk size allocated to the minikube VM (format: <number>[<unit>(case-insensitive)], where unit = b, k, kb, m, mb, g or gb)
125125
- `dns_domain` (String) The cluster dns domain name used in the Kubernetes cluster
126126
- `dns_proxy` (Boolean) Enable proxy for NAT DNS requests (virtualbox driver only)
127127
- `docker_env` (Set of String) Environment variables to pass to the Docker daemon. (format: key=value)
@@ -132,11 +132,11 @@ resource "kubernetes_deployment" "deployment" {
132132
- `embed_certs` (Boolean) if true, will embed the certs in kubeconfig.
133133
- `enable_default_cni` (Boolean) DEPRECATED: Replaced by --cni=bridge
134134
- `extra_config` (Set of String) A set of key=value pairs that describe configuration that may be passed to different components. The key should be '.' separated, and the first part before the dot is the component to apply the configuration to. Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, skip-phases, pod-network-cidr
135-
- `extra_disks` (Number) Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit, kvm2, and qemu2 drivers)
135+
- `extra_disks` (Number) Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit, kvm2, qemu2, and vfkit drivers)
136136
- `feature_gates` (String) A set of key=value pairs that describe feature gates for alpha/experimental features.
137137
- `force` (Boolean) Force minikube to perform possibly dangerous operations
138138
- `force_systemd` (Boolean) If set, force the container runtime to use systemd as cgroup manager. Defaults to false.
139-
- `gpus` (String) Allow pods to use your NVIDIA GPUs. Options include: [all,nvidia] (Docker driver with Docker container-runtime only)
139+
- `gpus` (String) Allow pods to use your GPUs. Options include: [all,nvidia,amd] (Docker driver with Docker container-runtime only)
140140
- `ha` (Boolean) Create Highly Available Multi-Control Plane Cluster with a minimum of three control-plane nodes that will also be marked for work.
141141
- `host_dns_resolver` (Boolean) Enable host resolver for NAT DNS requests (virtualbox driver only)
142142
- `host_only_cidr` (String) The CIDR to be used for the minikube VM (virtualbox driver only)
@@ -153,14 +153,14 @@ resource "kubernetes_deployment" "deployment" {
153153
- `interactive` (Boolean) Allow user prompts for more information
154154
- `iso_url` (Set of String) Locations to fetch the minikube ISO from.
155155
- `keep_context` (Boolean) This will keep the existing kubectl context and will create a minikube context.
156-
- `kubernetes_version` (String) The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.30.0, 'latest' for v1.30.0). Defaults to 'stable'.
156+
- `kubernetes_version` (String) The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.33.1, 'latest' for v1.33.1). Defaults to 'stable'.
157157
- `kvm_gpu` (Boolean) Enable experimental NVIDIA GPU support in minikube
158158
- `kvm_hidden` (Boolean) Hide the hypervisor signature from the guest in minikube (kvm2 driver only)
159159
- `kvm_network` (String) The KVM default network name. (kvm2 driver only)
160160
- `kvm_numa_count` (Number) Simulate numa node count in minikube, supported numa node count range is 1-8 (kvm2 driver only)
161161
- `kvm_qemu_uri` (String) The KVM QEMU connection URI. (kvm2 driver only)
162162
- `listen_address` (String) IP Address to use to expose ports (docker and podman driver only)
163-
- `memory` (String) Amount of RAM to allocate to Kubernetes (format: <number>[<unit>(case-insensitive)], where unit = b, k, kb, m, mb, g or gb)
163+
- `memory` (String) Amount of RAM to allocate to Kubernetes (format: <number>[<unit>], where unit = b, k, m or g). Use "max" to use the maximum amount of memory. Use "no-limit" to not specify a limit (Docker/Podman only))
164164
- `mount` (Boolean) This will start the mount daemon and automatically mount files into minikube.
165165
- `mount_9p_version` (String) Specify the 9p version that the mount should use
166166
- `mount_gid` (String) Default group id used for the mount
@@ -174,7 +174,7 @@ resource "kubernetes_deployment" "deployment" {
174174
- `namespace` (String) The named space to activate after start
175175
- `nat_nic_type` (String) NIC Type used for nat network. One of Am79C970A, Am79C973, 82540EM, 82543GC, 82545EM, or virtio (virtualbox driver only)
176176
- `native_ssh` (Boolean) Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.
177-
- `network` (String) network to run minikube with. Now it is used by docker/podman and KVM drivers. If left empty, minikube will create a new network.
177+
- `network` (String) network to run minikube with. Used by docker/podman, qemu, kvm, and vfkit drivers. If left empty, minikube will create a new network.
178178
- `network_plugin` (String) DEPRECATED: Replaced by --cni
179179
- `nfs_share` (Set of String) Local folders to share with Guest via NFS mounts (hyperkit driver only)
180180
- `nfs_shares_root` (String) Where to root the NFS Shares, defaults to /nfsshares (hyperkit driver only)
@@ -199,7 +199,7 @@ resource "kubernetes_deployment" "deployment" {
199199
- `uuid` (String) Provide VM UUID to restore MAC address (hyperkit driver only)
200200
- `vm` (Boolean) Filter to use only VM Drivers
201201
- `vm_driver` (String) DEPRECATED, use `driver` instead.
202-
- `wait` (Set of String) comma separated list of Kubernetes components to verify and wait for after starting a cluster. defaults to "apiserver,system_pods", available options: "apiserver,system_pods,default_sa,apps_running,node_ready,kubelet" . other acceptable values are 'all' or 'none', 'true' and 'false'
202+
- `wait` (Set of String) comma separated list of Kubernetes components to verify and wait for after starting a cluster. defaults to "apiserver,system_pods", available options: "apiserver,system_pods,default_sa,apps_running,node_ready,kubelet,extra" . other acceptable values are 'all' or 'none', 'true' and 'false'
203203
- `wait_timeout` (Number) max time to wait per Kubernetes or host to be healthy. (Configured in minutes)
204204

205205
### Read-Only

minikube/resource_cluster.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ func initialiseMinikubeClient(d *schema.ResourceData, m interface{}) (lib.Cluste
316316
ecSlice = state_utils.ReadSliceState(d.Get("extra_config"))
317317
}
318318

319+
ir := []string{}
320+
if v, ok := d.GetOk("insecure_registry"); ok {
321+
ir = state_utils.ReadSliceState(v)
322+
}
319323
var extraConfigs config.ExtraOptionSlice
320324
for _, e := range ecSlice {
321325
if err := extraConfigs.Set(e); err != nil {
@@ -404,6 +408,7 @@ func initialiseMinikubeClient(d *schema.ResourceData, m interface{}) (lib.Cluste
404408
HyperkitVpnKitSock: d.Get("hyperkit_vpnkit_sock").(string),
405409
HyperkitVSockPorts: state_utils.ReadSliceState(hyperKitSockPorts),
406410
NFSShare: state_utils.ReadSliceState(nfsShare),
411+
InsecureRegistry: ir,
407412
NFSSharesRoot: d.Get("nfs_shares_root").(string),
408413
DockerEnv: config.DockerEnv,
409414
DockerOpt: config.DockerOpt,

0 commit comments

Comments
 (0)