Compare commits
1 Commits
03d5d25038
...
chart
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d7f473982 |
41
arch/diagrams/src/oc-catalog.puml
Normal file
41
arch/diagrams/src/oc-catalog.puml
Normal file
@@ -0,0 +1,41 @@
|
||||
@startuml
|
||||
skinparam componentStyle rectangle
|
||||
|
||||
node "Kubernetes Cluster" {
|
||||
|
||||
cloud "Service: oc-catalog" as oc_catalog_service {
|
||||
oc_catalog_service : Type: NodePort
|
||||
oc_catalog_service : External NodePort: 8087 # Exposed NodePort for external access
|
||||
oc_catalog_service : Internal TargetPort: 8080
|
||||
}
|
||||
|
||||
' Deployment for oc-catalog managing the pods
|
||||
node "Deployment: oc-catalog" as oc_catalog_deployment {
|
||||
oc_catalog_deployment : Replicas: {{ .Values.replicaCount }}
|
||||
oc_catalog_deployment : Image: registry.dev.svc.cluster.local:5000/oc-catalog:latest
|
||||
oc_catalog_deployment : PullPolicy: IfNotPresent
|
||||
oc_catalog_deployment : TargetPort: 8080
|
||||
|
||||
node "Pod: oc-catalog-1" as catalog_1 {
|
||||
component "Container: oc-catalog" as oc_catalog_container1 {
|
||||
oc_catalog_container1 : Internal Port: 8080
|
||||
oc_catalog_container1 : MONGO_DATABASE=DC_myDC
|
||||
oc_catalog_container1 : MONGO_URI=mongodb://mongo:27017
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oc_catalog_service --> oc_catalog_deployment : Routes traffic to Deployment
|
||||
oc_catalog_deployment --> catalog_1 : Manages Pods
|
||||
|
||||
' MongoDB service and statefulset
|
||||
|
||||
cloud "Service: mongo" as mongo_service {
|
||||
mongo_service : Type: ClusterIP
|
||||
mongo_service : Internal Port: 27017
|
||||
}
|
||||
|
||||
catalog_1 --> mongo_service : Connects to MongoDB
|
||||
|
||||
}
|
||||
@enduml
|
||||
16
go.mod
16
go.mod
@@ -5,7 +5,7 @@ go 1.22.0
|
||||
toolchain go1.22.4
|
||||
|
||||
require (
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240927112324-cdf513c2c454
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240904122101-ad96b5046415
|
||||
github.com/beego/beego/v2 v2.3.0
|
||||
github.com/smartystreets/goconvey v1.7.2
|
||||
)
|
||||
@@ -17,14 +17,14 @@ require (
|
||||
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.22.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.22.0 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
|
||||
github.com/goraz/onion v0.1.3 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/klauspost/compress v1.17.10 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
@@ -49,12 +49,12 @@ require (
|
||||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
go.mongodb.org/mongo-driver v1.17.0 // indirect
|
||||
golang.org/x/crypto v0.27.0 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
go.mongodb.org/mongo-driver v1.16.1 // indirect
|
||||
golang.org/x/crypto v0.26.0 // indirect
|
||||
golang.org/x/net v0.28.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.25.0 // indirect
|
||||
golang.org/x/text v0.18.0 // indirect
|
||||
golang.org/x/sys v0.24.0 // indirect
|
||||
golang.org/x/text v0.17.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
16
go.sum
16
go.sum
@@ -2,8 +2,6 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20240904121108-a0cbf9ac6f4e h1:G1GHiIRqTotMd
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240904121108-a0cbf9ac6f4e/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240904122101-ad96b5046415 h1:X1i4EW0N9UNLnJbI5cHFVm/vWGpnUAILBGWuNzEOOcQ=
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240904122101-ad96b5046415/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240927112324-cdf513c2c454 h1:F5/oBMypnb6Mdvcf6N8y8v/DgfglPQ6VsQUY7hjC2zA=
|
||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240927112324-cdf513c2c454/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I=
|
||||
github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo=
|
||||
@@ -33,8 +31,6 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
|
||||
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
|
||||
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
@@ -55,8 +51,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
||||
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
|
||||
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
@@ -134,15 +128,11 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfS
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8=
|
||||
go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
|
||||
go.mongodb.org/mongo-driver v1.17.0 h1:Hp4q2MCjvY19ViwimTs00wHi7G4yzxh4/2+nTx8r40k=
|
||||
go.mongodb.org/mongo-driver v1.17.0/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
@@ -151,8 +141,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
||||
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
@@ -169,8 +157,6 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -179,8 +165,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
|
||||
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
|
||||
5
helm/Chart.yaml
Normal file
5
helm/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: v2
|
||||
name: oc-catalog
|
||||
description: A Helm chart for deploying the oc-catalog application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0"
|
||||
67
helm/README.md
Normal file
67
helm/README.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# README.md - `oc-catalog` Helm Chart
|
||||
|
||||
This document describes the different tags found in the `values.yml` file used in the Helm chart for the `oc-catalog` component.
|
||||
|
||||
## Tags in the `values.yml` file
|
||||
|
||||
### `replicaCount`
|
||||
- **Description**: Defines the number of replicas for the deployment. A replica represents an instance of the application that will be deployed.
|
||||
- **Example**: `1` means a single instance of the `oc-catalog` service will be deployed.
|
||||
|
||||
### `image.repository`
|
||||
- **Description**: Specifies the URL of the Docker image registry where the `oc-catalog` component image is stored.
|
||||
- **Example**: `registry.dev.svc.cluster.local:5000/oc-catalog` refers to a local registry hosted within the `cluster.local` network.
|
||||
|
||||
### `image.tag`
|
||||
- **Description**: Indicates the tag of the Docker image to use. Typically, this could be a specific version or `latest` to always pull the latest version.
|
||||
- **Example**: `latest` means the most recent version of the image will be used.
|
||||
|
||||
### `image.pullPolicy`
|
||||
- **Description**: Defines the image pull policy. The possible options are:
|
||||
- `Always`: Always pull the image.
|
||||
- `IfNotPresent`: Pull the image only if it is not already present on the node.
|
||||
- `Never`: Never pull the image.
|
||||
- **Example**: `IfNotPresent` means the image will only be pulled if it is not already present on the node.
|
||||
|
||||
### `env.mongoDatabase`
|
||||
- **Description**: Defines the name of the MongoDB database the application will connect to.
|
||||
- **Example**: `DC_myDC` refers to the MongoDB database used by the application.
|
||||
|
||||
### `env.mongoUrl`
|
||||
- **Description**: Specifies the connection URL for MongoDB used by the application.
|
||||
- **Example**: `mongodb://toto:27017` indicates that the application will connect to the MongoDB instance hosted at `toto` on port `27017`.
|
||||
|
||||
### `service.type`
|
||||
- **Description**: Defines the type of Kubernetes service. Possible types include:
|
||||
- `ClusterIP`: The service is only accessible within the cluster.
|
||||
- `NodePort`: The service is accessible via a specific port on all cluster nodes.
|
||||
- `LoadBalancer`: The service is exposed via an external Load Balancer.
|
||||
- **Example**: `ClusterIP` means the service will only be accessible within the Kubernetes cluster.
|
||||
|
||||
### `service.port`
|
||||
- **Description**: Specifies the port on which the service will be exposed within the cluster.
|
||||
- **Example**: `8087` means the service will be accessible on port `8087`.
|
||||
|
||||
### `service.targetPort`
|
||||
- **Description**: Defines the port on which the application listens inside the container.
|
||||
- **Example**: `8080` means the application listens on port `8080` within the container.
|
||||
|
||||
### `resources.limits.cpu`
|
||||
- **Description**: Specifies the maximum amount of CPU (in millicores) allocated to the container.
|
||||
- **Example**: `500m` means the container can use up to 0.5 CPU (or 50% of a full CPU core).
|
||||
|
||||
### `resources.limits.memory`
|
||||
- **Description**: Specifies the maximum amount of memory (in MiB) allocated to the container.
|
||||
- **Example**: `512Mi` means the container can use up to 512 MiB of memory.
|
||||
|
||||
### `resources.requests.cpu`
|
||||
- **Description**: Defines the guaranteed amount of CPU (in millicores) for the container. Kubernetes will ensure this amount is always available.
|
||||
- **Example**: `250m` means the container will have at least 0.25 CPU (or 25% of a full CPU core).
|
||||
|
||||
### `resources.requests.memory`
|
||||
- **Description**: Defines the guaranteed amount of memory (in MiB) for the container. Kubernetes will reserve this memory for the container.
|
||||
- **Example**: `256Mi` means the container will have at least 256 MiB of memory.
|
||||
|
||||
## Conclusion
|
||||
|
||||
This `values.yml` file allows configuring the deployment settings for the `oc-catalog` component. Each tag plays a specific role in defining the Docker image, service configuration, and resource allocation for the container within the Kubernetes cluster.
|
||||
7
helm/templates/configmap.yml
Normal file
7
helm/templates/configmap.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: oc-catalog-configmap
|
||||
data:
|
||||
MONGO_DATABASE: "{{ .Values.env.mongoDatabase }}"
|
||||
OCCATALOG_MONGOURL: "{{ .Values.env.mongoUrl }}"
|
||||
36
helm/templates/deployment.yml
Normal file
36
helm/templates/deployment.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: oc-catalog
|
||||
labels:
|
||||
app: oc-catalog
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: oc-catalog
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.targetPort }}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: oc-catalog-configmap
|
||||
imagePullSecrets:
|
||||
{{- if .Values.imagePullSecrets }}
|
||||
{{- range .Values.imagePullSecrets }}
|
||||
- name: {{ .name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
16
helm/templates/service.yml
Normal file
16
helm/templates/service.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: oc-catalog
|
||||
labels:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
selector:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.service.targetPort }}
|
||||
18
helm/values.yaml
Normal file
18
helm/values.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: registry.dev.svc.cluster.local:5000/oc-catalog
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
type: NodePort
|
||||
port: 8087
|
||||
targetPort: 8080
|
||||
|
||||
env:
|
||||
mongoDatabase: DC_myDC
|
||||
mongoUrl: mongodb://toto:27017
|
||||
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
6
main.go
6
main.go
@@ -21,12 +21,12 @@ func main() {
|
||||
o.GetStringDefault("MONGO_URL", "mongodb://127.0.0.1:27017"),
|
||||
o.GetStringDefault("MONGO_DATABASE", "DC_myDC"),
|
||||
"",
|
||||
o.GetStringDefault("LOKI_URL", ""),
|
||||
o.GetStringDefault("LOG_LEVEL", "info"),
|
||||
o.GetStringDefault("lokiurl", ""),
|
||||
o.GetStringDefault("loglevel", "info"),
|
||||
)
|
||||
// Beego init
|
||||
beego.BConfig.AppName = appname
|
||||
beego.BConfig.Listen.HTTPPort = 8080
|
||||
beego.BConfig.Listen.HTTPPort = o.GetIntDefault("port", 8080)
|
||||
beego.BConfig.WebConfig.DirectoryIndex = true
|
||||
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// @Description OpenCloud catalog
|
||||
// @Contact admin@o-cloud.io
|
||||
// @TermsOfServiceUrl http://cloud.o-forge.io/
|
||||
// @License AGPL
|
||||
// @LicenseUrl https://www.gnu.org/licenses/agpl-3.0.html
|
||||
// @License MIT
|
||||
// @LicenseUrl https://opensource.org/license/mit
|
||||
package routers
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user