This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
-
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.
Kubernetes and Istio manifests needed to get my app running within an…
… Istio service mesh. * `ctmd.yml` is the main k8s manifest for the app. `istioctl kube-inject` is used to inject Istio sidecars etc when the manifest is written into a k8s cluster. * `ctmd-mongo-egress.yml` defines a basic Istio egress rule, allowing my app to talk to an external mongo cluster * `gateway.yml` opens an ingress into my service mesh, allowing http traffic to hit my service See https://morganpeat.github.io/microservices/2018/08/30/cryptotracker-d.html
- Loading branch information
Morgan Peat
committed
Aug 30, 2018
1 parent
8ccd728
commit 45958c9
Showing
3 changed files
with
90 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: ServiceEntry | ||
metadata: | ||
name: mongo-ext | ||
spec: | ||
hosts: | ||
- ignored-as-not-http.com | ||
addresses: | ||
- 0.0.0.0/0 | ||
ports: | ||
- number: 27017 | ||
name: mongo | ||
protocol: MONGO | ||
location: MESH_EXTERNAL | ||
resolution: NONE | ||
|
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 @@ | ||
################################################################################################## | ||
# Market Data service | ||
################################################################################################## | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: marketdata | ||
labels: | ||
app: marketdata | ||
spec: | ||
ports: | ||
- port: 80 | ||
name: http | ||
targetPort: 8080 | ||
selector: | ||
app: marketdata | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: marketdata-v1 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: marketdata | ||
version : 1 | ||
spec: | ||
containers: | ||
- name: marketdata | ||
image: morganpeat/cryptotracker | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: MongoDB__ConnectionString | ||
valueFrom: | ||
secretKeyRef: | ||
key: MongoDB__ConnectionString | ||
name: ctmd-config |
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,33 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: Gateway | ||
metadata: | ||
name: ctmd-gateway | ||
spec: | ||
selector: | ||
istio: ingressgateway # use Istio default gateway implementation | ||
servers: | ||
- port: | ||
number: 80 | ||
name: http | ||
protocol: HTTP | ||
hosts: | ||
- "*" | ||
--- | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: ctmd | ||
spec: | ||
hosts: | ||
- "*" | ||
gateways: | ||
- ctmd-gateway | ||
http: | ||
- match: | ||
- uri: | ||
prefix: /api | ||
route: | ||
- destination: | ||
port: | ||
number: 80 | ||
host: marketdata |