Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce the "registry" addon #1583

Merged
merged 1 commit into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ var settings = []Setting{
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "registry",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "registry-creds",
set: SetBool,
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func init() {
startCmd.Flags().StringArrayVar(&dockerOpt, "docker-opt", nil, "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().String(apiServerName, constants.APIServerName, "The apiserver name which is used in the generated certificate for localkube/kubernetes. This can be used if you want to make the apiserver available from outside the machine")
startCmd.Flags().String(dnsDomain, constants.ClusterDNSDomain, "The cluster dns domain name used in the kubernetes cluster")
startCmd.Flags().StringSliceVar(&insecureRegistry, "insecure-registry", nil, "Insecure Docker registries to pass to the Docker daemon")
startCmd.Flags().StringSliceVar(&insecureRegistry, "insecure-registry", []string{util.DefaultServiceClusterIP + "/24"}, "Insecure Docker registries to pass to the Docker daemon")
startCmd.Flags().StringSliceVar(&registryMirror, "registry-mirror", nil, "Registry mirrors to pass to the Docker daemon")
startCmd.Flags().String(kubernetesVersion, constants.DefaultKubernetesVersion, "The kubernetes version that the minikube VM will use (ex: v1.2.3) \n OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64)")
startCmd.Flags().String(containerRuntime, "", "The container runtime to be used")
Expand Down
24 changes: 24 additions & 0 deletions deploy/addons/registry/registry-rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: ReplicationController
metadata:
labels:
kubernetes.io/minikube-addons: registry
addonmanager.kubernetes.io/mode: Reconcile
name: registry
namespace: kube-system
spec:
replicas: 1
selector:
addonmanager.kubernetes.io/mode: Reconcile
template:
metadata:
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
containers:
- image: registry:2.6.1
imagePullPolicy: IfNotPresent
name: registry
ports:
- containerPort: 5000
protocol: TCP
15 changes: 15 additions & 0 deletions deploy/addons/registry/registry-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
labels:
kubernetes.io/minikube-addons: registry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service also needs the addon-manager label addonmanager.kubernetes.io/mode: Reconcile. Unfortunately the addon-manager will ignore any resource without this label.

addonmanager.kubernetes.io/mode: Reconcile
name: registry
namespace: kube-system
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 5000
selector:
kubernetes.io/minikube-addons: registry
12 changes: 12 additions & 0 deletions pkg/minikube/assets/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ var Addons = map[string]*Addon{
"ingress-svc.yaml",
"0640"),
}, false, "ingress"),
"registry": NewAddon([]*MemoryAsset{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addons feature has a dependency on the minikube config feature, so these need an additional entry in the list here

https://github.com/kubernetes/minikube/blob/master/cmd/minikube/cmd/config/config.go#L45-L174

Then you can enable/disable by minikube addons enable registry

NewMemoryAsset(
"deploy/addons/registry/registry-rc.yaml",
constants.AddonsPath,
"registry-rc.yaml",
"0640"),
NewMemoryAsset(
"deploy/addons/registry/registry-svc.yaml",
constants.AddonsPath,
"registry-svc.yaml",
"0640"),
}, false, "registry"),
"registry-creds": NewAddon([]*MemoryAsset{
NewMemoryAsset(
"deploy/addons/registry-creds/registry-creds-rc.yaml",
Expand Down