diff --git a/Glooconfig.yaml b/Glooconfig.yaml new file mode 100644 index 000000000..9d2c9de37 --- /dev/null +++ b/Glooconfig.yaml @@ -0,0 +1,14 @@ +gatewayProxies: + gatewayProxy: + service: + type: NodePort + httpPort: 80 + httpsPort: 443 + httpNodePort: 31500 + httpsNodePort: 32500 + +settings: + create: true + writeNamespace: default + watchNamespaces: + - default diff --git a/Kindconfig.yaml b/Kindconfig.yaml index 4690ba2e6..d5b856d50 100644 --- a/Kindconfig.yaml +++ b/Kindconfig.yaml @@ -10,6 +10,13 @@ kindV1Alpha4Cluster: apiServerAddress: 127.0.0.1 nodes: - role: control-plane + extraPortMappings: + - containerPort: 31500 + hostPort: 31500 + protocol: TCP + - containerPort: 32500 + hostPort: 32500 + protocol: TCP --- apiVersion: ctlptl.dev/v1alpha1 kind: Registry diff --git a/README.md b/README.md index 9466d5c47..b21df51dd 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Of course, if you haven't already done so, you should check out [Tidepool](https - [Install Helm](#install-helm) - [Install Tilt](#install-tilt) - [Install Tilt "cattle patrol" (ctlptl)](#install-ctlptl) + - [Install Gloo Gateway CLI (glooctl)](#install-glooctl) - [Install Netcat](#install-netcat) - [Install and Configure MongoDB](#install-and-configure-mongodb) - [Clone This Repository](#clone-this-repository) @@ -141,6 +142,18 @@ ctlptl apply -f Kindconfig.yaml This config will provision and start up the Kubernetes server, and a private docker registry that Tilt will deploy development builds to as you work locally on the Tidepool services. +## Install glooctl + +We provision the Gloo gateway, which is responsible for service routing, using glooctl. Please follow the [glooctl Installation Instructions](https://docs.solo.io/gloo-edge/master/installation/glooctl_setup/). + +Once installed, you can provision the kubernetes stack with `glooctl`, using the `Glooconfig.yaml` configuration provided at the root of this repo. + +``` +glooctl install gateway -n default --values Glooconfig.yaml +``` + +This config will provision the Gloo gateway in the `default` namespace. This only needs to be provisioned once. + ## Install Netcat Netcat should be installed by default on an recent versions of MacOS. If it is not, you can install it via homebrew. @@ -442,7 +455,7 @@ The administrator credentials can be tweaked by setting KEYCLOAK_USER and KEYCLO ## Creating An Account -Once your local Tidepool is running, open your Chrome browser and browse to http://localhost:3000. You should see the Tidepool login page running from your local computer, assuming everything worked as expected. Go ahead and signup for a new account. Remember, all accounts and data created via this local Tidepool are _ONLY_ stored on your computer. _No_ data is stored on any of the Tidepool servers. +Once your local Tidepool is running, open your Chrome browser and browse to http://localhost:31500. You should see the Tidepool login page running from your local computer, assuming everything worked as expected. Go ahead and signup for a new account. Remember, all accounts and data created via this local Tidepool are _ONLY_ stored on your computer. _No_ data is stored on any of the Tidepool servers. ## Verifying An Account Email @@ -573,7 +586,7 @@ becomes | Repository Name | Docker Container Name (``) | Description | Language | Git Clone URL (``) | Default Clone Directory (``) | | ---------------------------------------------------------------- | ------------------------------------------------- | ------------------------------- | ------------------------------ | -------------------------------------------------- | --------------------------------------------------------- | -| [blip](https://github.com/tidepool-org/blip) | blip | Web (ie. http://localhost:3000) | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/blip.git | ../blip | +| [blip](https://github.com/tidepool-org/blip) | blip | Web (ie. http://localhost:31500) | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/blip.git | ../blip | | [gatekeeper](https://github.com/tidepool-org/gatekeeper) | gatekeeper | Permissions | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/gatekeeper.git | ../gatekeeper | | [highwater](https://github.com/tidepool-org/highwater) | highwater | Metrics | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/highwater.git | ../highwater | | [hydrophone](https://github.com/tidepool-org/hydrophone) | hydrophone | Email, Invitations | [Golang](https://golang.org/) | https://github.com/tidepool-org/hydrophone.git | ~/go/src/github.com/tidepool-org/hydrophone | @@ -761,9 +774,9 @@ blip: image: tidepool-k8s-blip # Uncommented hostPath: ../blip # Uncommented and path matches the cloned blip repo location containerPath: "/app" - apiHost: "http://localhost:3000" + apiHost: "http://localhost:31500" webpackDevTool: cheap-module-eval-source-map - webpackPublicPath: "http://localhost:3000" + webpackPublicPath: "http://localhost:31500" linkedPackages: - name: tideline packageName: tideline @@ -793,9 +806,9 @@ blip: image: tidepool-k8s-blip hostPath: ../blip containerPath: "/app" - apiHost: "http://localhost:3000" + apiHost: "http://localhost:31500" webpackDevTool: cheap-module-eval-source-map - webpackPublicPath: "http://localhost:3000" + webpackPublicPath: "http://localhost:31500" linkedPackages: # ... - name: viz @@ -897,7 +910,7 @@ This will allow your changes to be tracked properly in version control, and Tilt | Service | Standard Port(s) | | ----------------------------------------------------------------- | ---------------------- | -| [blip](https://github.com/tidepool-org/blip) | 3000 | +| [blip](https://github.com/tidepool-org/blip) | 31500 | | [export](https://github.com/tidepool-org/export) | 9300 | | [gatekeeper](https://github.com/tidepool-org/gatekeeper) | 9123 | | [hakken](https://github.com/tidepool-org/hakken) | 8000 | @@ -966,7 +979,7 @@ If your services are running properly, you can simply ignore the state reporting Currently, there is a known issue where at times the gateway proxy service that handles incoming requests loses track of the local blip service. -This will present itself usually with the web app getting stuck in a loading state in the browser, or possibly resolving with an error message like: `‘No healthy upstream on blip (http://localhost:3000)` +This will present itself usually with the web app getting stuck in a loading state in the browser, or possibly resolving with an error message like: `‘No healthy upstream on blip (http://localhost:31500)` The solution first solution to try is to restart the gloo `gateway` services, which should restore access in a few moments: diff --git a/Tiltconfig.yaml b/Tiltconfig.yaml index ab44d16c7..953f30005 100644 --- a/Tiltconfig.yaml +++ b/Tiltconfig.yaml @@ -4,14 +4,21 @@ ### Global Config Start ### global: + glooingress: + enabled: true + jwt: + disabled: true + extauth: + enabled: false gateway: default: protocol: http - host: localhost:3000 + host: localhost:31500 domain: localhost proxy: name: gateway-proxy namespace: default + targetPort: 0 linkerdsupport: enabled: false ports: @@ -32,22 +39,13 @@ global: ### Global Config End ### ### Gateway Config Start ### -gateway-proxy: - portForwards: ['3000'] - -gateway: - validation: - enabled: false - glooingress: enabled: true - jwt: - enabled: false virtualServices: http: name: "internal" dnsNames: ["*"] - serveAllDomains: true + port: "31500" options: cors: allowCredentials: true @@ -71,7 +69,6 @@ glooingress: - x-tidepool-trace-request - x-tidepool-trace-session maxAge: 600s - port: "3000" apiServer: enable: false @@ -225,11 +222,11 @@ blip: # image: tidepool-k8s-blip # Uncomment to build and run local image or a specific remote image # hostPath: ../blip # Uncomment to build and run local image containerPath: '/app' - apiHost: 'http://localhost:3000' + apiHost: 'http://localhost:31500' rollbarPostServerToken: '' # Rollbar post_server_item access token for posting source maps on production builds webpackDevTool: cheap-module-eval-source-map webpackDevToolViz: cheap-source-map # Suggest changing `cheap-source-map` to the slower, but far more helpful `source-map` if debugging errors in viz package files - webpackPublicPath: 'http://localhost:3000/' + webpackPublicPath: 'http://localhost:31500/' linkedPackages: - name: viz packageName: '@tidepool/viz' @@ -329,6 +326,7 @@ hydrophone: deployment: env: clinicServiceEnabled: true + useMockNotifier: true # image: tidepool-k8s-hydrophone # Uncomment to build and run local image or a specific remote image # hostPath: ~/go/src/github.com/tidepool-org/hydrophone # Uncomment to build and run local image containerPath: '/go/src/github.com/tidepool-org/hydrophone' diff --git a/Tiltfile b/Tiltfile index 24e58be03..e8a32f5c5 100644 --- a/Tiltfile +++ b/Tiltfile @@ -33,9 +33,9 @@ def main(): local('tilt up --file=Tiltfile.kafka --legacy=0 --port=0 >/dev/null 2>&1 &') # Ensure proxy services are deployed - gateway_proxy_service = local('kubectl get service gateway-proxy --ignore-not-found') + gateway_proxy_service = local('kubectl get service gateway-proxy --ignore-not-found -n default') if not gateway_proxy_service: - local('tilt up --file=Tiltfile.gateway --legacy=0 --port=0 >/dev/null 2>&1 &') + fail("Gateway service is missing. Please install gateway via glooctl") # Wait until kafka is ready and kafka secrets are created if not kafka_service: diff --git a/Tiltfile.gateway b/Tiltfile.gateway deleted file mode 100644 index 83d13aa5a..000000000 --- a/Tiltfile.gateway +++ /dev/null @@ -1,174 +0,0 @@ -load('./Tiltfile.global', 'getAbsoluteDir', 'getNested', 'getConfig', 'getHelmValuesFile', 'getHelmOverridesFile', 'isShutdown') - -allow_k8s_contexts('kind-admin@mk') - -### Config Start ### -tidepool_helm_values_file = getHelmValuesFile() -tidepool_helm_overrides_file = getHelmOverridesFile() -config = getConfig() - -watch_file(tidepool_helm_values_file) -watch_file(tidepool_helm_overrides_file) - -local_helm_chart_dir = './local/charts' -absolute_gloo_chart_dir = getAbsoluteDir(local_helm_chart_dir) -gloo_helm_template_cmd = 'helm template --namespace default ' -local_downloads_dir = getAbsoluteDir('./local/downloads') - -is_shutdown = isShutdown() - -gloo_version = '1.11.23' -gloo_archive_name = 'gloo-{}.tgz'.format(gloo_version) -gloo_helm_url = 'https://storage.googleapis.com/solo-public-helm/charts/{}'.format(gloo_archive_name) - -### Config End ### - -### Main Start ### -def main(): - if not is_shutdown: - extractGlooGatewayCharts() - provisionClusterRoleBindings() - provisionConfigMaps() - provisionCRDs() - - provisionGlooGateway() - - # Back out of actual provisioning for debugging purposes by uncommenting below - # fail('NOT YET ;)') -### Main End ### - -### Extract Gloo Charts Start ### -def extractGlooGatewayCharts(): - local('mkdir -p {}'.format(local_downloads_dir)) - chart = '{}/{}'.format(local_downloads_dir, gloo_archive_name) - exists = False - for chart in listdir(local_downloads_dir): - if chart.find(gloo_archive_name) >= 0: - exists = True - break - - if exists == False: - local('cd {} && curl -O {}'.format(local_downloads_dir, gloo_helm_url)) - - local('mkdir -p {}'.format(absolute_gloo_chart_dir)) - local('tar -xzf {} -C {}'.format(chart, absolute_gloo_chart_dir)); -### Extract Gloo Charts End ### - -### Custom Resource Definitions Start ### -def provisionCRDs(): - crds_filename_map = { - 'authconfig': 'v1_AuthConfig', - 'gateway': 'v1_Gateway', - 'httpgateway': 'v1_MatchableHttpGateway', - 'routeoptions': 'v1_RouteOption', - 'routetable': 'v1_RouteTable', - 'virtualhostoptions': 'v1_VirtualHostOption', - 'virtualservice': 'v1_VirtualService', - 'proxy': 'v1_Proxy', - 'settings': 'v1_Settings', - 'upstream': 'v1_Upstream', - 'upstreamgroup': 'v1_UpstreamGroup', - 'graphqlapi': 'v1beta1_GraphQLApi.yaml', - 'ratelimitconfig': 'ratelimit_config', - } - - gloo_crds = listdir('{}/gloo/crds'.format(absolute_gloo_chart_dir)) - - for crd in crds_filename_map.keys(): - createdCRD = local('kubectl get crd {crd} --ignore-not-found'.format( - crd = crd - )) - - if not createdCRD: - for template in gloo_crds: - if template.find(crds_filename_map[crd]) >= 0: - local('kubectl --namespace=default apply --validate=0 --force -f {template}'.format( - template=template, - )) -### Custom Resource Definitions End ### - -### Cluster Role Bindings Start ### -def provisionClusterRoleBindings(): - serviceaccounts_filename_map = { - 'discovery': 'discovery-service-account', - 'gateway': 'gateway-service-account', - 'gateway-proxy': 'gateway-proxy-service-account', - 'gloo': 'gloo-service-account', - } - - gloo_templates = listdir('{}/gloo/templates'.format(absolute_gloo_chart_dir)) - - for serviceaccount in serviceaccounts_filename_map.keys(): - createdServiceAccount = local('kubectl get serviceaccount {serviceaccount} --ignore-not-found'.format( - serviceaccount = serviceaccount - )) - - if not createdServiceAccount: - for template in gloo_templates: - if template.find(serviceaccounts_filename_map[serviceaccount]) >= 0: - local('{templateCmd} -s {template} -f {baseConfig} -f {overridesFile} {chartDir}/gloo -g | kubectl --namespace=default apply --validate=0 --force -f -'.format( - chartDir=absolute_gloo_chart_dir, - templateCmd=gloo_helm_template_cmd, - baseConfig=tidepool_helm_values_file, - overridesFile=tidepool_helm_overrides_file, - template=template.replace('{}/gloo/'.format(absolute_gloo_chart_dir), ""), - )) - - clusterrolebinding = local('kubectl get clusterrolebinding {serviceaccount}-admin --ignore-not-found'.format( - serviceaccount = serviceaccount - )) - - if not clusterrolebinding: - local('kubectl create clusterrolebinding {serviceaccount}-admin --clusterrole cluster-admin --serviceaccount=default:{serviceaccount} --validate=0'.format( - serviceaccount = serviceaccount - )) -### Cluster Role Bindings End ### - -### Config Maps Start ### -def provisionConfigMaps(): - configmaps_filename_map = { - 'gateway-proxy': 'gateway-proxy-configmap', - } - - required_configmaps = configmaps_filename_map.keys() - - gloo_templates = listdir('{}/gloo/templates'.format(absolute_gloo_chart_dir)) - - # Skip configmaps already available on cluster - existing_configmaps = str(local("kubectl get --ignore-not-found configmaps -o=jsonpath='{.items[].metadata.name}'")).split() - for existing_configmap in existing_configmaps: - if ','.join(required_configmaps).find(existing_configmap) >= 0: - required_configmaps.remove(existing_configmap) - - for configmap in required_configmaps: - for template in gloo_templates: - if template.find(configmaps_filename_map[configmap]) >= 0: - local('{templateCmd} -s {template} -f {baseConfig} -f {overridesFile} {chartDir}/gloo -g | kubectl --namespace=default apply --validate=0 --force -f -'.format( - chartDir=absolute_gloo_chart_dir, - templateCmd=gloo_helm_template_cmd, - baseConfig=tidepool_helm_values_file, - overridesFile=tidepool_helm_overrides_file, - template=template.replace('{}/gloo/'.format(absolute_gloo_chart_dir), ""), - )) -### Config Maps End ### - -### Gloo Gateway Start ### -def provisionGlooGateway(): - for template in listdir('{}/gloo/templates'.format(absolute_gloo_chart_dir)): - if template.find('service-account') >= 0 or template.find('gateway-proxy-configmap') >= 0: - local('rm {}'.format(template)) - - k8s_yaml(local('{templateCmd} -f {baseConfig} -f {overridesFile} {chartDir}/gloo'.format( - chartDir=absolute_gloo_chart_dir, - templateCmd=gloo_helm_template_cmd, - baseConfig=tidepool_helm_values_file, - overridesFile=tidepool_helm_overrides_file, - )), allow_duplicates=True) - - # Expose the gateway proxy on a host port - gateway_port_forwards = getNested(config,'gateway-proxy.portForwards', ['3000']) - k8s_resource('gateway-proxy', port_forwards=gateway_port_forwards) -### Gloo Gateway End ### - -# Unleash the beast -main() diff --git a/bin/tidepool b/bin/tidepool index cf9c529ef..29e0d82f4 100755 --- a/bin/tidepool +++ b/bin/tidepool @@ -195,7 +195,6 @@ destroy() { then docker rm -fv tidepool-kind-control-plane docker rm -fv ctlptl-registry - rm -r ${DIR}/local/charts else echo "Destroy command aborted" fi diff --git a/charts/tidepool/Chart.yaml b/charts/tidepool/Chart.yaml index a344a17c2..7c3659fea 100644 --- a/charts/tidepool/Chart.yaml +++ b/charts/tidepool/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart for Tidepool name: tidepool -version: 0.13.15 +version: 0.13.16 maintainers: - name: Todd Kazakov email: todd@tidepool.org diff --git a/charts/tidepool/charts/blip/templates/1-deployment.yaml b/charts/tidepool/charts/blip/templates/1-deployment.yaml index d146a8069..297d4fdd4 100644 --- a/charts/tidepool/charts/blip/templates/1-deployment.yaml +++ b/charts/tidepool/charts/blip/templates/1-deployment.yaml @@ -48,6 +48,8 @@ spec: env: - name: SKIP_HAKKEN value: "true" + - name: PORT + value: "{{.Values.global.ports.blip}}" {{ if .Values.webpackPublicPath }} - name: WEBPACK_PUBLIC_PATH value: {{ .Values.webpackPublicPath }} diff --git a/charts/tidepool/charts/clinic/templates/4-routetable.yaml b/charts/tidepool/charts/clinic/templates/4-routetable.yaml index e03ca9eb7..8348677d7 100644 --- a/charts/tidepool/charts/clinic/templates/4-routetable.yaml +++ b/charts/tidepool/charts/clinic/templates/4-routetable.yaml @@ -18,8 +18,10 @@ spec: - PUT prefix: /v1/clinics options: +{{ if not .Values.global.glooingress.jwt.disabled }} jwt: disable: false +{{- end }} routeAction: single: upstream: @@ -53,4 +55,4 @@ spec: name: clinic namespace: {{ .Release.Namespace }} weight: 30 -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/tidepool/charts/glooingress/templates/5-service.yaml b/charts/tidepool/charts/glooingress/templates/5-service.yaml index 74959a3d6..b16902f5e 100644 --- a/charts/tidepool/charts/glooingress/templates/5-service.yaml +++ b/charts/tidepool/charts/glooingress/templates/5-service.yaml @@ -4,12 +4,13 @@ apiVersion: v1 kind: Service metadata: - name: internal + name: internal namespace: {{ .Release.Namespace }} labels: spec: externalName: {{ $proxy.name }}.{{ $proxy.namespace | default .Release.Namespace }}.svc.cluster.local ports: - port: {{ $proxy.port }} + targetPort: {{ $proxy.targetPort | default 0 }} type: ExternalName {{- end }} diff --git a/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml b/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml index ebe4d4c6a..715f5b8c6 100644 --- a/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml +++ b/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml @@ -50,6 +50,8 @@ spec: value: {{ include "charts.hydrophone.s3.url" . | quote }} - name: HYDROPHONE_WEB_URL value: {{ include "charts.host.app" . | quote }} + - name: HYDROPHONE_USE_MOCK_NOTIFIER + value: "{{.Values.deployment.env.useMockNotifier}}" - name: SES_REGION value: {{.Values.global.region | quote }} - name: SES_FROM_ADDRESS diff --git a/charts/tidepool/charts/hydrophone/values.yaml b/charts/tidepool/charts/hydrophone/values.yaml index 03389a379..ce3c3f245 100644 --- a/charts/tidepool/charts/hydrophone/values.yaml +++ b/charts/tidepool/charts/hydrophone/values.yaml @@ -7,6 +7,7 @@ deployment: clinicServiceEnabled: false # -- from address for emails that we send fromAddress: "Tidepool " + useMockNotifier: false store: s3: bucket: "asset" diff --git a/charts/tidepool/values.yaml b/charts/tidepool/values.yaml index c8dc10ea3..a997e18e5 100644 --- a/charts/tidepool/values.yaml +++ b/charts/tidepool/values.yaml @@ -26,6 +26,8 @@ global: glooingress: # -- whether to use Gloo API Gateway for ingress enabled: true + jwt: + disabled: false extauth: enabled: false kafka: @@ -50,15 +52,15 @@ global: enabled: true ports: # -- blip service internal port - blip: 3000 + blip: 31500 # -- clinic service internal port clinic: 8080 # -- clinic worker internal port clinic_worker: 8080 # -- devices service grpc internal port - devices_grpc: 9228 + devices_grpc: 9228 # -- devices service http internal port - devices_http: 9229 + devices_http: 9229 # -- export service internal port export: 9300 # -- gatekeeper service internal port diff --git a/local/tilt/charts/mongo/Chart.yaml b/local/tilt/charts/mongo/Chart.yaml deleted file mode 100644 index b7fb9b7cd..000000000 --- a/local/tilt/charts/mongo/Chart.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -description: A Helm chart for Kubernetes -name: mongo -version: 0.1.4 -maintainers: - - name: Derrick Burns - email: derrick@tidepool.org diff --git a/local/tilt/charts/mongo/README.md b/local/tilt/charts/mongo/README.md deleted file mode 100644 index a5be29b05..000000000 --- a/local/tilt/charts/mongo/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# mongo - -![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) - -A Helm chart for Kubernetes - -## Maintainers - -| Name | Email | Url | -| ---- | ------ | --- | -| Derrick Burns | derrick@tidepool.org | | - -## Values - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| mongodb.image | string | `"mongo:4.0"` | | -| mongodb.persistent | bool | `true` | | -| mongodb.port | string | `"27017"` | | -| mongodb.seed | bool | `false` | | -| mongodb.volume | string | `"mongo2"` | | diff --git a/local/tilt/charts/mongo/templates/_helpers.tpl b/local/tilt/charts/mongo/templates/_helpers.tpl deleted file mode 100644 index fec2aa5f5..000000000 --- a/local/tilt/charts/mongo/templates/_helpers.tpl +++ /dev/null @@ -1,33 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} - -{{- define "charts.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "charts.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "charts.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/local/tilt/charts/mongo/templates/mongo-deployment.yaml b/local/tilt/charts/mongo/templates/mongo-deployment.yaml deleted file mode 100644 index 89d6cbe1c..000000000 --- a/local/tilt/charts/mongo/templates/mongo-deployment.yaml +++ /dev/null @@ -1,81 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: mongodb - helm.sh/chart: {{ include "charts.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/name: {{ include "charts.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - name: mongodb - namespace: {{.Release.Namespace}} -spec: - selector: - matchLabels: - app: mongodb - app.kubernetes.io/name: {{ include "charts.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - "sidecar.istio.io/inject": "false" - labels: - app: mongodb - app.kubernetes.io/name: {{ include "charts.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - spec: -{{ if .Values.mongodb.persistent }} - volumes: - - name: '{{.Values.mongodb.volume}}' - persistentVolumeClaim: -{{ if .Values.mongodb.hostPath }} - hostPath: - path: '{{.Values.mongodb.hostPath}}' - type: Directory -{{ end }} -{{ if .Values.mongodb.seed }} - - name: dump - emptyDir: {} - claimName: {{.Values.mongodb.volume}} - initContainers: # provide the data volume - - image: tidepool/mongoseed:init - name: seed-data - command: [ "/bin/sh" ] - args: [ "-c", "mkdir -p /input; cp -r /dump/* /input" ] - imagePullPolicy: Always - volumeMounts: - - mountPath: /input - name: dump -{{ end }} -{{ end }} - containers: - - image: "{{ .Values.mongodb.image }}" - name: mongo - ports: - - containerPort: {{.Values.mongodb.port}} - resources: {} -{{ if .Values.mongodb.seed }} - - image: "{{ .Values.mongodb.image }}" - name: seeder - volumeMounts: - - mountPath: /dump - name: dump - command: [ "/bin/sh" ] - args: [ "-c", 'ls -l /dump; while ! mongo --eval "db.adminCommand(\"ping\")"; do sleep 3; done; mongorestore -h localhost /dump; touch /dump/ready; while mongo --eval "db.adminCommand(\"ping\")"; do sleep 600; done' ] - readinessProbe: - exec: - command: - - cat - - /dump/ready - initialDelaySeconds: 3 - periodSeconds: 5 -{{ end }} -{{ if .Values.mongodb.persistent }} - volumeMounts: - - mountPath: /data/db - name: {{.Values.mongodb.volume}} -{{ end }} - restartPolicy: Always diff --git a/local/tilt/charts/mongo/templates/mongo-persistentvolumeclaim.yaml b/local/tilt/charts/mongo/templates/mongo-persistentvolumeclaim.yaml deleted file mode 100644 index 0eda03ee9..000000000 --- a/local/tilt/charts/mongo/templates/mongo-persistentvolumeclaim.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{ if .Values.mongodb.persistent }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - app: mongo - helm.sh/chart: {{ include "charts.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/name: {{ include "charts.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - name: {{ .Values.mongodb.volume }} - namespace: {{.Release.Namespace}} -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -{{ end }} diff --git a/local/tilt/charts/mongo/templates/mongo-service.yaml b/local/tilt/charts/mongo/templates/mongo-service.yaml deleted file mode 100644 index 5687b6562..000000000 --- a/local/tilt/charts/mongo/templates/mongo-service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: mongodb - helm.sh/chart: {{ include "charts.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/name: {{ include "charts.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - name: mongodb - namespace: {{.Release.Namespace}} -spec: - ports: - - name: "{{.Values.mongodb.port}}" - port: {{.Values.mongodb.port}} - targetPort: {{.Values.mongodb.port}} - selector: - app: mongodb - app.kubernetes.io/name: {{ include "charts.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/local/tilt/charts/mongo/values.yaml b/local/tilt/charts/mongo/values.yaml deleted file mode 100644 index 48cf9b0ff..000000000 --- a/local/tilt/charts/mongo/values.yaml +++ /dev/null @@ -1,6 +0,0 @@ -mongodb: - image: mongo:4.0 - port: '27017' - volume: mongo2 - persistent: true - seed: false