Deploying Claudie in a custom namespace¶
By default, when following the Getting Started guide, Claudie is deployed in the claudie
namespace. However, you may want to deploy it into a custom namespace for reasons such as organizational structure, environment isolation or others.
Modifiyng claudie.yaml bundle¶
- Download the latest claudie.yaml
wget https://github.com/berops/claudie/releases/latest/download/claudie.yaml
-
Before applying the manifest, make the following changes:
2.1. Replace every occurrence of
namespace: claudie
with your desired namespace (e.g., new-namespace). Using linux terminal you can use sed utility:2.2. For DNS Names within Certificate resource,sed -i 's/namespace: claudie/namespace: new-namespace/' claudie.yaml
kind: Certificate
, ensure the dnsNames reflect the new namespace:Using linux terminal you can use sed utility:spec: dnsNames: - claudie-operator.new-namespace - claudie-operator.new-namespace.svc - claudie-operator.new-namespace.svc.cluster - claudie-operator.new-namespace.svc.cluster.local
2.3. Replace annotationssed -i 's/\(claudie-operator\)\.claudie/\1.new-namespace/g' claudie.yaml
cert-manager.io/inject-ca-from: claudie/claudie-webhook-certificate
and namename: claudie-webhook
in ValidatingWebhookConfiguration resource,kind: ValidatingWebhookConfiguration
, so that is contains name of your new namespaceUsing linux terminal you can use sed utility:annotations: cert-manager.io/inject-ca-from: new-namespace/claudie-webhook-certificate ... name: claudie-webhook-new-namespace
2.4. To restrict the namespaces monitored by the Claudie operator (as defined insed -i 's/cert-manager\.io\/inject-ca-from: claudie\//cert-manager.io\/inject-ca-from: new-namespace\//g' claudie.yaml sed -i 's/claudie-webhook$/claudie-webhook-new-namespace/g' claudie.yaml
claudie.yaml
), add theCLAUDIE_NAMESPACES
environment variable to the claudie-operator deployment.env: - name: CLAUDIE_NAMESPACES value: "new-namespace"
Updating CLAUDIE_NAMESPACES variable
If there already exists a Claudie cluster, make sure to also update the deployment of the existing Claudie operator to reflect the correct namespace.
If the
CLAUDIE_NAMESPACES
environment variable is not set in the operator, multiple Claudie instances may pick up the same InputManifests, which can lead to the cluster being unintentionally rebuilt. This can result in unexpected behavior and potentially break your Kubernetes cluster.2.5. To ensure the
ClusterRoleBinding
is correctly applied to the specifiedServiceAccount
, make sure theClusterRoleBinding
has a unique name. Modify the name of theClusterRoleBinding
resource in theclaudie.yaml
.Using linux terminal you can use sed utility:
2.6. Once you’ve updated claudie.yaml, create your custom namespace and apply the manifest. Make sure Cert Manager is already deployed in your clustersed -i 's/claudie-operator-role-binding/claudie-operator-role-binding-new-namespace/g' claudie.yaml
kubectl create namespace new-namespace kubectl apply -f claudie.yaml