Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ericsyh
Last active March 8, 2023 03:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericsyh/b0f1cd715a6d1b98f7eb2300ee397e12 to your computer and use it in GitHub Desktop.
Save ericsyh/b0f1cd715a6d1b98f7eb2300ee397e12 to your computer and use it in GitHub Desktop.
kubectl get secret root-secret -o=jsonpath='{.data.ca\.crt}' -n istio-system | base64 --decode -> ca.crt
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned-issuer
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: my-selfsigned-ca
namespace: istio-system
spec:
isCA: true
commonName: my-selfsigned-ca
secretName: root-secret
privateKey:
algorithm: ECDSA
size: 256
issuerRef:
name: selfsigned-issuer
kind: ClusterIssuer
group: cert-manager.io
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: ca-issuer
namespace: istio-system
spec:
ca:
secretName: root-secret
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-com
namespace: istio-system
spec:
secretName: httpbin-credential
duration: 2160h # 90d
renewBefore: 360h # 15d
subject:
organizations:
- jetstack
commonName: example.com
isCA: false
privateKey:
algorithm: RSA
encoding: PKCS1
size: 2048
usages:
- server auth
- client auth
dnsNames:
- '*.example.com'
issuerRef:
name: ca-issuer
kind: Issuer
group: cert-manager.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment