From 740d6db9726e610f7c36b1457a39613f3b837d99 Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Fri, 5 Apr 2024 17:38:25 +0100 Subject: [PATCH] fix docs for kuberentes and Nomad --- src/config/navigation.jsx | 1 + .../docs/resources/k8s/kubernetes_cluster.mdx | 14 +--- .../docs/resources/nomad/nomad_cluster.mdx | 16 +--- .../resources/registry/container_registry.mdx | 73 +++++++++++++++++++ 4 files changed, 79 insertions(+), 25 deletions(-) create mode 100644 src/pages/docs/resources/registry/container_registry.mdx diff --git a/src/config/navigation.jsx b/src/config/navigation.jsx index cc733a13..0a6c37b5 100644 --- a/src/config/navigation.jsx +++ b/src/config/navigation.jsx @@ -42,6 +42,7 @@ export const navigation = [ { title: 'Build', href: '/docs/resources/build/' }, { title: 'Chapter', href: '/docs/resources/docs/chapter' }, { title: 'Container', href: '/docs/resources/container/container' }, + { title: 'Container Registry', href: '/docs/resources/registry/container_registry' }, { title: 'Copy', href: '/docs/resources/copy' }, { title: 'Docs', href: '/docs/resources/docs/docs' }, { title: 'Exec', href: '/docs/resources/exec' }, diff --git a/src/pages/docs/resources/k8s/kubernetes_cluster.mdx b/src/pages/docs/resources/k8s/kubernetes_cluster.mdx index 657cc780..4fca6c5d 100644 --- a/src/pages/docs/resources/k8s/kubernetes_cluster.mdx +++ b/src/pages/docs/resources/k8s/kubernetes_cluster.mdx @@ -297,7 +297,7 @@ resource "ingress" "fake_service" { } output "VAULT_ADDR" { - value = resource.ingress.vault_http.address + value = "http://${resource.ingress.vault_http.local_address}" } output "KUBECONFIG" { @@ -314,14 +314,4 @@ an image cache that runs in Docker. After the first pull all images are subseque pulled from the image cache not the public internet. This cache is global to all Nomad and Kubernetes clusters created with Jumppad. -Currently images from the following registries are cached: -* k8s.gcr.io -* gcr.io -* asia.gcr.io -* eu.gcr.io -* us.gcr.io -* quay.io -* ghcr.io" -* docker.io - -To clear the cache, you can use the `jumppad purge`. \ No newline at end of file +For more information on the image cache see the [container_registry](/docs/resources/registry/container_registry) resource. \ No newline at end of file diff --git a/src/pages/docs/resources/nomad/nomad_cluster.mdx b/src/pages/docs/resources/nomad/nomad_cluster.mdx index 1e5036b0..a75c0527 100644 --- a/src/pages/docs/resources/nomad/nomad_cluster.mdx +++ b/src/pages/docs/resources/nomad/nomad_cluster.mdx @@ -258,7 +258,7 @@ resource "nomad_cluster" "dev" { } resource "nomad_job" "example_1" { - cluster = resource.nomad_cluster.dev.meta.id + cluster = resource.nomad_cluster.dev paths = ["./app_config/example1.nomad"] @@ -272,7 +272,7 @@ resource "ingress" "fake_service_1" { port = 19090 target { - id = resource.nomad_cluster.dev.meta.id + resource = resource.nomad_cluster.dev named_port = "http" config = { @@ -293,14 +293,4 @@ an image cache that runs in Docker. After the first pull all images are subseque pulled from the image cache not the public internet. This cache is global to all Nomad and Kubernetes clusters created with Jumppad. -Currently images from the following registries are cached: -* k8s.gcr.io -* gcr.io -* asia.gcr.io -* eu.gcr.io -* us.gcr.io -* quay.io -* ghcr.io" -* docker.io - -To clear the cache, you can use the `jumppad purge`. \ No newline at end of file +For more information on the image cache see the [container_registry](/docs/resources/registry/container_registry) resource. \ No newline at end of file diff --git a/src/pages/docs/resources/registry/container_registry.mdx b/src/pages/docs/resources/registry/container_registry.mdx new file mode 100644 index 00000000..146cbe54 --- /dev/null +++ b/src/pages/docs/resources/registry/container_registry.mdx @@ -0,0 +1,73 @@ +import MetaProperties from "../shared/meta.mdx" + +# Container Registry `container_registry` + + +To save bandwidth all containers launched in Kubernetes and Nomad clusters are pulled through +an image cache that is automatically started whenever you run `jumppad up`. After the first +pull all images are subsequently pulled from the image cache not the public internet. + +Currently `public` images from the following registries are cached: +* docker.io +* k8s.gcr.io +* gcr.io +* asia.gcr.io +* eu.gcr.io +* us.gcr.io +* quay.io +* ghcr.io +* docker.pkg.github.com + +To cache private images or to enable the pull through cache for registires that are not listed above, +you can use the `container_registry` resource. + + + + + + The hostname of the registry to add to the pull through cache. + + + The authentication information for the registry, if not provided the registry is assumed to be public. + + + +### registry_auth + + + + The hostname to use for authentication, if not provided the hostname of the registry is used. + + + The username to authenticate with the registry. + + + The password to authenticate with the registry. + + + + + + +## Examples + +### Unauthenticated Registry + +```hcl +resource "container_registry" "noauth" { + hostname = "noauth-registry.demo.gs" // cache can not resolve local jumppad.dev dns for some reason, + // using external dns mapped to the local ip address +} +``` + +### Authenticated Registry + +```hcl +resource "container_registry" "auth" { + hostname = "auth-registry.demo.gs" + auth { + username = "admin" + password = "password" + } +} +``` \ No newline at end of file