alauda / captain

A Helm 3 Controller
Apache License 2.0
185 stars 46 forks source link

webhook certificate #39

Closed sbhnet closed 4 years ago

sbhnet commented 4 years ago

kubectl apply -f nginx.yml --insecure-skip-tls-verify=true Error from server (InternalError): error when creating "nginx.yml": Internal error occurred: failed calling webhook "mutate-helmrequest.app.alauda.io": Post https://captain-webhook.captain-system.svc:443/mutate?timeout=30s: x509: certificate signed by unknown authority

hangyan commented 4 years ago

Can you run kubectl get pods -n captain-system and post the results?

sbhnet commented 4 years ago

[root@k8s1 ~]# kubectl get pods -n captain-system NAME READY STATUS RESTARTS AGE captain-controller-manager-57b97bd84-wnxct 1/1 Running 0 169m

pod is Running

[root@k8s1 ~]# kubectl get svc --all-namespaces NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE captain-system captain-webhook ClusterIP 10.96.152.48 443/TCP,6060/TCP 170m

hangyan commented 4 years ago

That's odd. I just tested it and cannot reproduce this. Can you provide the output of kubectl logs -n captain-system captain-controller-manager-57b97bd84-wnxct -c cert-init

lin1005q commented 4 years ago

creating certs in tmpdir /tmp/tmp.HJPejo Generating RSA private key, 2048 bit long modulus (2 primes) ..+++++ ...................+++++ e is 65537 (0x010001) secret namespace is captain-system Error from server (AlreadyExists): secrets "captain-webhook-cert" already exists cert-created: "true" Secret synced, exit

hangyan commented 4 years ago

Try kubectl delete secret captain-webhook-cert kubectl delete pods captain-controller-manager-57b97bd84-wnxct -n captain-system .

This does not looks like a clean install

sbhnet commented 4 years ago

weihai4099 is my colleague secrets "captain-webhook-cert" already exists

sbhnet commented 4 years ago

kubectl delete secret captain-webhook-cert kubectl delete pods captain-controller-manager-57b97bd84-wnxct -n captain-system secret "captain-webhook-cert" deleted Error from server (NotFound): secrets "kubectl" not found Error from server (NotFound): secrets "delete" not found Error from server (NotFound): secrets "pods" not found Error from server (NotFound): secrets "captain-controller-manager-57b97bd84-wnxct" not found

hangyan commented 4 years ago

kubectl delete secret captain-webhook-cert kubectl delete pods captain-controller-manager-57b97bd84-wnxct -n captain-system

These are two sperated command.

sbhnet commented 4 years ago

[root@k8s1 ~]# kubectl delete secret captain-webhook-cert Error from server (NotFound): secrets "captain-webhook-cert" not found [root@k8s1 ~]# kubectl delete pods captain-controller-manager-57b97bd84-wnxct -n captain-system Error from server (NotFound): pods "captain-controller-manager-57b97bd84-wnxct" not found [root@k8s1 ~]# kubectl get pod -n captain-system NAME READY STATUS RESTARTS AGE captain-controller-manager-57b97bd84-6txts 1/1 Running 0 3m3s [root@k8s1 ~]# kubectl delete pods captain-controller-manager-57b97bd84-6txts -n captain-system pod "captain-controller-manager-57b97bd84-6txts" deleted

hangyan commented 4 years ago

Now wait for the new pods to be running and try again...

sbhnet commented 4 years ago

kubectl delete -n captain-system -f https://raw.githubusercontent.com/alauda/captain/master/artifacts/all/deploy.yaml

hangyan commented 4 years ago

要不你加我微信吧: qingyanyh

lin1005q commented 4 years ago

我重置了集群,部署了一个redis已经OK了 。就是想问一下怎样生成java的sdk了。 因为我这边使用的k8s 的官方java sdk。