diff --git a/k8s/base/ceramic-one/README.md b/k8s/base/ceramic-one/README.md index c88b008..341b484 100644 --- a/k8s/base/ceramic-one/README.md +++ b/k8s/base/ceramic-one/README.md @@ -9,7 +9,7 @@ Comands assume this directory as the current working directory. ### Create a namespace for the nodes. ``` -export CERAMIC_NAMESPACE=ceramic-one-0-17-0 +export CERAMIC_NAMESPACE=ceramic-one kubectl create namespace ${CERAMIC_NAMESPACE} ``` diff --git a/k8s/base/ceramic-one/kustomization.yaml b/k8s/base/ceramic-one/kustomization.yaml index b8c775b..f34f64c 100644 --- a/k8s/base/ceramic-one/kustomization.yaml +++ b/k8s/base/ceramic-one/kustomization.yaml @@ -1,4 +1,4 @@ -namespace: ceramic-one-0-17-0 +namespace: ceramic-one images: - name: ceramicnetwork/composedb-cli diff --git a/k8s/base/composedb/daemon-config.json b/k8s/base/composedb/daemon-config.json index 36f811b..301fa7f 100644 --- a/k8s/base/composedb/daemon-config.json +++ b/k8s/base/composedb/daemon-config.json @@ -17,12 +17,15 @@ "log-to-files": false }, "metrics": { - "metrics-exporter-enabled": false + "metrics-exporter-enabled": false, + "metrics-publisher-enabled": true }, "network": { "name": "${CERAMIC_NETWORK}" }, - "node": {}, + "node": { + "privateSeedUrl": "inplace:ed25519#fe7728465b2dec4878912851013e17ca7ea903bdb630ea08518fc8b801167e57" + }, "state-store": { "mode": "fs", "local-directory": "${CERAMIC_STATE_STORE_PATH}" @@ -31,4 +34,4 @@ "db": "postgres://${CERAMIC_INDEXING_DB_USERNAME}:${CERAMIC_INDEXING_DB_PASSWORD}@postgres/ceramic", "allow-queries-before-historical-sync": true } -} \ No newline at end of file +} diff --git a/k8s/cert-ingress/README.md b/k8s/cert-ingress/README.md index 39526b1..38184ca 100644 --- a/k8s/cert-ingress/README.md +++ b/k8s/cert-ingress/README.md @@ -1,43 +1,61 @@ -## Configuring domain name and SSL cert for your composedb node +# Configuring Domain Name and Automatic SSL Cert for Your ComposeDB Node -### Remove the default load balancer +## Prerequisites +- A Kubernetes cluster (e.g., on DigitalOcean) +- `kubectl` configured to interact with your cluster +- A domain name pointed to your cluster's IP address -We are going to replace the load balancer that was installed with an ingress controller and related services - -`kubectl delete -f k8s/base/composedb/do-lb.yaml` +## Setup Steps -### Install an ingress controller +### 1. Remove the default load balancer -If you have not already done so, install the ingress controller to your cluster -`kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/do/deploy.yaml` +We are going to replace the load balancer that was installed with an ingress controller and related services +This is assuming a starting point from the `ceramic-one` manifests applied. -### Apply the ingress and related services +`kubectl delete -f k8s/base/ceramic-one/manifests/js-ceramic-lb.yaml` -The resources in this deployment may be deployed from the repository root like so +### 2. Install the NGINX Ingress Controller +If not already installed, add the NGINX ingress controller to your cluster. This example uses the digital ocean manifests + ```bash +kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.2/deploy/static/provider/do/deploy.yaml ``` -kubectl apply -k k8s/cert-ingress/ -``` - -This will spin up the ingress and the static file server. You may remove the static file server if it is not needed for your configuration. -### If you need to get a cert +### 3. Install cert-manager +cert-manager will automatically manage and renew SSL certificates: -You may need to return a challenge file. In this case you will use the static server -that is included in this deployment, and configure its files like so - -``` -mkdir -p .well-known/acme-challenge -# place the challenge file in this directory, then -kubectl create configmap acme-challenge --from-file=.well-known/acme-challenge/ --namespace=ceramic +```bash +kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml ``` -Follow the instructions from your cert provider to get your TLS certificate and private key. -Place them in files such as `fullchain.pem` and `privkey.pem` +### 4. Update Configuration Files +1. Edit `ingress.yaml`: + - Replace `your-domain.com` with your actual domain name. +2. Edit `letsencrypt-issuer.yaml`: + - Replace `your-email@example.com` with your actual email address. -Then run +### 5. Apply the Ingress and Related Services +From the repository root, run: +```bash +kubectl apply -k k8s/cert-ingress/ ``` -kubectl create secret tls ceramic-tls-secret --cert=fullchain.pem --key=privkey.pem -``` + +This will set up the ingress, ClusterIP service, and cert-manager configurations. + +### 6. Verify the Setup +1. Check that the ingress has been created: + ```bash + kubectl get ingress -n ceramic-one + ``` +2. Verify that cert-manager has issued a certificate: + ```bash + kubectl get certificates -n ceramic-one + ``` +3. Once the certificate is ready, you should be able to access your ComposeDB node securely via HTTPS at your domain. + +## Notes +- SSL certificates will be automatically obtained and renewed by cert-manager. +- If you need to make changes, modify the relevant files in the `k8s/cert-ingress/` directory and reapply using `kubectl apply -k k8s/cert-ingress/`. +- Ensure your domain's DNS is properly configured to point to your cluster's IP address. diff --git a/k8s/cert-ingress/cluster-ip.yaml b/k8s/cert-ingress/cluster-ip.yaml index 1e5ce8f..d6e144b 100644 --- a/k8s/cert-ingress/cluster-ip.yaml +++ b/k8s/cert-ingress/cluster-ip.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: composedb - namespace: ceramic + namespace: ceramic-one labels: app: composedb spec: diff --git a/k8s/cert-ingress/ingress-nginx-do-deploy.yaml b/k8s/cert-ingress/ingress-nginx-do-deploy.yaml new file mode 100644 index 0000000..0cdfde6 --- /dev/null +++ b/k8s/cert-ingress/ingress-nginx-do-deploy.yaml @@ -0,0 +1,649 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + name: ingress-nginx +--- +apiVersion: v1 +automountServiceAccountToken: true +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx + namespace: ingress-nginx +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx + namespace: ingress-nginx +rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get +- apiGroups: + - "" + resources: + - configmaps + - pods + - secrets + - endpoints + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - update +- apiGroups: + - networking.k8s.io + resources: + - ingressclasses + verbs: + - get + - list + - watch +- apiGroups: + - coordination.k8s.io + resourceNames: + - ingress-nginx-leader + resources: + - leases + verbs: + - get + - update +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - list + - watch + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission + namespace: ingress-nginx +rules: +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx +rules: +- apiGroups: + - "" + resources: + - configmaps + - endpoints + - nodes + - pods + - secrets + - namespaces + verbs: + - list + - watch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - list + - watch +- apiGroups: + - "" + resources: + - nodes + verbs: + - get +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - update +- apiGroups: + - networking.k8s.io + resources: + - ingressclasses + verbs: + - get + - list + - watch +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - list + - watch + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission +rules: +- apiGroups: + - admissionregistration.k8s.io + resources: + - validatingwebhookconfigurations + verbs: + - get + - update +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx + namespace: ingress-nginx +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: ingress-nginx +subjects: +- kind: ServiceAccount + name: ingress-nginx + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission + namespace: ingress-nginx +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: ingress-nginx-admission +subjects: +- kind: ServiceAccount + name: ingress-nginx-admission + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ingress-nginx +subjects: +- kind: ServiceAccount + name: ingress-nginx + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ingress-nginx-admission +subjects: +- kind: ServiceAccount + name: ingress-nginx-admission + namespace: ingress-nginx +--- +apiVersion: v1 +data: + allow-snippet-annotations: "true" + use-proxy-protocol: "false" +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-controller + namespace: ingress-nginx +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: "false" + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-controller + namespace: ingress-nginx +spec: + externalTrafficPolicy: Local + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 80 + protocol: TCP + targetPort: http + - appProtocol: https + name: https + port: 443 + protocol: TCP + targetPort: https + selector: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + type: LoadBalancer +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-controller-admission + namespace: ingress-nginx +spec: + ports: + - appProtocol: https + name: https-webhook + port: 443 + targetPort: webhook + selector: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-controller + namespace: ingress-nginx +spec: + minReadySeconds: 0 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + template: + metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + spec: + containers: + - args: + - /nginx-ingress-controller + - --publish-service=$(POD_NAMESPACE)/ingress-nginx-controller + - --election-id=ingress-nginx-leader + - --controller-class=k8s.io/ingress-nginx + - --ingress-class=nginx + - --configmap=$(POD_NAMESPACE)/ingress-nginx-controller + - --validating-webhook=:8443 + - --validating-webhook-certificate=/usr/local/certificates/cert + - --validating-webhook-key=/usr/local/certificates/key + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: LD_PRELOAD + value: /usr/local/lib/libmimalloc.so + image: registry.k8s.io/ingress-nginx/controller:v1.8.1@sha256:e5c4824e7375fcf2a393e1c03c293b69759af37a9ca6abdb91b13d78a93da8bd + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + livenessProbe: + failureThreshold: 5 + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + name: controller + ports: + - containerPort: 80 + name: http + protocol: TCP + - containerPort: 443 + name: https + protocol: TCP + - containerPort: 8443 + name: webhook + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + requests: + cpu: 100m + memory: 90Mi + securityContext: + allowPrivilegeEscalation: true + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 + volumeMounts: + - mountPath: /usr/local/certificates/ + name: webhook-cert + readOnly: true + dnsPolicy: ClusterFirst + nodeSelector: + kubernetes.io/os: linux + serviceAccountName: ingress-nginx + terminationGracePeriodSeconds: 300 + volumes: + - name: webhook-cert + secret: + secretName: ingress-nginx-admission +--- +apiVersion: batch/v1 +kind: Job +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission-create + namespace: ingress-nginx +spec: + template: + metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission-create + spec: + containers: + - args: + - create + - --host=ingress-nginx-controller-admission,ingress-nginx-controller-admission.$(POD_NAMESPACE).svc + - --namespace=$(POD_NAMESPACE) + - --secret-name=ingress-nginx-admission + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20230407@sha256:543c40fd093964bc9ab509d3e791f9989963021f1e9e4c9c7b6700b02bfb227b + imagePullPolicy: IfNotPresent + name: create + securityContext: + allowPrivilegeEscalation: false + nodeSelector: + kubernetes.io/os: linux + restartPolicy: OnFailure + securityContext: + fsGroup: 2000 + runAsNonRoot: true + runAsUser: 2000 + serviceAccountName: ingress-nginx-admission +--- +apiVersion: batch/v1 +kind: Job +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission-patch + namespace: ingress-nginx +spec: + template: + metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission-patch + spec: + containers: + - args: + - patch + - --webhook-name=ingress-nginx-admission + - --namespace=$(POD_NAMESPACE) + - --patch-mutating=false + - --secret-name=ingress-nginx-admission + - --patch-failure-policy=Fail + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20230407@sha256:543c40fd093964bc9ab509d3e791f9989963021f1e9e4c9c7b6700b02bfb227b + imagePullPolicy: IfNotPresent + name: patch + securityContext: + allowPrivilegeEscalation: false + nodeSelector: + kubernetes.io/os: linux + restartPolicy: OnFailure + securityContext: + fsGroup: 2000 + runAsNonRoot: true + runAsUser: 2000 + serviceAccountName: ingress-nginx-admission +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: nginx +spec: + controller: k8s.io/ingress-nginx +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.8.1 + name: ingress-nginx-admission +webhooks: +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: ingress-nginx-controller-admission + namespace: ingress-nginx + path: /networking/v1/ingresses + failurePolicy: Fail + matchPolicy: Equivalent + name: validate.nginx.ingress.kubernetes.io + rules: + - apiGroups: + - networking.k8s.io + apiVersions: + - v1 + operations: + - CREATE + - UPDATE + resources: + - ingresses + sideEffects: None + timeoutSeconds: 29 diff --git a/k8s/cert-ingress/ingress.yaml b/k8s/cert-ingress/ingress.yaml index 0a18b62..6f5c201 100644 --- a/k8s/cert-ingress/ingress.yaml +++ b/k8s/cert-ingress/ingress.yaml @@ -2,27 +2,19 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: composedb-ingress - namespace: ceramic + namespace: ceramic-one annotations: - cert-manager.io/cluster-issuer: "letsencrypt-prod" # if you're using cert-manager for SSL + kubernetes.io/ingress.class: nginx + cert-manager.io/cluster-issuer: "letsencrypt-prod" spec: - ingressClassName: nginx tls: - hosts: - - "example.com" - # this is where the SSL certificate should be stored + - "your-domain.com" # Replace with your actual domain secretName: ceramic-tls-secret rules: - - host: "example.com" + - host: "your-domain.com" # Replace with your actual domain http: paths: - - path: /.well-known/acme-challenge - pathType: Prefix - backend: - service: - name: static-files-service # Your service name for static files - port: - number: 80 - path: / pathType: Prefix backend: @@ -30,4 +22,3 @@ spec: name: composedb port: number: 7007 - diff --git a/k8s/cert-ingress/kustomization.yaml b/k8s/cert-ingress/kustomization.yaml index e86f73f..bcf6ec9 100644 --- a/k8s/cert-ingress/kustomization.yaml +++ b/k8s/cert-ingress/kustomization.yaml @@ -1,3 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization resources: + - cluster-ip.yaml - ingress.yaml - - static-file-service.yaml + - letsencrypt-issuer.yaml +namespace: ceramic-one diff --git a/k8s/cert-ingress/letsencrypt-issuer.yaml b/k8s/cert-ingress/letsencrypt-issuer.yaml new file mode 100644 index 0000000..ee7f333 --- /dev/null +++ b/k8s/cert-ingress/letsencrypt-issuer.yaml @@ -0,0 +1,14 @@ +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: letsencrypt-prod +spec: + acme: + server: https://acme-v02.api.letsencrypt.org/directory + email: your@email.com # Replace with your email + privateKeySecretRef: + name: letsencrypt-prod + solvers: + - http01: + ingress: + class: nginx diff --git a/k8s/cert-ingress/static-files-deployment.yaml b/k8s/cert-ingress/static-files-deployment.yaml deleted file mode 100644 index 4d31430..0000000 --- a/k8s/cert-ingress/static-files-deployment.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: static-files - namespace: ceramic -spec: - replicas: 1 - selector: - matchLabels: - app: static-files - template: - metadata: - labels: - app: static-files - spec: - containers: - - name: nginx - image: nginx:alpine - volumeMounts: - - name: acme-challenge - mountPath: /usr/share/nginx/html/.well-known/acme-challenge - readOnly: true - volumes: - - name: acme-challenge - configMap: - name: acme-challenge - diff --git a/k8s/cert-ingress/static-files-service.yaml b/k8s/cert-ingress/static-files-service.yaml deleted file mode 100644 index 1c6d310..0000000 --- a/k8s/cert-ingress/static-files-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: static-files-service - namespace: ceramic -spec: - type: ClusterIP - selector: - app: static-files - ports: - - port: 80 - targetPort: 80 -