types.go 2.9 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.15-snapshot2"
P
Priya Wadhwa 已提交
28
	// SHA of the kic base image
M
Medya Gh 已提交
29
	baseImageSHA = "0973e4bcdfef0dc8c5a581ecfcca5e36fa6a1cc8773e832ecfd31de3d2b6bf46"
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 {
M
Medya Gh 已提交
51
	ClusterName       string            // The cluster the container belongs to
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
59
	APIServerPort     int               // Kubernetes api server port inside the container
60 61
	PortMappings      []oci.PortMapping // container port mappings
	Envs              map[string]string // key,value of environment variables passed to the node
62
	KubernetesVersion string            // Kubernetes version to install
T
ToonvanStrijp 已提交
63
	ContainerRuntime  string            // container runtime kic is running
T
ToonvanStrijp 已提交
64
	ExtraArgs         []string          // a list of any extra option to pass to oci binary during creation time, for example --expose 8080...
M
Medya Gh 已提交
65
}