diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f28c5b7805762a5d0123cd27b0613c27e086568d..da4e59994d70e0e0b2816988df2e13f4c85aa723 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: alpine variables: - VERSION: v1.1.0 + VERSION: v1.1.1 stages: - build diff --git a/data/data.go b/data/data.go index 452bc8a0dedaa739975bca5cd93d17ab9707cf11..d14f92a0fb1e6df0eadc29e2399ce69186d781cf 100644 --- a/data/data.go +++ b/data/data.go @@ -93,31 +93,3 @@ func CreateNewRoute() []*Station { return route } - -//func CreateNewRoute() []*Station { -// route := make([]*Station, len(Stations)) -// route[0] = Stations["first"] -// route[len(Stations)-1] = Stations["last"] -// -// keys := make([]string, len(Stations)-2) -// i := 0 -// for k := range Stations { -// switch k { -// case "first", "last": -// default: -// keys[i] = k -// i++ -// } -// } -// rand.Shuffle(len(keys), func(i, j int) { -// keys[i], keys[j] = keys[j], keys[i] -// }) -// -// i = 1 -// for _, k := range keys { -// route[i] = Stations[k] -// i++ -// } -// -// return route -//} diff --git a/k8s/Chart.yaml b/k8s/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e4aa98c543288c7a67a021fd9a4c4fd0b7e76f07 --- /dev/null +++ b/k8s/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: becskasszasch +description: + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "prod" diff --git a/k8s/templates/cert.yml b/k8s/templates/cert.yml new file mode 100644 index 0000000000000000000000000000000000000000..5b6e14f04f1b220406e337664ae1eeb0d2361e32 --- /dev/null +++ b/k8s/templates/cert.yml @@ -0,0 +1,12 @@ +apiVersion: cert-manager.io/v1alpha2 +kind: Certificate +metadata: + name: {{ .Values.Name }} + namespace: istio-system +spec: + commonName: {{ .Values.Domain }} + dnsNames: + - {{ .Values.Domain }} + issuerRef: + name: letsencrypt-issuer + secretName: {{ .Values.Name }}-cert diff --git a/k8s/templates/deployment.yml b/k8s/templates/deployment.yml new file mode 100644 index 0000000000000000000000000000000000000000..d15a8f125269e11511bc189a48a5bf1d44b7076f --- /dev/null +++ b/k8s/templates/deployment.yml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.Name }} +spec: + selector: + matchLabels: + app: {{ .Values.Name }} + template: + metadata: + labels: + app: {{ .Values.Name }} + spec: + containers: + - name: {{ .Values.Name }} + image: "blintmester/keresettaferi:{{ .Values.Tag }}" + ports: + - containerPort: 8080 + name: http + resources: + requests: + memory: 50Mi + cpu: 50m + limits: + memory: 500Mi + cpu: "1" + readinessProbe: + httpGet: + path: "/" + port: 8080 + initialDelaySeconds: 60 + failureThreshold: 3 + periodSeconds: 60 diff --git a/k8s/templates/istio.yml b/k8s/templates/istio.yml new file mode 100644 index 0000000000000000000000000000000000000000..e20507a78074eb2a6a889a2707b9666b7d167185 --- /dev/null +++ b/k8s/templates/istio.yml @@ -0,0 +1,34 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: Gateway +metadata: + name: {{ .Values.Name }}-gateway +spec: + selector: + istio: ingressgateway + servers: + - hosts: + - {{ .Values.Domain }} + port: + name: web + number: 443 + protocol: HTTPS + tls: + credentialName: {{ .Values.Name }}-cert + mode: SIMPLE + +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: {{ .Values.Name }} +spec: + gateways: + - {{ .Values.Name }}-gateway + hosts: + - {{ .Values.Domain }} + http: + - route: + - destination: + host: {{ .Values.Name }}-service + port: + number: 80 diff --git a/k8s/templates/service.yml b/k8s/templates/service.yml new file mode 100644 index 0000000000000000000000000000000000000000..d4ce5c155e932fa7095e4c8e9b4b6a69f84d05cd --- /dev/null +++ b/k8s/templates/service.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.Name }}-service +spec: + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 8080 + selector: + app: {{ .Values.Name }} diff --git a/k8s/values.yaml b/k8s/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..542a35007898e99e70137f09172fdf2308d76b31 --- /dev/null +++ b/k8s/values.yaml @@ -0,0 +1,6 @@ +replicas: 1 + +Domain: keresettaferi.kszk.bme.hu +Name: keresettaferi +Tag: "v1.1.1" +REGISTRY_CONF: "${REGISTRY_CONF}"