initial commit
This commit is contained in:
commit
36308ae891
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.DS_Store
|
||||
0
Dockerfile
Normal file
0
Dockerfile
Normal file
21
cmd/controller/main.go
Normal file
21
cmd/controller/main.go
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
|
||||
}
|
||||
33
docs/certificate.yaml
Normal file
33
docs/certificate.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
# Example ACME certificate using DNS
|
||||
apiVersion: certmanager.kubernetes.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: my-certificate
|
||||
spec:
|
||||
domains:
|
||||
- www.google.com
|
||||
acme:
|
||||
challenge: dns-01
|
||||
url: https://...
|
||||
email: test@example.com
|
||||
dns:
|
||||
clouddns: {}
|
||||
status:
|
||||
state: Pending
|
||||
---
|
||||
# Example ACME certificate using Ingress
|
||||
apiVersion: certmanager.kubernetes.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: my-certificate
|
||||
spec:
|
||||
domains:
|
||||
- www.google.com
|
||||
acme:
|
||||
challenge: http-01
|
||||
url: https://...
|
||||
email: test@example.com
|
||||
ingressRef:
|
||||
name: something
|
||||
status:
|
||||
state: Pending
|
||||
21
pkg/apis/certmanager/doc.go
Normal file
21
pkg/apis/certmanager/doc.go
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +groupName=certmanager.kubernetes.io
|
||||
|
||||
// Package api is the internal version of the API.
|
||||
package certmanager
|
||||
80
pkg/apis/certmanager/types.go
Normal file
80
pkg/apis/certmanager/types.go
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package certmanager
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// Certificate is a type to represent a Certificate from ACME
|
||||
type Certificate struct {
|
||||
metav1.TypeMeta
|
||||
metav1.ObjectMeta
|
||||
|
||||
Spec CertificateSpec
|
||||
Status CertificateStatus
|
||||
}
|
||||
|
||||
// CertificateSpec defines the desired state of Certificate
|
||||
type CertificateSpec struct {
|
||||
Domains []string
|
||||
|
||||
ProviderConfig
|
||||
}
|
||||
|
||||
// ProviderConfig is a wrapping struct for the different types of supported
|
||||
// providers configuration. In future, additional providers may be added here
|
||||
// (eg. cfssl, AWS etc)
|
||||
type ProviderConfig struct {
|
||||
ACME *ACME
|
||||
}
|
||||
|
||||
// ACME contains the configuration for the ACME certificate provider
|
||||
type ACME struct {
|
||||
Challenge ACMEChallengeType
|
||||
URL string
|
||||
Email string
|
||||
DNS *ACMEDNSConfig
|
||||
}
|
||||
|
||||
// ACMEChallengeType is the challenge type that should be used for ACME
|
||||
// challenge verifications
|
||||
type ACMEChallengeType string
|
||||
|
||||
var (
|
||||
// ACMEChallengeTypeHTTP01 is the ACME http-01 challenge type
|
||||
ACMEChallengeTypeHTTP01 ACMEChallengeType = "HTTP-01"
|
||||
// ACMEChallengeTypeDNS01 is the ACME dns-01 challenge type
|
||||
ACMEChallengeTypeDNS01 ACMEChallengeType = "DNS-01"
|
||||
// ACMEChallengeTypeTLSSNI01 is the ACME tls-sni-01 challenge type
|
||||
ACMEChallengeTypeTLSSNI01 ACMEChallengeType = "TLS-SNI-01"
|
||||
)
|
||||
|
||||
// ACMEDNSConfig is a structure containing the ACME DNS configuration option.
|
||||
// One and only one of the fields within it should be set, when the ACME
|
||||
// challenge type is set to dns-01
|
||||
type ACMEDNSConfig struct {
|
||||
CloudDNS *ACMEDNSConfigCloudDNS
|
||||
}
|
||||
|
||||
// ACMEDNSConfigCloudDNS is a structure containing the DNS configuration for
|
||||
// Google Cloud DNS
|
||||
type ACMEDNSConfigCloudDNS struct{}
|
||||
|
||||
// CertificateStatus defines the observed state of Certificate
|
||||
type CertificateStatus struct {
|
||||
}
|
||||
84
pkg/apis/certmanager/v1alpha1/types.go
Normal file
84
pkg/apis/certmanager/v1alpha1/types.go
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// +genclient=true
|
||||
// +k8s:openapi-gen=true
|
||||
// +resource:path=certificates,strategy=CertificateStrategy
|
||||
|
||||
// Certificate is a type to represent a Certificate from ACME
|
||||
type Certificate struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec CertificateSpec `json:"spec,omitempty"`
|
||||
Status CertificateStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// CertificateSpec defines the desired state of Certificate
|
||||
type CertificateSpec struct {
|
||||
Domains []string `json:"domains"`
|
||||
|
||||
ProviderConfig
|
||||
}
|
||||
|
||||
// ProviderConfig is a wrapping struct for the different types of supported
|
||||
// providers configuration. In future, additional providers may be added here
|
||||
// (eg. cfssl, AWS etc)
|
||||
type ProviderConfig struct {
|
||||
ACME *ACME `json:"acme"`
|
||||
}
|
||||
|
||||
// ACME contains the configuration for the ACME certificate provider
|
||||
type ACME struct {
|
||||
Challenge ACMEChallengeType `json:"challenge"`
|
||||
URL string `json:"url"`
|
||||
Email string `json:"email"`
|
||||
DNS *ACMEDNSConfig `json:"dns"`
|
||||
}
|
||||
|
||||
// ACMEChallengeType is the challenge type that should be used for ACME
|
||||
// challenge verifications
|
||||
type ACMEChallengeType string
|
||||
|
||||
var (
|
||||
// ACMEChallengeTypeHTTP01 is the ACME http-01 challenge type
|
||||
ACMEChallengeTypeHTTP01 ACMEChallengeType = "HTTP-01"
|
||||
// ACMEChallengeTypeDNS01 is the ACME dns-01 challenge type
|
||||
ACMEChallengeTypeDNS01 ACMEChallengeType = "DNS-01"
|
||||
// ACMEChallengeTypeTLSSNI01 is the ACME tls-sni-01 challenge type
|
||||
ACMEChallengeTypeTLSSNI01 ACMEChallengeType = "TLS-SNI-01"
|
||||
)
|
||||
|
||||
// ACMEDNSConfig is a structure containing the ACME DNS configuration option.
|
||||
// One and only one of the fields within it should be set, when the ACME
|
||||
// challenge type is set to dns-01
|
||||
type ACMEDNSConfig struct {
|
||||
CloudDNS *ACMEDNSConfigCloudDNS `json:"clouddns"`
|
||||
}
|
||||
|
||||
// ACMEDNSConfigCloudDNS is a structure containing the DNS configuration for
|
||||
// Google Cloud DNS
|
||||
type ACMEDNSConfigCloudDNS struct{}
|
||||
|
||||
// CertificateStatus defines the observed state of Certificate
|
||||
type CertificateStatus struct {
|
||||
}
|
||||
20
pkg/apis/doc.go
Normal file
20
pkg/apis/doc.go
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
//
|
||||
// +domain=kubernetes.io
|
||||
|
||||
package apis
|
||||
Loading…
Reference in New Issue
Block a user