From eb3db4da64fd69f0bf51717a856b90f7e8682cea Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Mon, 30 Aug 2021 15:41:48 -0400 Subject: [PATCH] Saving services work --- manifests/do-nothing-pod.yaml | 15 +++++++++++++++ manifests/external-mongo-endpoint.yaml | 11 +++++++++++ manifests/external-mongo-service.yaml | 14 ++++++++++++++ manifests/external-postgres-service.yaml | 11 +++++++++++ .../external-selectorless-postgres-endpoint.yaml | 11 +++++++++++ manifests/external-selectorless-postgres.yaml | 13 +++++++++++++ manifests/runcible-namespace.yaml | 6 ++++++ 7 files changed, 81 insertions(+) create mode 100644 manifests/do-nothing-pod.yaml create mode 100644 manifests/external-mongo-endpoint.yaml create mode 100644 manifests/external-mongo-service.yaml create mode 100644 manifests/external-postgres-service.yaml create mode 100644 manifests/external-selectorless-postgres-endpoint.yaml create mode 100644 manifests/external-selectorless-postgres.yaml create mode 100644 manifests/runcible-namespace.yaml diff --git a/manifests/do-nothing-pod.yaml b/manifests/do-nothing-pod.yaml new file mode 100644 index 0000000..4900673 --- /dev/null +++ b/manifests/do-nothing-pod.yaml @@ -0,0 +1,15 @@ +# Really this pod is for running manual commands. It just sits there in a sleep loop waiting to connect. +# I use it will tools like dig or psycopg2 to test out DNS and such within my cluster. +apiVersion: v1 +kind: Pod +metadata: + name: cmd-demo + labels: + purpose: demonstrate-command +spec: + containers: + - name: cmd-demo + image: python:3.8.11-buster + command: ['sleep'] + args: ['infinity'] + restartPolicy: OnFailure diff --git a/manifests/external-mongo-endpoint.yaml b/manifests/external-mongo-endpoint.yaml new file mode 100644 index 0000000..d0cf12d --- /dev/null +++ b/manifests/external-mongo-endpoint.yaml @@ -0,0 +1,11 @@ +# Something wrong with the mongo instance. This currently doesn't work +apiVersion: v1 +kind: Endpoints +metadata: + name: dev-mongo + namespace: runcible +subsets: + - addresses: + - ip: 10.0.1.221 + ports: + - port: 27017 diff --git a/manifests/external-mongo-service.yaml b/manifests/external-mongo-service.yaml new file mode 100644 index 0000000..5d13602 --- /dev/null +++ b/manifests/external-mongo-service.yaml @@ -0,0 +1,14 @@ +# something is wrong with the mongo instance. This currently doesn't work. +apiVersion: v1 +kind: Service +metadata: + name: dev-mongo + namespace: runcible +# spec: +# type: ExternalName +# externalName: docker1.runcible.io +spec: + ports: + - protocol: TCP + port: 27017 + targetPort: 27017 diff --git a/manifests/external-postgres-service.yaml b/manifests/external-postgres-service.yaml new file mode 100644 index 0000000..b779223 --- /dev/null +++ b/manifests/external-postgres-service.yaml @@ -0,0 +1,11 @@ +# Demonstates using external service name to host a DNS entry pointing to an external resource. +# Does not create an endpoint +# Example DSN: "host=dev-postgres user=toor password= dbname=testdb" +apiVersion: v1 +kind: Service +metadata: + name: dev-postgres + namespace: runcible +spec: + type: ExternalName + externalName: db2.runcible.io diff --git a/manifests/external-selectorless-postgres-endpoint.yaml b/manifests/external-selectorless-postgres-endpoint.yaml new file mode 100644 index 0000000..59464e8 --- /dev/null +++ b/manifests/external-selectorless-postgres-endpoint.yaml @@ -0,0 +1,11 @@ +# Endpoint spec for Service created in external-selectorless-postgres.yaml +apiVersion: v1 +kind: Endpoints +metadata: + name: selectorless-postgres + namespace: runcible +subsets: + - addresses: + - ip: 10.0.1.200 + ports: + - port: 5432 diff --git a/manifests/external-selectorless-postgres.yaml b/manifests/external-selectorless-postgres.yaml new file mode 100644 index 0000000..a85204f --- /dev/null +++ b/manifests/external-selectorless-postgres.yaml @@ -0,0 +1,13 @@ +# Should be compatiable with external-postgres-services.yaml since they will specify different DNS names and endpoints +# Requires and Endpoint be created for the Service manually see external-selectorless-postgres-endpoint.yaml +# Example DSN "host=selectorless-postgres user=toor password= dbname=testdb" +apiVersion: v1 +kind: Service +metadata: + name: selectorless-postgres + namespace: runcible +spec: + ports: + - protocol: TCP + port: 5432 + targetPort: 5432 diff --git a/manifests/runcible-namespace.yaml b/manifests/runcible-namespace.yaml new file mode 100644 index 0000000..878d995 --- /dev/null +++ b/manifests/runcible-namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: runcible + labels: + name: runcible