Skip to content

Commit

Permalink
added local folder, renamed namespace
Browse files Browse the repository at this point in the history
Signed-off-by: alfonso.iazzetti <alfonso.iazzetti@host.docker.internal>
  • Loading branch information
alfonso.iazzetti committed Sep 5, 2022
1 parent 6d12fca commit 5b06857
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .nexiazuredevops/pipeline-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,5 @@ stages:
inputs:
action: 'deploy'
kubernetesServiceConnection: $(kubernetes-service-connection-${{ parameters.env }})
namespace: mock-ec-${{ parameters.env }}
namespace: ${{ parameters.env }}
manifests: $(Pipeline.Workspace)/$(appVersion)-${{ parameters.env }}-manifest-app/*.yaml
6 changes: 3 additions & 3 deletions .nexiazuredevops/pipeline-kubectl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ stages:


- script: |
kubectl get pods -o wide -n mock-ec-prf
kubectl get services -o wide -n mock-ec-prf
kubectl get ing -o json | jq -r '.items[].spec.rules[].http.paths[] -n mock-ec-prf
kubectl get pods -o wide -n prf
kubectl get services -o wide -n prf
kubectl get ing -o json | jq -r '.items[].spec.rules[].http.paths[] -n prf
displayName: "Retrieve Info in namespace"
32 changes: 32 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Mock EC

## ENV REQUIREMENTS

```
JAVA 1.8
Docker
```

## How to run

Go in the root folder of the project and then:

### Build image
```
docker build -f Dockerfile -t mock-ec-prf-image:latest .
```

### Run

To run the docker:

```
docker run --name mock-ec-prf-cont mock-ec-prf-image:latest
```

or, with Kubernetes:

```
kubectl apply --kustomize kustomize/local/
```
29 changes: 29 additions & 0 deletions kustomize/local/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mock-ec-prf
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
spec:
restartPolicy: Always
containers:
- name: mock-ec-prf
image: mock-ec-prf-image
imagePullPolicy: Never
ports:
- name: mock-ec-prf
containerPort: 8484
protocol: TCP
resources:
requests:
memory: 1Gi
cpu: 300m
limits:
memory: 2Gi
cpu: 400m
20 changes: 20 additions & 0 deletions kustomize/local/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mock-ec-prf
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /mock-ec-prf(/|$)(.*)
backend:
service:
name: mock-ec-prf
port:
number: 8484
20 changes: 20 additions & 0 deletions kustomize/local/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: prf

images:
- name: mock-ec-prf-image
#newName: nodopauatregistrypci.azurecr.io/mock-ec-prf
#newTag: 1.1.1

resources:
- namespace.yaml
- ingress.yaml
- ../base

generatorOptions:
disableNameSuffixHash: true

patchesStrategicMerge:
- deployment.yaml
6 changes: 6 additions & 0 deletions kustomize/local/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: mock-ec-prf
name: prf
2 changes: 1 addition & 1 deletion kustomize/prf/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: mock-ec-prf
namespace: prf

images:
- name: mock-ec-prf-image
Expand Down
2 changes: 1 addition & 1 deletion kustomize/prf/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: mock-ec-prf
name: mock-ec-prf
name: prf

0 comments on commit 5b06857

Please sign in to comment.