Skip to content

Commit

Permalink
arcbox devops
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidmohd committed Mar 24, 2022
1 parent 7601616 commit ce2029b
Show file tree
Hide file tree
Showing 96 changed files with 5,304 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bookstore/osm-sample/traffic-split.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: split.smi-spec.io/v1alpha2
kind: TrafficSplit
metadata:
name: bookstore-split
namespace: bookstore
spec:
service: bookstore.bookstore
backends:
- service: bookstore
weight: 75
- service: bookstore-v2
weight: 25
58 changes: 58 additions & 0 deletions bookstore/yaml/bookbuyer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Create bookbuyer Service
apiVersion: v1
kind: Service
metadata:
name: bookbuyer
namespace: bookbuyer
labels:
app: bookbuyer
spec:
ports:
- port: 14001
name: bookbuyer-port
selector:
app: bookbuyer

---

# Create bookbuyer Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: bookbuyer
namespace: bookbuyer

---

# Create bookbuyer Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookbuyer
namespace: bookbuyer
spec:
replicas: 1
selector:
matchLabels:
app: bookbuyer
version: v1
template:
metadata:
labels:
app: bookbuyer
version: v1
spec:
serviceAccountName: bookbuyer
nodeSelector:
kubernetes.io/arch: amd64
kubernetes.io/os: linux
containers:
- name: bookbuyer
image: openservicemesh/bookbuyer:v1.0.0
imagePullPolicy: Always
command: ["/bookbuyer"]
env:
- name: "BOOKSTORE_NAMESPACE"
value: bookstore
- name: "BOOKSTORE_SVC"
value: bookstore
83 changes: 83 additions & 0 deletions bookstore/yaml/bookstore-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Create bookstore-v2 Service
apiVersion: v1
kind: Service
metadata:
name: bookstore-v2
namespace: bookstore
labels:
app: bookstore-v2
spec:
ports:
- port: 14001
name: bookstore-port
selector:
app: bookstore-v2

---

# Create bookstore-v2 Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: bookstore-v2
namespace: bookstore

---

# Create bookstore-v2 Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookstore-v2
namespace: bookstore
spec:
replicas: 1
selector:
matchLabels:
app: bookstore-v2
template:
metadata:
labels:
app: bookstore-v2
spec:
serviceAccountName: bookstore-v2
nodeSelector:
kubernetes.io/arch: amd64
kubernetes.io/os: linux
containers:
- name: bookstore
image: openservicemesh/bookstore:v1.0.0
imagePullPolicy: Always
ports:
- containerPort: 14001
name: web
command: ["/bookstore"]
args: ["--port", "14001"]
env:
- name: BOOKWAREHOUSE_NAMESPACE
value: bookwarehouse
- name: IDENTITY
value: bookstore-v2

---

kind: TrafficTarget
apiVersion: access.smi-spec.io/v1alpha3
metadata:
name: bookstore-v2
namespace: bookstore
spec:
destination:
kind: ServiceAccount
name: bookstore-v2
namespace: bookstore
rules:
- kind: HTTPRouteGroup
name: bookstore-service-routes
matches:
- buy-a-book
- books-bought
sources:
- kind: ServiceAccount
name: bookbuyer
namespace: bookbuyer
60 changes: 60 additions & 0 deletions bookstore/yaml/bookstore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Create bookstore Service
apiVersion: v1
kind: Service
metadata:
name: bookstore
namespace: bookstore
labels:
app: bookstore
spec:
ports:
- port: 14001
name: bookstore-port
selector:
app: bookstore

---

# Create bookstore Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: bookstore
namespace: bookstore

---

# Create bookstore Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookstore
namespace: bookstore
spec:
replicas: 1
selector:
matchLabels:
app: bookstore
template:
metadata:
labels:
app: bookstore
spec:
serviceAccountName: bookstore
nodeSelector:
kubernetes.io/arch: amd64
kubernetes.io/os: linux
containers:
- name: bookstore
image: openservicemesh/bookstore:v1.0.0
imagePullPolicy: Always
ports:
- containerPort: 14001
name: web
command: ["/bookstore"]
args: ["--port", "14001"]
env:
- name: BOOKWAREHOUSE_NAMESPACE
value: bookwarehouse
- name: IDENTITY
value: bookstore-v1
52 changes: 52 additions & 0 deletions bookstore/yaml/bookwarehouse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Create bookwarehouse Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: bookwarehouse
namespace: bookwarehouse

---

# Create bookwarehouse Service
apiVersion: v1
kind: Service
metadata:
name: bookwarehouse
namespace: bookwarehouse
labels:
app: bookwarehouse
spec:
ports:
- port: 14001
name: bookwarehouse-port
selector:
app: bookwarehouse

---

# Create bookwarehouse Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookwarehouse
namespace: bookwarehouse
spec:
replicas: 1
selector:
matchLabels:
app: bookwarehouse
template:
metadata:
labels:
app: bookwarehouse
version: v1
spec:
serviceAccountName: bookwarehouse
nodeSelector:
kubernetes.io/arch: amd64
kubernetes.io/os: linux
containers:
- name: bookwarehouse
image: openservicemesh/bookwarehouse:v1.0.0
imagePullPolicy: Always
command: ["/bookwarehouse"]
71 changes: 71 additions & 0 deletions bookstore/yaml/mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: mysql
namespace: bookwarehouse
---
apiVersion: v1
kind: Service
metadata:
name: mysql
namespace: bookwarehouse
spec:
ports:
- port: 3306
targetPort: 3306
name: client
appProtocol: tcp
selector:
app: mysql
clusterIP: None
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
namespace: bookwarehouse
spec:
serviceName: mysql
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
serviceAccountName: mysql
nodeSelector:
kubernetes.io/os: linux
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: mypassword
- name: MYSQL_DATABASE
value: booksdemo
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- mountPath: /mysql-data
name: data
readinessProbe:
tcpSocket:
port: 3306
initialDelaySeconds: 15
periodSeconds: 10
volumes:
- name: data
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "managed-premium"
resources:
requests:
storage: 250M
36 changes: 36 additions & 0 deletions hello-arc/yaml/hello_arc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: Service
metadata:
name: hello-arc
namespace: hello-arc
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
selector:
app: hello-arc
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-arc
namespace: hello-arc
spec:
replicas: 3
selector:
matchLabels:
app: hello-arc
template:
metadata:
labels:
app: hello-arc
spec:
containers:
- name: hello-arc
image: liorkamrat/hello-arc:latest
ports:
- containerPort: 8080
env:
- name: MESSAGE
value: This is an Azure Arc awesome GitOps Demo!
Loading

0 comments on commit ce2029b

Please sign in to comment.