Skip to content

Commit

Permalink
DE test skaffold deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz Nowak committed Oct 31, 2023
1 parent 4e2483f commit aca64d3
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dynamic_enviroment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
echo "$KUBE_CONFIG" | base64 --decode > $GITHUB_WORKSPACE/.kube/config
- name: Deploy to K8s
run: kubectl --kubeconfig "$GITHUB_WORKSPACE/.kube/config" get nodes
run: skaffold run --kubeconfig "$GITHUB_WORKSPACE/.kube/config" --filename dev-skaffold.yaml --default-repo registry.internal.visoft.solutions
6 changes: 3 additions & 3 deletions skaffold.yaml → dev-skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apiVersion: skaffold/v4beta6
kind: Config
metadata:
name: ksox-landing
name: dev-ksox-landing
build:
platforms:
- linux/amd64
artifacts:
- image: ksox-landing
- image: dev-ksox-landing
context: ./
docker:
dockerfile: ksox-landing.dockerfile
manifests:
kustomize:
paths:
- ./k8s/patches/prod
- ./k8s/dev
69 changes: 69 additions & 0 deletions k8s/dev/ksox-landing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ksox-landing
labels:
app: ksox-landing
spec:
selector:
matchLabels:
app: ksox-landing
template:
metadata:
labels:
app: ksox-landing
spec:
containers:
- name: ksox-landing
image: dev-ksox-landing
envFrom:
- secretRef:
name: ksox-landing-secrets
- configMapRef:
name: ksox-landing-config
ports:
- containerPort: 80
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 1000Mi
cpu: 1000m
---
apiVersion: v1
kind: Service
metadata:
name: ksox-landing
spec:
selector:
app: ksox-landing
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ksox-landing
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
ingressClassName: ingress-nginx-internal
tls:
- hosts:
- landing.ksox.finance.internal.visoft.solutions
secretName: internal-visoft-solutions-tls
rules:
- host: landing.ksox.finance.internal.visoft.solutions
http:
paths:
- path: /(.*)
pathType: ImplementationSpecific
backend:
service:
name: ksox-landing
port:
number: 80
19 changes: 19 additions & 0 deletions k8s/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: dev-ksox-finance

resources:
- ./ksox-landing.yaml

secretGenerator:
- name: ksox-landing-secrets
env: ./enviroment/ksox-landing-secrets.env

configMapGenerator:
- name: ksox-landing-config
env: ./enviroment/ksox-landing-config.env


generatorOptions:
disableNameSuffixHash: true
File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions k8s/local/ksox-finance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ksox-landing
labels:
app: ksox-landing
spec:
selector:
matchLabels:
app: ksox-landing
template:
metadata:
labels:
app: ksox-landing
spec:
containers:
- name: ksox-landing
image: local-ksox-landing
envFrom:
- secretRef:
name: ksox-landing-secrets
- configMapRef:
name: ksox-landing-config
ports:
- containerPort: 80
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 1000Mi
cpu: 1000m
---
apiVersion: v1
kind: Service
metadata:
name: ksox-landing
spec:
selector:
app: ksox-landing
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ksox-finance
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
tls:
- hosts:
- ksox.finance.test
secretName: ksox-finance-tls
rules:
- host: ksox.finance.test
http:
paths:
- path: /(.*)
pathType: ImplementationSpecific
backend:
service:
name: ksox-finance
port:
number: 80
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: ksox-finance
namespace: local-ksox-finance

resources:
- ./../../resources
- ./certificates.yaml
- ./issuer.yaml
- ./ksox-finance.yaml

secretGenerator:
- name: ksox-finance-secrets
env: ./enviroment/ksox-finance-secrets.env
- name: ksox-landing-secrets
env: ./enviroment/ksox-landing-secrets.env

configMapGenerator:
- name: ksox-finance-config
env: ./enviroment/ksox-finance-config.env
- name: ksox-landing-config
env: ./enviroment/ksox-landing-config.env


generatorOptions:
disableNameSuffixHash: true
23 changes: 0 additions & 23 deletions k8s/patches/dev/ksox-finance.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions k8s/patches/prod/ksox-landing.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions k8s/resources/ksox-landing.yaml → k8s/prod/ksox-landing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,28 @@ spec:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ksox-landing
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
ingressClassName: ingress-nginx-external
tls:
- hosts:
- landing.ksox.finance
secretName: ksox-finance-tls
rules:
- host: landing.ksox.finance
http:
paths:
- path: /(.*)
pathType: ImplementationSpecific
backend:
service:
name: ksox-landing
port:
number: 80
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ kind: Kustomization
namespace: ksox-finance

resources:
- ./../../resources
- ./ksox-landing.yaml

secretGenerator:
Expand Down
5 changes: 0 additions & 5 deletions k8s/resources/kustomization.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions local-skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: skaffold/v4beta6
kind: Config
metadata:
name: local-ksox-landing
build:
platforms:
- linux/amd64
artifacts:
- image: local-ksox-landing
context: ./
docker:
dockerfile: ksox-landing.dockerfile
manifests:
kustomize:
paths:
- ./k8s/local
16 changes: 16 additions & 0 deletions prod-skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: skaffold/v4beta6
kind: Config
metadata:
name: prod-ksox-landing
build:
platforms:
- linux/amd64
artifacts:
- image: prod-ksox-landing
context: ./
docker:
dockerfile: ksox-landing.dockerfile
manifests:
kustomize:
paths:
- ./k8s/prod

0 comments on commit aca64d3

Please sign in to comment.