types.go 3.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-snapshot4"
P
Priya Wadhwa 已提交
28
	// SHA of the kic base image
29 30
	baseImageSHA          = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16"
	baseMultiArchImageSHA = "todo"
M
Medya Gh 已提交
31 32
)

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

37 38
	// FallbackImages are backup base images in case gcr isn't available
	FallbackImages = []string{
39 40 41 42 43 44 45 46 47 48 49 50 51

		// the fallback of multi-arch BaseImage in case gcr.io is not available. stored in docker hub
		// same image is push to https://github.com/kicbase/stable
		fmt.Sprintf("kicbase/stable-multiarch:%s@sha256:%s", Version, baseMultiArchImageSHA),

		// the fallback of multi-arch BaseImage in case gcr.io is not available. stored in github packages https://github.com/kubernetes/minikube/packages/206071
		// 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-multiarch:%s", Version),

		// the amd64 only base image is used to spin up kic containers
		fmt.Sprintf("gcr.io/k8s-minikube/kicbase:%s@sha256:%s", Version, baseImageSHA),

P
Priya Wadhwa 已提交
52
		// the fallback of BaseImage in case gcr.io is not available. stored in docker hub
53 54 55
		// same image is push to https://github.com/kicbase/stable
		fmt.Sprintf("kicbase/stable:%s@sha256:%s", Version, baseImageSHA),

P
Priya Wadhwa 已提交
56
		// the fallback of BaseImage in case gcr.io is not available. stored in github packages https://github.com/kubernetes/minikube/packages/206071
57 58 59 60
		// 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),
	}
61 62
)

M
Medya Gh 已提交
63 64
// Config is configuration for the kic driver used by registry
type Config struct {
M
Medya Gh 已提交
65
	ClusterName       string            // The cluster the container belongs to
66 67 68 69 70 71 72
	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
73
	APIServerPort     int               // Kubernetes api server port inside the container
74 75
	PortMappings      []oci.PortMapping // container port mappings
	Envs              map[string]string // key,value of environment variables passed to the node
76
	KubernetesVersion string            // Kubernetes version to install
T
ToonvanStrijp 已提交
77
	ContainerRuntime  string            // container runtime kic is running
T
ToonvanStrijp 已提交
78
	ExtraArgs         []string          // a list of any extra option to pass to oci binary during creation time, for example --expose 8080...
M
Medya Gh 已提交
79
}