-
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.
feat: add deployment files for service mesh based routing
- Loading branch information
1 parent
d8b80b1
commit 0a6d958
Showing
28 changed files
with
692 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
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,55 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: AppProject | ||
metadata: | ||
name: basic-servicemesh | ||
labels: | ||
argocd.argoproj.io/sync-wave: "0" | ||
spec: | ||
sourceNamespaces: | ||
- example-application-basic-servicemesh | ||
clusterResourceWhitelist: | ||
- group: '*' | ||
kind: '*' | ||
destinations: | ||
- name: in-cluster | ||
namespace: example-application-basic-servicemesh | ||
server: https://kubernetes.default.svc | ||
namespaceResourceWhitelist: | ||
- group: '*' | ||
kind: '*' | ||
sourceRepos: | ||
- git@github.com:leonsteinhaeuser/rh-ocp-examples.git | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: app-of-apps | ||
namespace: &ns example-application-basic-servicemesh | ||
labels: | ||
argocd.argoproj.io/sync-wave: "1" | ||
spec: | ||
destination: | ||
namespace: *ns | ||
server: https://kubernetes.default.svc | ||
project: basic-servicemesh | ||
source: | ||
directory: | ||
jsonnet: {} | ||
recurse: true | ||
path: ocp/deployments/manifests/basic | ||
repoURL: git@github.com:leonsteinhaeuser/rh-ocp-examples.git | ||
targetRevision: HEAD | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
retry: | ||
backoff: | ||
duration: 5s | ||
factor: 2 | ||
maxDuration: 3m0s | ||
limit: 5 | ||
syncOptions: | ||
- PruneLast=true | ||
- ApplyOutOfSyncOnly=true | ||
- ServerSideApply=true |
33 changes: 33 additions & 0 deletions
33
ocp/deployments/manifests/servicemesh/application_number_service.yaml
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: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: &name number-service | ||
namespace: &ns example-application-basic-servicemesh | ||
labels: | ||
argocd.argoproj.io/sync-wave: "0" | ||
spec: | ||
destination: | ||
namespace: *ns | ||
server: https://kubernetes.default.svc | ||
project: basic-servicemesh | ||
source: | ||
directory: | ||
jsonnet: {} | ||
recurse: true | ||
path: ocp/deployments/manifests/servicemesh/number_service | ||
repoURL: git@github.com:leonsteinhaeuser/rh-ocp-examples.git | ||
targetRevision: HEAD | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
retry: | ||
backoff: | ||
duration: 5s | ||
factor: 2 | ||
maxDuration: 3m0s | ||
limit: 5 | ||
syncOptions: | ||
- PruneLast=true | ||
- ApplyOutOfSyncOnly=true | ||
- ServerSideApply=true |
33 changes: 33 additions & 0 deletions
33
ocp/deployments/manifests/servicemesh/application_status_service.yaml
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: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: &name status-service | ||
namespace: &ns example-application-basic-servicemesh | ||
labels: | ||
argocd.argoproj.io/sync-wave: "0" | ||
spec: | ||
destination: | ||
namespace: *ns | ||
server: https://kubernetes.default.svc | ||
project: basic-servicemesh | ||
source: | ||
directory: | ||
jsonnet: {} | ||
recurse: true | ||
path: ocp/deployments/manifests/servicemesh/status_service | ||
repoURL: git@github.com:leonsteinhaeuser/rh-ocp-examples.git | ||
targetRevision: HEAD | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
retry: | ||
backoff: | ||
duration: 5s | ||
factor: 2 | ||
maxDuration: 3m0s | ||
limit: 5 | ||
syncOptions: | ||
- PruneLast=true | ||
- ApplyOutOfSyncOnly=true | ||
- ServerSideApply=true |
33 changes: 33 additions & 0 deletions
33
ocp/deployments/manifests/servicemesh/application_view_service.yaml
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: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: &name view-service | ||
namespace: &ns example-application-basic-servicemesh | ||
labels: | ||
argocd.argoproj.io/sync-wave: "1" | ||
spec: | ||
destination: | ||
namespace: *ns | ||
server: https://kubernetes.default.svc | ||
project: basic-servicemesh | ||
source: | ||
directory: | ||
jsonnet: {} | ||
recurse: true | ||
path: ocp/deployments/manifests/servicemesh/view_service | ||
repoURL: git@github.com:leonsteinhaeuser/rh-ocp-examples.git | ||
targetRevision: HEAD | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
retry: | ||
backoff: | ||
duration: 5s | ||
factor: 2 | ||
maxDuration: 3m0s | ||
limit: 5 | ||
syncOptions: | ||
- PruneLast=true | ||
- ApplyOutOfSyncOnly=true | ||
- ServerSideApply=true |
27 changes: 27 additions & 0 deletions
27
ocp/deployments/manifests/servicemesh/number_service/authorization_policy.yaml
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,27 @@ | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
name: &name number-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
spec: | ||
selector: | ||
matchLabels: *labels | ||
action: ALLOW | ||
rules: | ||
- from: | ||
- source: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: view-service | ||
app.kubernetes.io/instance: view-service | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
to: | ||
- operation: | ||
methods: ["GET"] | ||
ports: ["8081"] | ||
paths: ["/number"] |
54 changes: 54 additions & 0 deletions
54
ocp/deployments/manifests/servicemesh/number_service/deployment.yaml
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,54 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: &name number-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
app.kubernetes.io/version: v1 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: *labels | ||
template: | ||
metadata: | ||
labels: *labels | ||
spec: | ||
securityContext: | ||
runAsUser: 65535 | ||
runAsGroup: 65535 | ||
automountServiceAccountToken: false | ||
serviceAccountName: *name | ||
containers: | ||
- name: *name | ||
image: ghcr.io/leonsteinhaeuser/rh-ocp-examples-number:main | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8081 | ||
name: http | ||
protocol: TCP | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 32Mi | ||
requests: | ||
cpu: 10m | ||
memory: 32Mi | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: http | ||
securityContext: | ||
runAsUser: 65535 | ||
runAsGroup: 65535 | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- all |
7 changes: 7 additions & 0 deletions
7
ocp/deployments/manifests/servicemesh/number_service/kustomization.yaml
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,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- deployment.yaml | ||
- service.yaml | ||
- vservice.yaml | ||
- network_policy.yaml |
14 changes: 14 additions & 0 deletions
14
ocp/deployments/manifests/servicemesh/number_service/peer_authentication.yaml
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,14 @@ | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: PeerAuthentication | ||
metadata: | ||
name: &name number-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
spec: | ||
selector: | ||
matchLabels: *labels | ||
mtls: | ||
mode: STRICT |
17 changes: 17 additions & 0 deletions
17
ocp/deployments/manifests/servicemesh/number_service/service.yaml
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,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: &name number-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
app.kubernetes.io/version: v1 | ||
spec: | ||
ports: | ||
- port: 8081 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: *labels |
9 changes: 9 additions & 0 deletions
9
ocp/deployments/manifests/servicemesh/number_service/service_account.yaml
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,9 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: &name number-service | ||
labels: | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo |
37 changes: 37 additions & 0 deletions
37
ocp/deployments/manifests/servicemesh/number_service/vservice.yaml
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,37 @@ | ||
apiVersion: networking.istio.io/v1 | ||
kind: VirtualService | ||
metadata: | ||
name: &name number-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
spec: | ||
hosts: | ||
- *name | ||
http: | ||
- route: | ||
- destination: | ||
host: *name | ||
subset: v1 | ||
weight: 100 | ||
--- | ||
apiVersion: networking.istio.io/v1 | ||
kind: DestinationRule | ||
metadata: | ||
name: &name number-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
spec: | ||
host: *name | ||
subsets: | ||
- name: v1 | ||
labels: | ||
version: v1 | ||
- name: v2 | ||
labels: | ||
version: v2 |
27 changes: 27 additions & 0 deletions
27
ocp/deployments/manifests/servicemesh/status_service/authorization_policy.yaml
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,27 @@ | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
name: &name status-service | ||
labels: &labels | ||
app.kubernetes.io/name: *name | ||
app.kubernetes.io/instance: *name | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
spec: | ||
selector: | ||
matchLabels: *labels | ||
action: ALLOW | ||
rules: | ||
- from: | ||
- source: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: view-service | ||
app.kubernetes.io/instance: view-service | ||
app.kubernetes.io/component: api | ||
app.kubernetes.io/part-of: microservices-demo | ||
to: | ||
- operation: | ||
methods: ["GET"] | ||
ports: ["8082"] | ||
paths: ["/status"] |
Oops, something went wrong.