Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88c70a96ab | ||
|
|
abf2e93f3f |
@@ -29,6 +29,7 @@ Kubernetes is an open‑source platform that automates the deployment, scaling,
|
|||||||
- [Manifest - StringData](#manifest---stringdata)
|
- [Manifest - StringData](#manifest---stringdata)
|
||||||
- [Inline with heredoc and environment variables](#inline-with-heredoc-and-environment-variables)
|
- [Inline with heredoc and environment variables](#inline-with-heredoc-and-environment-variables)
|
||||||
- [substr](#substr)
|
- [substr](#substr)
|
||||||
|
- [annotations](#annotations)
|
||||||
- [nodes](#nodes)
|
- [nodes](#nodes)
|
||||||
- [taints](#taints)
|
- [taints](#taints)
|
||||||
- [add taint](#add-taint)
|
- [add taint](#add-taint)
|
||||||
@@ -43,6 +44,7 @@ Kubernetes is an open‑source platform that automates the deployment, scaling,
|
|||||||
- [Deployment - rollout restart](#deployment---rollout-restart)
|
- [Deployment - rollout restart](#deployment---rollout-restart)
|
||||||
- [Daemonset](#daemonset)
|
- [Daemonset](#daemonset)
|
||||||
- [Daemonset - rollout restart](#daemonset---rollout-restart)
|
- [Daemonset - rollout restart](#daemonset---rollout-restart)
|
||||||
|
- [services](#services)
|
||||||
- [certs](#certs)
|
- [certs](#certs)
|
||||||
- [list all certs](#list-all-certs)
|
- [list all certs](#list-all-certs)
|
||||||
- [get cert end date](#get-cert-end-date)
|
- [get cert end date](#get-cert-end-date)
|
||||||
@@ -537,6 +539,14 @@ envsubst < ./secret.yaml | kubectl apply -f -
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## annotations
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
kubectl annotate secret test-your-domain-tls \
|
||||||
|
-n test-namespace \
|
||||||
|
replicator.v1.mittwald.de/replicate-to="namespace-1,namespace-2" --overwrite
|
||||||
|
```
|
||||||
|
|
||||||
## nodes
|
## nodes
|
||||||
|
|
||||||
**Get nodes info:**
|
**Get nodes info:**
|
||||||
@@ -677,6 +687,19 @@ NAMESPACE="???"
|
|||||||
kubectl rollout restart daemonset $NAME -n $NAMESPACE
|
kubectl rollout restart daemonset $NAME -n $NAMESPACE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## services
|
||||||
|
|
||||||
|
**nuke finalizers:**
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
SERVICE="traefik"
|
||||||
|
NAMESPACE="traefik-public"
|
||||||
|
kubectl patch service ${SERVICE} \
|
||||||
|
-n ${NAMESPACE} \
|
||||||
|
--type=merge \
|
||||||
|
-p '{"metadata":{"finalizers":[]}}'
|
||||||
|
```
|
||||||
|
|
||||||
## certs
|
## certs
|
||||||
|
|
||||||
### list all certs
|
### list all certs
|
||||||
|
|||||||
+60
-9
@@ -9,22 +9,73 @@ AGE_FILE=age.agekey
|
|||||||
age-keygen -o ${AGE_FILE}
|
age-keygen -o ${AGE_FILE}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Create key and Import to kubernetes:**
|
**Example using sops decryption:**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: sample-sync
|
||||||
|
spec:
|
||||||
|
interval: 1m
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: git-repo-name
|
||||||
|
path: deploy/sample-app
|
||||||
|
prune: true
|
||||||
|
decryption:
|
||||||
|
provider: sops
|
||||||
|
secretRef:
|
||||||
|
name: flux-sops-age
|
||||||
|
```
|
||||||
|
|
||||||
|
**Importing sops private key:**
|
||||||
|
|
||||||
|
Using kustomization used by operator to deploy base fluxcd manifests for deployments and reconciliation.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
NAMESPACE=ns-name
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
AGE_FILE=deploy/flux/.env.d/age.agekey
|
kind: Kustomization
|
||||||
SECRET_NAME=flux-sops-age
|
namespace: your-namespace
|
||||||
|
resources:
|
||||||
|
- sample-app.yaml
|
||||||
|
secretGenerator:
|
||||||
|
- name: flux-sops-age
|
||||||
|
files:
|
||||||
|
- "age.agekey=./.env.d/age.agekey" #change to private key file path
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
```
|
||||||
|
|
||||||
# creates age key
|
**Import using kubectl:**
|
||||||
age-keygen -o ${AGE_FILE}
|
|
||||||
# imports to an namespace
|
```bash
|
||||||
cat ${AGE_FILE} |
|
SECRET_NAME="flux-sops-age"
|
||||||
|
NAMESPACE="your-namespace"
|
||||||
kubectl create secret generic ${SECRET_NAME} \
|
kubectl create secret generic ${SECRET_NAME} \
|
||||||
--namespace=${NAMESPACE} \
|
--namespace=${NAMESPACE} \
|
||||||
--from-file=age.agekey=/dev/stdin
|
--from-file=age.agekey=/dev/stdin #change to private key file path
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: sample-sync
|
||||||
|
spec:
|
||||||
|
interval: 1m
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: git-repo-name
|
||||||
|
path: deploy/sample-app
|
||||||
|
prune: true
|
||||||
|
decryption:
|
||||||
|
provider: sops
|
||||||
|
secretRef:
|
||||||
|
name: flux-sops-age
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## kustomization prune
|
## kustomization prune
|
||||||
|
|
||||||
**Disable:**
|
**Disable:**
|
||||||
|
|||||||
Reference in New Issue
Block a user