This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add k8s resources, restructure flags and add Circle / Architect (#16)
* Restructure flags to follow g8s naming convention. * Deployment and configmap and updated readme with how to create the secret * Save certificates as k8s secrets and implement delete watch (#15) * addFunc saves the certificate as a k8s secret * deleteFunc deletes the k8s secret that stores the certificate * Creating and deleting secrets should both be idempotent * Label the secret with clusterComponent received from the TPO * Updated certificatetpr dev * Restructure flags to follow g8s naming convention. * Deployment and configmap and updated readme with how to create the secret * Fix Vault flag structure * Fix typo in Vault token error message * Fix secret name and the quoting of the CLI args * Add Circle CI for architect builds * TLS.CertFile should be TLS.CrtFile
- Loading branch information
Showing
25 changed files
with
235 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
machine: | ||
services: | ||
- docker | ||
|
||
dependencies: | ||
override: | ||
- | | ||
wget -q $(curl -sS -H "Authorization: token $RELEASE_TOKEN" https://api.github.com/repos/giantswarm/architect/releases/latest | grep browser_download_url | head -n 1 | cut -d '"' -f 4) | ||
- chmod +x ./architect | ||
- ./architect version | ||
|
||
test: | ||
override: | ||
- ./architect build --golang-version=1.8.0 | ||
|
||
deployment: | ||
master: | ||
branch: master | ||
commands: | ||
- ./architect deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
flag/kubernetes/kubernetes.go → flag/service/kubernetes/kubernetes.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package tls | ||
|
||
type TLS struct { | ||
CAFile string | ||
CrtFile string | ||
KeyFile string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package service | ||
|
||
import ( | ||
"github.com/giantswarm/cert-operator/flag/service/kubernetes" | ||
"github.com/giantswarm/cert-operator/flag/service/vault" | ||
) | ||
|
||
type Service struct { | ||
Kubernetes kubernetes.Kubernetes | ||
Vault vault.Vault | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/giantswarm/cert-operator/flag/service/vault/config/pki" | ||
) | ||
|
||
type Config struct { | ||
Address string | ||
Token string | ||
|
||
PKI pki.PKI | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package ca | ||
|
||
type CA struct { | ||
TTL string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package commonname | ||
|
||
type CommonName struct { | ||
Format string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package pki | ||
|
||
import ( | ||
"github.com/giantswarm/cert-operator/flag/service/vault/config/pki/ca" | ||
"github.com/giantswarm/cert-operator/flag/service/vault/config/pki/commonname" | ||
) | ||
|
||
type PKI struct { | ||
CA ca.CA | ||
CommonName commonname.CommonName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package ca | ||
|
||
type CA struct { | ||
TTL string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package commonname | ||
|
||
type CommonName struct { | ||
Format string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package pki | ||
|
||
import ( | ||
"github.com/giantswarm/cert-operator/flag/service/vault/pki/ca" | ||
"github.com/giantswarm/cert-operator/flag/service/vault/pki/commonname" | ||
) | ||
|
||
type PKI struct { | ||
CA ca.CA | ||
CATTL string | ||
CommonName commonname.CommonName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package vault | ||
|
||
import ( | ||
"github.com/giantswarm/cert-operator/flag/service/vault/config" | ||
) | ||
|
||
type Vault struct { | ||
Config config.Config | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cert-operator-configmap | ||
namespace: giantswarm | ||
data: | ||
config.yml: | | ||
server: | ||
listen: | ||
address: 'http://0.0.0.0:8000' | ||
service: | ||
vault: | ||
config: | ||
address: 'https://leaseweb-vault-private.giantswarm.io:8200' | ||
pki: | ||
ca: | ||
ttl: '86400h' | ||
commonname: | ||
format: '%s.g8s.fra-1.giantswarm.io' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: cert-operator | ||
namespace: giantswarm | ||
labels: | ||
app: cert-operator | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: cert-operator | ||
spec: | ||
volumes: | ||
- name: cert-operator-configmap | ||
configMap: | ||
name: cert-operator-configmap | ||
items: | ||
- key: config.yml | ||
path: config.yml | ||
- name: cert-operator-secret | ||
secret: | ||
secretName: cert-operator-secret | ||
items: | ||
- key: secret.yml | ||
path: secret.yml | ||
- name: certs | ||
hostPath: | ||
path: /etc/ssl/certs/ca-certificates.crt | ||
containers: | ||
- name: cert-operator | ||
image: registry.giantswarm.io/giantswarm/cert-operator:%%DOCKER_TAG%% | ||
volumeMounts: | ||
- name: cert-operator-configmap | ||
mountPath: /var/run/cert-operator/configmap/ | ||
- name: cert-operator-secret | ||
mountPath: /var/run/cert-operator/secret/ | ||
- name: certs | ||
mountPath: /etc/ssl/certs/ca-certificate.crt | ||
ports: | ||
- name: http | ||
containerPort: 8000 | ||
args: | ||
- daemon | ||
- --config.dirs="/var/run/cert-operator/configmap/ /var/run/cert-operator/secret/" | ||
- --config.files="config secret" | ||
imagePullSecrets: | ||
- name: circleci-giantswarm-registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.