diff --git a/k8s/skymeter-chart/.helmignore b/k8s/skymeter-chart/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/k8s/skymeter-chart/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/k8s/skymeter-chart/Chart.yaml b/k8s/skymeter-chart/Chart.yaml new file mode 100644 index 0000000..d3c9bd2 --- /dev/null +++ b/k8s/skymeter-chart/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: skymeter-chart +description: A Helm chart for Kubernetes + +# 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: "1.16.0" diff --git a/k8s/deployment.yml b/k8s/skymeter-chart/templates/deployment.yml similarity index 93% rename from k8s/deployment.yml rename to k8s/skymeter-chart/templates/deployment.yml index feac9da..e5ac2ff 100644 --- a/k8s/deployment.yml +++ b/k8s/skymeter-chart/templates/deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: skymeter - image: soorajsky/sky-meter:release-0b314b4 + image: soorajsky/sky-meter:release-ba9f77d envFrom: - configMapRef: name: skymeter-env # Replace with your ConfigMap name diff --git a/k8s/env-configmap.yml b/k8s/skymeter-chart/templates/env-configmap.yml similarity index 100% rename from k8s/env-configmap.yml rename to k8s/skymeter-chart/templates/env-configmap.yml diff --git a/k8s/settings-config.yml b/k8s/skymeter-chart/templates/settings-config.yml similarity index 100% rename from k8s/settings-config.yml rename to k8s/skymeter-chart/templates/settings-config.yml diff --git a/k8s/skymeter-chart/values.yaml b/k8s/skymeter-chart/values.yaml new file mode 100644 index 0000000..0a95a55 --- /dev/null +++ b/k8s/skymeter-chart/values.yaml @@ -0,0 +1,70 @@ +# Default values for skymeter-chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/k8s/yaml-files/deployment.yml b/k8s/yaml-files/deployment.yml new file mode 100644 index 0000000..e5ac2ff --- /dev/null +++ b/k8s/yaml-files/deployment.yml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: skymeter-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: skymeter + template: + metadata: + labels: + app: skymeter + spec: + containers: + - name: skymeter + image: soorajsky/sky-meter:release-ba9f77d + envFrom: + - configMapRef: + name: skymeter-env # Replace with your ConfigMap name + volumeMounts: + - name: settings-volume + mountPath: /home/skyuser/settings.yml # Replace with the desired path inside the container + subPath: settings.yml + volumes: + - name: settings-volume + configMap: + name: skymeter-settings # Replace with your ConfigMap name + items: + - key: settings.yml + path: settings.yml + diff --git a/k8s/yaml-files/env-configmap.yml b/k8s/yaml-files/env-configmap.yml new file mode 100644 index 0000000..170ed6f --- /dev/null +++ b/k8s/yaml-files/env-configmap.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: skymeter-env # Replace with your desired ConfigMap name +data: + DnsServer: "8.8.8.8" + DbUrl: "host=192.168.0.7 user=postgres password=postgres dbname=postgres port=5433 sslmode=disable" + EmailPass: "your-pass-here" + EmailFrom: "youremail@server.com" + EmailPort: "587" + EmailServer: "smtp.server-address-here.com" + OpsgenieSecret: "your-opsgenie-key-here" + Mode: "prod" + SentryDsn: "test" + diff --git a/k8s/yaml-files/settings-config.yml b/k8s/yaml-files/settings-config.yml new file mode 100644 index 0000000..a7a767b --- /dev/null +++ b/k8s/yaml-files/settings-config.yml @@ -0,0 +1,44 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: skymeter-settings # Replace with your desired ConfigMap name +data: + settings.yml: | + opegenie: + enabled: false + email: + enabled: true + groups: + - name: prod + emails: + - reviceremail@gmail.com + - reciver@yahoo.com + - name: dev + emails: + - reviceremail@gmail.com + - reciver@yahoo.com + domains: + - name: https://skywalks.in + enabled: true + timeout: 10 + skip_ssl: false + frequency: 10 + group: dev + - name: https://sky-meter.skywalks.in + enabled: true + timeout: 10 + skip_ssl: false + frequency: 60 + group: dev + - name: https://github.com + enabled: true + timeout: 10 + skip_ssl: false + frequency: 60 + group: prod + - name: https://githcccubs.com + enabled: true + timeout: 10 + skip_ssl: false + frequency: 60 + group: prod