types.go 2.7 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

const (
26
	// Version is the current version of kic
M
Medya Gh 已提交
27
	Version = "v0.0.12-snapshot2"
P
Priya Wadhwa 已提交
28
	// SHA of the kic base image
M
Medya Gh 已提交
29
	baseImageSHA = "2e78dd54231714527631b27e9d6674549d9114d7be1ff55ed417d2bc514a63f4"
M
Medya Gh 已提交
30 31
)

32 33
var (
	// BaseImage is the base image is used to spin up kic containers. it uses same base-image as kind.
P
Priya Wadhwa 已提交
34
	BaseImage = fmt.Sprintf("gcr.io/k8s-minikube/kicbase:%s@sha256:%s", Version, baseImageSHA)
M
Medya Gh 已提交
35

36 37
	// FallbackImages are backup base images in case gcr isn't available
	FallbackImages = []string{
P
Priya Wadhwa 已提交
38
		// the fallback of BaseImage in case gcr.io is not available. stored in docker hub
39 40 41
		// same image is push to https://github.com/kicbase/stable
		fmt.Sprintf("kicbase/stable:%s@sha256:%s", Version, baseImageSHA),

P
Priya Wadhwa 已提交
42
		// the fallback of BaseImage in case gcr.io is not available. stored in github packages https://github.com/kubernetes/minikube/packages/206071
43 44 45 46
		// github packages docker does _NOT_ support pulling by sha as mentioned in the docs:
		// https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages
		fmt.Sprintf("docker.pkg.github.com/kubernetes/minikube/kicbase:%s", Version),
	}
47 48
)

M
Medya Gh 已提交
49 50
// Config is configuration for the kic driver used by registry
type Config struct {
51 52 53 54 55 56 57
	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
58
	APIServerPort     int               // Kubernetes api server port inside the container
59 60
	PortMappings      []oci.PortMapping // container port mappings
	Envs              map[string]string // key,value of environment variables passed to the node
61
	KubernetesVersion string            // Kubernetes version to install
62
	ContainerRuntime  string            // container runtime kic is running
M
Medya Gh 已提交
63
}