Skip to content

Commit

Permalink
Renaming source code and manifests (#45)
Browse files Browse the repository at this point in the history
Related to #44
  • Loading branch information
prometherion authored Jan 1, 2021
1 parent 38ac24f commit 1419f46
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ COPY go.sum go.sum
RUN go mod download
COPY main.go main.go
COPY internal internal
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o capsule-ns-filter main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o capsule-proxy main.go

FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/capsule-ns-filter .
COPY --from=builder /workspace/capsule-proxy .
USER nonroot:nonroot

ENTRYPOINT ["/capsule-ns-filter"]
ENTRYPOINT ["/capsule-proxy"]
14 changes: 7 additions & 7 deletions deploy/sidecar-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ spec:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: ns-filter
image: quay.io/clastix/capsule-ns-filter
- name: proxy
image: quay.io/clastix/capsule-proxy
imagePullPolicy: Always
command:
- /capsule-ns-filter
- /capsule-proxy
- --k8s-control-plane-url=https://kubernetes.default.svc
- --capsule-user-group=capsule.clastix.io
- --zap-devel
Expand All @@ -85,7 +85,7 @@ spec:
- --ssl-cert-path=/opt/certs/tls.crt
- --ssl-key-path=/opt/certs/tls.key
volumeMounts:
- name: ns-filter-certs
- name: proxy-certs
mountPath: /opt/certs
ports:
- containerPort: 9001
Expand Down Expand Up @@ -128,9 +128,9 @@ spec:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
- name: ns-filter-certs
- name: proxy-certs
secret:
secretName: ns-filter-certs
secretName: proxy-certs
- name: tmp-volume
emptyDir: {}
- name: kubeconfig
Expand Down Expand Up @@ -235,6 +235,6 @@ data:
tls.key: REDACTED
kind: Secret
metadata:
name: ns-filter-certs
name: proxy-certs
namespace: kubernetes-dashboard
type: Opaque
36 changes: 18 additions & 18 deletions deploy/standalone-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: ns-filter
name: proxy
namespace: capsule-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: ns-filter
name: proxy
labels:
run: ns-filter
run: proxy
subjects:
- kind: ServiceAccount
name: ns-filter
name: proxy
namespace: capsule-system
roleRef:
kind: ClusterRole
Expand All @@ -24,33 +24,33 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: ns-filter
name: ns-filter
run: proxy
name: proxy
namespace: capsule-system
spec:
replicas: 1
selector:
matchLabels:
run: ns-filter
run: proxy
template:
metadata:
labels:
run: ns-filter
run: proxy
spec:
restartPolicy: Always
serviceAccountName: ns-filter
serviceAccountName: proxy
hostNetwork: false
volumes:
- configMap:
defaultMode: 420
name: certs
name: certs
containers:
- name: ns-filter
image: quay.io/clastix/capsule-ns-filter
- name: proxy
image: quay.io/clastix/capsule-proxy
imagePullPolicy: IfNotPresent
command:
- /capsule-ns-filter
- /capsule-proxy
- --k8s-control-plane-url=https://kubernetes.default.svc
- --capsule-user-group=capsule.clastix.io
- --zap-log-level=5
Expand Down Expand Up @@ -85,25 +85,25 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: ns-filter
name: proxy
namespace: capsule-system
labels:
run: ns-filter
run: proxy
spec:
ports:
- protocol: TCP
port: 9001
targetPort: 9001
selector:
run: ns-filter
run: proxy
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
namespace: capsule-system
name: ns-filter
name: proxy
labels:
run: ns-filter
run: proxy
annotations:
ingress.kubernetes.io/ssl-passthrough: "true"
spec:
Expand All @@ -113,7 +113,7 @@ spec:
paths:
- path: /
backend:
serviceName: ns-filter
serviceName: proxy
servicePort: 9001
---
apiVersion: v1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/clastix/capsule-ns-filter
module github.com/clastix/capsule-proxy

go 1.13

Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/clastix/capsule-ns-filter/internal/options"
req "github.com/clastix/capsule-ns-filter/internal/request"
"github.com/clastix/capsule-proxy/internal/options"
req "github.com/clastix/capsule-proxy/internal/request"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/clastix/capsule-ns-filter/internal/options"
"github.com/clastix/capsule-ns-filter/internal/webserver"
"github.com/clastix/capsule-proxy/internal/options"
"github.com/clastix/capsule-proxy/internal/webserver"
)

var (
Expand All @@ -38,8 +38,8 @@ func main() {
capsuleUserGroup := flag.String("capsule-user-group", "capsule.clastix.io", "The Capsule User Group eligible to create Namespace for Tenant resources (default: capsule.clastix.io)")
usernameClaimField := flag.String("oidc-username-claim", "preferred_username", "The OIDC field name used to identify the user (default: preferred_username)")
bindSsl := flag.Bool("enable-ssl", false, "Enable the bind on HTTPS for secure communication (default: false)")
certPath := flag.String("ssl-cert-path", "/opt/capsule-ns-filter/tls.crt", "Path to the TLS certificate (default: /opt/capsule-ns-filter/tls.crt)")
keyPath := flag.String("ssl-key-path", "/opt/capsule-ns-filter/tls.key", "Path to the TLS certificate key (default: /opt/capsule-ns-filter/tls.key)")
certPath := flag.String("ssl-cert-path", "/opt/capsule-proxy/tls.crt", "Path to the TLS certificate (default: /opt/capsule-proxy/tls.crt)")
keyPath := flag.String("ssl-key-path", "/opt/capsule-proxy/tls.key", "Path to the TLS certificate key (default: /opt/capsule-proxy/tls.key)")

opts := zap.Options{
EncoderConfigOptions: append([]zap.EncoderConfigOption{}, func(config *zapcore.EncoderConfig) {
Expand Down

0 comments on commit 1419f46

Please sign in to comment.