Skip to main content
Version: Next

Full Stack Example Manifests

base/back-end/deployment.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: back-end
namespace: fullstack-example
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: back-end
template:
metadata:
labels:
app: back-end
spec:
containers:
- image: back-end:main
imagePullPolicy: Always
name: back-end
envFrom:
- secretRef:
name: backend-secrets
ports:
- containerPort: 8000
imagePullSecrets:
- name: backend-pullcreds
base/back-end/kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- secret.yaml
- virtual-service.yaml
base/back-end/secret.yaml
---
apiVersion: v1
kind: Secret
metadata:
name: backend-secrets
type: Opaque
data:
# Non-encoded value: mongodb://mongosuperuser:supersecretpass123@mongo-db-sv:27017
MONGO_URI: bW9uZ29kYjovL21vbmdvc3VwZXJ1c2VyOnN1cGVyc2VjcmV0cGFzczEyM0Btb25nby1kYi1zdjoyNzAxNw==
base/back-end/service.yaml
---
apiVersion: v1
kind: Service
metadata:
name: back-end
spec:
ports:
- name: backend-port
port: 8080
targetPort: 8080
selector:
app: back-end
base/back-end/virtual-service.yaml
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: back-end
namespace: fullstack-example
spec:
hosts:
- back-end.dev.dsop.structsure.io
- back-end.apps.dsop.structsure.io
gateways:
- istio-system/public
http:
- route:
- destination:
host: back-end
port:
number: 8080
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: backend-pipeline
namespace: fullstack-example
spec:
hosts:
- back-end.pipeline.dev.dsop.structsure.io
- back-end.pipeline.apps.dsop.structsure.io
gateways:
- istio-system/pipeline
http:
- route:
- destination:
host: back-end
port:
number: 8080
base/front-end/deployment.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: front-end
namespace: fullstack-example
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: front-end
template:
metadata:
labels:
app: front-end
spec:
containers:
- image: front-end:main
imagePullPolicy: Always
name: front-end
ports:
- containerPort: 8080
imagePullSecrets:
- name: frontend-pullcreds
base/front-end/kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- deployment.yaml
- service.yaml
- virtual-service.yaml
base/front-end/service.yaml
---
apiVersion: v1
kind: Service
metadata:
name: front-end
spec:
ports:
- name: frontend-port
port: 8080
targetPort: 8080
selector:
app: front-end
base/front-end/virtual-service.yaml
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: front-end
namespace: fullstack-example
spec:
hosts:
- front-end.dev.dsop.structsure.io
- front-end.apps.dsop.structsure.io
gateways:
- istio-system/public
http:
- match:
- uri:
prefix: "/api/"
- uri:
prefix: "/api"
rewrite:
uri: "/"
route:
- destination:
# host: back-end.dev.dsop.structsure.io
host: back-end
# port:
# number: 8000
- route:
- destination:
host: front-end
port:
number: 8080
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: frontend-pipeline
namespace: fullstack-example
spec:
gateways:
- istio-system/pipeline
hosts:
- front-end.pipeline.dev.dsop.structsure.io
- front-end.pipeline.apps.dsop.structsure.io
http:
- route:
- destination:
host: front-end
port:
number: 8080
base/resources/namespace.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: fullstack-example
labels:
istio-injection: enabled
zarf.dev/agent: ignore
base/kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: fullstack-example

resources:
- resources/namespace.yaml
- back-end
- front-end

commonLabels:
project: fullstack-example
dev/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: fullstack-example

resources:
- ../base

generators:
- secrets.yaml

commonLabels:
protect: keycloak

images:
- name: back-end
newName: registry.build.smoothglue.io/braingu/fullstack-example/back-end/164
newTag: v1.5
- name: front-end
newName: registry.build.smoothglue.io/braingu/fullstack-example/front-end/164
newTag: v1.5
dev/pull-credentials.json
{
"auths": {
"registry.build.smoothglue.io": {
"username": "your-project-access-token-user",
"password": "your-project-access-token",
"auth": "base64-encoded-username-colon-password"
}
}
dev/secrets.yaml
apiVersion: goabout.com/v1beta1
kind: SopsSecretGenerator
metadata:
name: pull-credentials
disableNameSuffixHash: true
type: kubernetes.io/dockerconfigjson
files:
- .dockerconfigjson=pull-credentials.json