-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider: initial kube workload execution
* provider: run workloads in kubernetes * sdl: add `accept`, list of hosts to accept requests for. * sdl: populate service args, env. * types/provider: fix yaml parsing. * _run/kube: single-node workload demo.
- Loading branch information
Showing
29 changed files
with
1,138 additions
and
151 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ services: | |
expose: | ||
- port: 443 | ||
as: 8080 | ||
accept: | ||
- foo.com | ||
to: | ||
- global: true | ||
|
||
|
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 @@ | ||
/data |
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,2 @@ | ||
include ../common.mk | ||
|
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,75 @@ | ||
# Akash: Single-Node Local Setup with Minikube | ||
|
||
Run a network with a single, local node and execute workloads in Minikube. | ||
|
||
Running through the entire suite requires four terminals. | ||
Each command is marked __t1__-__t4__ to indicate a suggested terminal number. | ||
|
||
## Setup | ||
|
||
__t1__: Start and initialize minikube | ||
```sh | ||
$ minikube start | ||
$ kubectl create -f contour.yml | ||
``` | ||
|
||
__t1__: Build binaries | ||
```sh | ||
$ make | ||
``` | ||
|
||
__t1__: Initialize environment | ||
```sh | ||
$ ./run.sh init | ||
``` | ||
|
||
## Start Network | ||
|
||
__t2__: Run `akashd` | ||
```sh | ||
$ ./run.sh akashd | ||
``` | ||
|
||
## Transfer Tokens | ||
|
||
__t1__: Query _master_ account | ||
```sh | ||
$ ./run.sh query master | ||
``` | ||
|
||
__t1__: Send tokens to _other_ account | ||
```sh | ||
$ ./run.sh send | ||
``` | ||
|
||
__t1__: Query _master_ account | ||
```sh | ||
$ ./run.sh query master | ||
``` | ||
|
||
__t1__: Query _other_ account | ||
```sh | ||
$ ./run.sh query other | ||
``` | ||
|
||
## Marketplace | ||
|
||
__t3__: Start marketplace monitor | ||
```sh | ||
$ ./run.sh marketplace | ||
``` | ||
|
||
__t4__: Run provider | ||
```sh | ||
$ ./run.sh provider | ||
``` | ||
|
||
__t1__: Create Deployment | ||
```sh | ||
$ ./run.sh deploy | ||
``` | ||
|
||
__t1__: Ping workload | ||
```sh | ||
$ ./run.sh ping | ||
``` |
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,170 @@ | ||
# This file is generated from the individual yaml files by deployment/render.sh. | ||
# Do not edit this file directly but instead edit the source files and | ||
# re-render. | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: heptio-contour | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: contour | ||
namespace: heptio-contour | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: ingressroutes.contour.heptio.com | ||
labels: | ||
component: ingressroute | ||
spec: | ||
group: contour.heptio.com | ||
version: v1beta1 | ||
scope: Namespaced | ||
names: | ||
plural: ingressroutes | ||
kind: IngressRoute | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: DaemonSet | ||
metadata: | ||
labels: | ||
app: contour | ||
name: contour | ||
namespace: heptio-contour | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: contour | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: contour | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "9001" | ||
prometheus.io/path: "/stats" | ||
prometheus.io/format: "prometheus" | ||
spec: | ||
containers: | ||
- image: docker.io/envoyproxy/envoy-alpine:v1.6.0 | ||
name: envoy | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
- containerPort: 8443 | ||
name: https | ||
command: ["envoy"] | ||
args: ["-c", "/config/contour.yaml", "--service-cluster", "cluster0", "--service-node", "node0", "-l", "info", "--v2-config-only"] | ||
volumeMounts: | ||
- name: contour-config | ||
mountPath: /config | ||
- image: gcr.io/heptio-images/contour:master | ||
imagePullPolicy: Always | ||
name: contour | ||
command: ["contour"] | ||
args: ["serve", "--incluster"] | ||
initContainers: | ||
- image: gcr.io/heptio-images/contour:master | ||
imagePullPolicy: Always | ||
name: envoy-initconfig | ||
command: ["contour"] | ||
args: ["bootstrap", "/config/contour.yaml"] | ||
volumeMounts: | ||
- name: contour-config | ||
mountPath: /config | ||
volumes: | ||
- name: contour-config | ||
emptyDir: {} | ||
dnsPolicy: ClusterFirst | ||
serviceAccountName: contour | ||
terminationGracePeriodSeconds: 30 | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: contour | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: contour | ||
subjects: | ||
- kind: ServiceAccount | ||
name: contour | ||
namespace: heptio-contour | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
name: contour | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- endpoints | ||
- nodes | ||
- pods | ||
- secrets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- ingresses | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: ["contour.heptio.com"] | ||
resources: ["ingressroutes"] | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: contour | ||
namespace: heptio-contour | ||
annotations: | ||
# This annotation puts the AWS ELB into "TCP" mode so that it does not | ||
# do HTTP negotiation for HTTPS connections at the ELB edge. | ||
# The downside of this is the remote IP address of all connections will | ||
# appear to be the internal address of the ELB. See docs/proxy-proto.md | ||
# for information about enabling the PROXY protocol on the ELB to recover | ||
# the original remote IP address. | ||
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp | ||
spec: | ||
ports: | ||
- port: 80 | ||
name: http | ||
protocol: TCP | ||
targetPort: 8080 | ||
- port: 443 | ||
name: https | ||
protocol: TCP | ||
targetPort: 8443 | ||
selector: | ||
app: contour | ||
type: NodePort | ||
--- |
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,30 @@ | ||
--- | ||
services: | ||
web: | ||
image: gcr.io/google_containers/echoserver:1.8 | ||
expose: | ||
- port: 8080 | ||
as: 80 | ||
accept: | ||
- web.192.168.99.101.nip.io | ||
to: | ||
- global: true | ||
|
||
profiles: | ||
compute: | ||
web: | ||
cpu: 2 | ||
memory: 3 | ||
disk: 5 | ||
placement: | ||
westcoast: | ||
attributes: | ||
region: us-west | ||
pricing: | ||
web: 8 | ||
|
||
deployment: | ||
web: | ||
westcoast: | ||
profile: web | ||
count: 5 |
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,41 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: echo | ||
labels: | ||
app: echo | ||
spec: | ||
containers: | ||
- image: gcr.io/google_containers/echoserver:1.8 | ||
name: envoy | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: echo | ||
labels: | ||
app: echo | ||
spec: | ||
selector: | ||
app: echo | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
name: http | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: echo | ||
labels: | ||
app: echo | ||
spec: | ||
backend: | ||
serviceName: echo | ||
servicePort: 80 | ||
rules: | ||
- host: echo.192.168.99.101.nip.io |
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,16 @@ | ||
source ../common.sh | ||
|
||
PROVIDER_DIR=$DATA_ROOT/provider | ||
|
||
akash() { | ||
_akash "$@" | ||
} | ||
|
||
akashd() { | ||
_akashd "$@" | ||
} | ||
|
||
akash_provider() { | ||
"$AKASH_ROOT/akash" -d "$PROVIDER_DIR" "$@" | ||
} | ||
|
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,6 @@ | ||
hostURI: http://localhost:3001/manifest | ||
attributes: | ||
- name: region | ||
value: us-west | ||
- name: tier | ||
value: "5" |
Oops, something went wrong.