forked from istio/istio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pilot e2e test support for local docker registry (istio#3920)
- Various changes to the e2e tests - Re-introducing old mixer docs (with many changes) for running a local docker registry in k8s.
- Loading branch information
Nathan Mittler
authored
Mar 5, 2018
1 parent
a5eb925
commit 7ba4568
Showing
13 changed files
with
190 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Using a Local Docker Registry | ||
|
||
`localregistry.yaml` is a copy of Kubernete's local registry addon, and is included to make it easier to test | ||
Istio by allowing a developer to push docker images locally rather than to some remote registry. | ||
|
||
### Run the registry | ||
To run the local registry in your kubernetes cluster: | ||
|
||
```shell | ||
$ kubectl apply -f ./tests/util/localregistry/localregistry.yaml | ||
``` | ||
|
||
### Expose the Registry | ||
|
||
After the registry server is running, expose it locally by executing: | ||
|
||
```shell | ||
$ kubectl port-forward --namespace kube-system $POD 5000:5000 | ||
``` | ||
|
||
If you're testing locally with minikube, `$POD` can be set with: | ||
|
||
```shell | ||
$ POD=$(kubectl get pods --namespace kube-system -l k8s-app=kube-registry \ | ||
-o template --template '{{range .items}}{{.metadata.name}} {{.status.phase}}{{"\n"}}{{end}}' \ | ||
| grep Running | head -1 | cut -f1 -d' ') | ||
``` | ||
|
||
### Push Local Images | ||
|
||
Build and push the Istio docker images to the local registry, by running: | ||
|
||
```shell | ||
$ make docker push HUB=localhost:5000 TAG=latest | ||
``` | ||
|
||
### Run with Local Images | ||
|
||
#### Running E2E Tests | ||
If you're running e2e tests, you can set the test flags: | ||
|
||
```shell | ||
$ go test <TEST_PATH> -hub=localhost:5000 -tag=latest | ||
``` | ||
|
||
#### Hard-coding the Image URL | ||
|
||
You can also modify the image URLs in your deployment yaml files directly: | ||
|
||
```yaml | ||
image: localhost:5000/<APP_NAME>:latest | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# after creating the local registry, to push images to it you need to open up a port to the pod's registry: | ||
# $ POD=$(kubectl get pods --namespace kube-system -l k8s-app=kube-registry \ | ||
# -o template --template '{{range .items}}{{.metadata.name}} {{.status.phase}}{{"\n"}}{{end}}' \ | ||
# | grep Running | head -1 | cut -f1 -d' ') | ||
# $ kubectl port-forward --namespace kube-system $POD 5000:5000 | ||
|
||
apiVersion: v1 | ||
kind: ReplicationController | ||
metadata: | ||
name: kube-registry-v0 | ||
namespace: kube-system | ||
labels: | ||
k8s-app: kube-registry | ||
version: v0 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
k8s-app: kube-registry | ||
version: v0 | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: kube-registry | ||
version: v0 | ||
spec: | ||
containers: | ||
- name: registry | ||
image: registry:2 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
env: | ||
- name: REGISTRY_HTTP_ADDR | ||
value: :5000 | ||
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY | ||
value: /var/lib/registry | ||
volumeMounts: | ||
- name: image-store | ||
mountPath: /var/lib/registry | ||
ports: | ||
- containerPort: 5000 | ||
name: registry | ||
protocol: TCP | ||
volumes: | ||
- name: image-store | ||
emptyDir: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kube-registry | ||
namespace: kube-system | ||
labels: | ||
k8s-app: kube-registry | ||
kubernetes.io/name: "KubeRegistry" | ||
spec: | ||
selector: | ||
k8s-app: kube-registry | ||
ports: | ||
- name: registry | ||
port: 5000 | ||
protocol: TCP | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kube-registry-proxy | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- name: kube-registry-proxy | ||
image: gcr.io/google_containers/kube-registry-proxy:0.3 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 50Mi | ||
env: | ||
- name: REGISTRY_HOST | ||
value: kube-registry.kube-system.svc.cluster.local | ||
- name: REGISTRY_PORT | ||
value: "5000" | ||
- name: FORWARD_PORT | ||
value: "5000" | ||
ports: | ||
- name: registry | ||
containerPort: 5000 | ||
hostPort: 5000 |