types.go 2.3 KB
Newer Older
M
Medya Gh 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
Copyright 2019 The Kubernetes Authors All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kic

19 20 21 22 23
import (
	"fmt"

	"k8s.io/minikube/pkg/drivers/kic/oci"
)
M
Medya Gh 已提交
24 25 26 27 28 29

const (
	// Docker default bridge network is named "bridge" (https://docs.docker.com/network/bridge/#use-the-default-bridge-network)
	DefaultNetwork = "bridge"
	// DefaultPodCIDR is The CIDR to be used for pods inside the node.
	DefaultPodCIDR = "10.244.0.0/16"
M
Medya Ghazizadeh 已提交
30

31
	// Version is the current version of kic
32
	Version = "v0.0.6"
P
Priya Wadhwa 已提交
33 34
	// SHA of the kic base image
	baseImageSHA = "53725be5106d1d797dff4041d8c297383f32ab2edeff0a69fc3f50263cf17c79"
P
Priya Wadhwa 已提交
35

M
Medya Ghazizadeh 已提交
36
	// OverlayImage is the cni plugin used for overlay image, created by kind.
M
Medya Gh 已提交
37
	// CNI plugin image used for kic drivers created by kind.
M
Medya Gh 已提交
38 39 40
	OverlayImage = "kindest/kindnetd:0.5.3"
)

41 42
var (
	// BaseImage is the base image is used to spin up kic containers. it uses same base-image as kind.
P
Priya Wadhwa 已提交
43
	BaseImage = fmt.Sprintf("gcr.io/k8s-minikube/kicbase:%s@sha256:%s", Version, baseImageSHA)
44 45
)

M
Medya Gh 已提交
46 47
// Config is configuration for the kic driver used by registry
type Config struct {
48 49 50 51 52 53 54 55 56 57 58
	MachineName       string            // maps to the container name being created
	CPU               int               // Number of CPU cores assigned to the container
	Memory            int               // max memory in MB
	StorePath         string            // libmachine store path
	OCIBinary         string            // oci tool to use (docker, podman,...)
	ImageDigest       string            // image name with sha to use for the node
	Mounts            []oci.Mount       // mounts
	APIServerPort     int               // kubernetes api server port inside the container
	PortMappings      []oci.PortMapping // container port mappings
	Envs              map[string]string // key,value of environment variables passed to the node
	KubernetesVersion string            // kubernetes version to install
M
Medya Gh 已提交
59
}