Documentation
¶
Index ¶
- Constants
- Variables
- func APIIngressForCommonWebUI(instance *operatorsv1alpha1.CommonWebUI) *netv1.Ingress
- func CallbackIngressForCommonWebUI(instance *operatorsv1alpha1.CommonWebUI) *netv1.Ingress
- func CommonConfigMapUI(instance *operatorsv1alpha1.LegacyHeader) *corev1.ConfigMap
- func GetNavConfigContent() map[string]apiextv1beta.JSONSchemaProps
- func GetPodNames(pods []corev1.Pod) []string
- func IngressForLegacyUI(instance *operatorsv1alpha1.LegacyHeader) *netv1.Ingress
- func IsDaemonSetEqual(oldDaemonSet, newDaemonSet *appsv1.DaemonSet) bool
- func IsIngressEqual(oldIngress, newIngress *netv1.Ingress) bool
- func IsServiceEqual(oldService, newService *corev1.Service) bool
- func LabelsForMetadata(deploymentName string) map[string]string
- func LabelsForPodMetadata(deploymentName string, crType string, crName string) map[string]string
- func LabelsForSelector(deploymentName string, crType string, crName string) map[string]string
- func Log4jsConfigMapUI(instance *operatorsv1alpha1.CommonWebUI) *corev1.ConfigMap
- func NavIngressForCommonWebUI(instance *operatorsv1alpha1.CommonWebUI) *netv1.Ingress
- func ReconcileDaemonSet(client client.Client, instanceNamespace string, daemonSetName string, ...) error
- func ReconcileIngress(client client.Client, instanceNamespace string, ingressName string, ...) error
- func ReconcileService(client client.Client, instanceNamespace string, serviceName string, ...) error
Constants ¶
const APIIngress = "common-web-ui-api"
const CallbackIngress = "common-web-ui-callback"
const ChartName = "webui-nav"
const ChartVersion = "1.0.2"
const ClusterCaVolumeName = "cluster-ca"
const CommonConfigMap = "common-web-ui-config"
const DaemonSetName = "common-web-ui"
const DefaultImageName = "common-web-ui"
const DefaultImageRegistry = "quay.io/opencloudio"
const DefaultImageTag = "1.1.0"
const LegacyImageName = "icp-platform-header"
const LegacyImageRegistry = "quay.io/opencloudio"
const LegacyImageTag = "3.2.4"
const LegacyReleaseName = "platform-header"
const Log4jsConfigMap = "common-web-ui-log4js"
const Log4jsVolumeName = "log4js"
const ReleaseName = "common-web-ui"
const ServiceName = "common-web-ui"
Variables ¶
var APIIngressAnnotations = map[string]string{
"kubernetes.io/ingress.class": "ibm-icp-management",
"icp.management.ibm.com/configuration-snippet": `
add_header 'X-XSS-Protection' '1' always;
add_header Content-Security-Policy "default-src 'none'; font-src 'unsafe-inline' 'self'; script-src 'unsafe-inline' 'self' blob: cdn.segment.com fast.appcues.com; connect-src 'self' https://api.segment.io wss://api.appcues.net https://notify.bugsnag.com; img-src * data:; frame-src 'self' https://my.appcues.com; style-src 'unsafe-inline' 'self' https://fast.appcues.com; frame-ancestors 'self'";`,
}
var CallbackIngressAnnotations = map[string]string{
"kubernetes.io/ingress.class": "ibm-icp-management",
"icp.management.ibm.com/upstream-uri": "/auth/liberty/callback",
}
var ClusterCaVolume = corev1.Volume{ Name: ClusterCaVolumeName, VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: "cs-ca-certificate-secret", Items: []corev1.KeyToPath{ { Key: "tls.key", Path: "ca.key", }, { Key: "tls.crt", Path: "ca.crt", }, }, Optional: &TrueVar, }, }, }
var CommonContainer = corev1.Container{ Image: "common-web-ui", Name: "common-web-ui", ImagePullPolicy: corev1.PullAlways, Resources: corev1.ResourceRequirements{ Limits: map[corev1.ResourceName]resource.Quantity{ corev1.ResourceCPU: *cpu300, corev1.ResourceMemory: *memory256}, Requests: map[corev1.ResourceName]resource.Quantity{ corev1.ResourceCPU: *cpu300, corev1.ResourceMemory: *memory256}, }, SecurityContext: &commonSecurityContext, ReadinessProbe: &corev1.Probe{ Handler: corev1.Handler{ HTTPGet: &corev1.HTTPGetAction{ Path: "/readinessProbe", Port: intstr.IntOrString{ Type: intstr.Int, IntVal: 3000, }, Scheme: "", }, }, InitialDelaySeconds: 100, TimeoutSeconds: 15, PeriodSeconds: 10, SuccessThreshold: 1, FailureThreshold: 3, }, LivenessProbe: &corev1.Probe{ Handler: corev1.Handler{ HTTPGet: &corev1.HTTPGetAction{ Path: "/livenessProbe", Port: intstr.IntOrString{ Type: intstr.Int, IntVal: 3000, }, Scheme: "", }, }, InitialDelaySeconds: 100, TimeoutSeconds: 5, PeriodSeconds: 30, SuccessThreshold: 1, FailureThreshold: 3, }, VolumeMounts: []corev1.VolumeMount{ { Name: Log4jsVolumeName, MountPath: "/etc/config", }, { Name: ClusterCaVolumeName, MountPath: "/opt/ibm/platform-header/certs", }, }, Env: []corev1.EnvVar{ { Name: "contextPath", Value: "/common-nav", }, { Name: "cfcRouterUrl", Value: "https://icp-management-ingress:443", }, { Name: "NODE_EXTRA_CA_CERTS", Value: " /opt/ibm/platform-header/certs/ca.crt", }, { Name: "PLATFORM_IDENTITY_PROVIDER_URL", Value: "https://icp-management-ingress:443/idprovider", }, { Name: "PLATFORM_AUTH_SERVICE_URL", Value: "https://icp-management-ingress:443/idauth", }, { Name: "NAV_PORT", Value: "8443", }, { Name: "OAUTH2_CLIENT_REGISTRATION_SECRET", ValueFrom: &corev1.EnvVarSource{ SecretKeyRef: &corev1.SecretKeySelector{ LocalObjectReference: corev1.LocalObjectReference{ Name: "platform-oidc-credentials", }, Key: "OAUTH2_CLIENT_REGISTRATION_SECRET", }, }, }, { Name: "CLOUDPAK_VERSION", Value: "1.0.0", }, { Name: "default_admin_user", Value: "admin", }, { Name: "CLUSTER_NAME", Value: "mycluster", }, { Name: "defaultAuth", Value: "", }, { Name: "enterpriseLDAP", Value: "", }, { Name: "enterpriseSAML", Value: "", }, { Name: "osAuth", Value: "", }, { Name: "SESSION_POLLING_INTERVAL", Value: "300", }, { Name: "ROKS_ENABLED", ValueFrom: &corev1.EnvVarSource{ ConfigMapKeyRef: &corev1.ConfigMapKeySelector{ LocalObjectReference: corev1.LocalObjectReference{ Name: "platform-auth-idp", }, Key: "ROKS_ENABLED", }, }, }, { Name: "WLP_CLIENT_ID", ValueFrom: &corev1.EnvVarSource{ SecretKeyRef: &corev1.SecretKeySelector{ LocalObjectReference: corev1.LocalObjectReference{ Name: "platform-oidc-credentials", }, Key: "WLP_CLIENT_ID", }, }, }, { Name: "WLP_CLIENT_SECRET", ValueFrom: &corev1.EnvVarSource{ SecretKeyRef: &corev1.SecretKeySelector{ LocalObjectReference: corev1.LocalObjectReference{ Name: "platform-oidc-credentials", }, Key: "WLP_CLIENT_SECRET", }, }, }, }, }
var CommonLegacyIngressAnnotations = map[string]string{
"kubernetes.io/ingress.class": "ibm-icp-management",
"icp.management.ibm.com/auth-type": "access-token",
"icp.management.ibm.com/configuration-snippet": `
add_header 'X-XSS-Protection' '1' always;
add_header Content-Security-Policy "default-src 'none'; font-src * 'unsafe-inline' 'self' data:; script-src 'unsafe-inline' 'self' blob: cdn.segment.com fast.appcues.com; connect-src 'self' https://api.segment.io wss://api.appcues.net https://notify.bugsnag.com; img-src * data:; frame-src 'self' https://my.appcues.com; style-src 'unsafe-inline' 'self' https://fast.appcues.com; frame-ancestors 'self'";`,
}
var CommonUIIngressAnnotations = map[string]string{
"kubernetes.io/ingress.class": "ibm-icp-management",
"icp.management.ibm.com/auth-type": "access-token",
"icp.management.ibm.com/app-root": "/common-nav?root=true",
"icp.management.ibm.com/configuration-snippet": `
add_header 'X-XSS-Protection' '1' always;
add_header Content-Security-Policy "default-src 'none'; font-src * 'unsafe-inline' 'self' data:; script-src 'unsafe-inline' 'self' blob: cdn.segment.com fast.appcues.com; connect-src 'self' https://api.segment.io wss://api.appcues.net https://notify.bugsnag.com; img-src * data:; frame-src 'self' https://my.appcues.com; style-src 'unsafe-inline' 'self' https://fast.appcues.com; frame-ancestors 'self'";`,
}
var CrTemplates = `` /* 10771-byte string literal not displayed */
nolint
var DeamonSetAnnotations = map[string]string{
"scheduler.alpha.kubernetes.io/critical-pod": "",
"productName": "IBM Cloud Platform Common Services",
"productID": "068a62892a1e4db39641342e592daa25",
"productVersion": "3.3.0",
"productMetric": "FREE",
}
var DefaultStatusForCR = []string{"none"}
var FalseVar = false
var Log4jsData = map[string]string{
"log4js.json": ` {
"appenders": {
"console": {
"type": "console",
"layout": {
"type": "pattern",
"pattern": "[%d] [%p] [webui-nav] [%c] %m"
}
}
},
"categories": {
"default": { "appenders": ["console"], "level": "info" },
"request": { "appenders": ["console"], "level": "error" },
"socket.io": { "appenders": ["console"], "level": "error" },
"status": { "appenders": ["console"], "level": "info" },
"watcher": { "appenders": ["console"], "level": "debug" },
"service-watcher": { "appenders": ["console"], "level": "error" },
"session-poller": { "appenders": ["console"], "level": "error" },
"service-discovery": { "appenders": ["console"], "level": "info" },
"service-account": { "appenders": ["console"], "level": "info" },
"version": { "appenders": ["console"], "level": "error" },
"user-mgmt-client": { "appenders": ["console"], "level": "error" },
"oidc-client": { "appenders": ["console"], "level": "error" },
"server": { "appenders": ["console"], "level": "info" },
"auth": { "appenders": ["console"], "level": "error" },
"logout": { "appenders": ["console"], "level": "error" },
"app": { "appenders": ["console"], "level": "error" },
"userMgmt": { "appenders": ["console"], "level": "error" },
"catalog-client": { "appenders": ["console"], "level": "error" },
"template": { "appenders": ["console"], "level": "error" }
}
}`,
}
var Log4jsVolume = corev1.Volume{ Name: Log4jsVolumeName, VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ LocalObjectReference: corev1.LocalObjectReference{ Name: "common-web-ui-log4js", }, Items: []corev1.KeyToPath{ { Key: "log4js.json", Path: "log4js.json", }, }, Optional: &TrueVar, }, }, }
var Replica1 int32 = 1
var Seconds60 int64 = 60
var TrueVar = true
Functions ¶
func APIIngressForCommonWebUI ¶
func APIIngressForCommonWebUI(instance *operatorsv1alpha1.CommonWebUI) *netv1.Ingress
func CallbackIngressForCommonWebUI ¶
func CallbackIngressForCommonWebUI(instance *operatorsv1alpha1.CommonWebUI) *netv1.Ingress
func CommonConfigMapUI ¶
func CommonConfigMapUI(instance *operatorsv1alpha1.LegacyHeader) *corev1.ConfigMap
func GetNavConfigContent ¶
func GetNavConfigContent() map[string]apiextv1beta.JSONSchemaProps
GetNavConfigContent returns all nav config crd content
func GetPodNames ¶
GetPodNames returns the pod names of the array of pods passed in
func IngressForLegacyUI ¶
func IngressForLegacyUI(instance *operatorsv1alpha1.LegacyHeader) *netv1.Ingress
func IsDaemonSetEqual ¶
Use DeepEqual to determine if 2 daemon sets are equal. Check labels, pod template labels, service account names, volumes, containers, init containers, image name, volume mounts, env vars, liveness, readiness. If there are any differences, return false. Otherwise, return true.
func IsIngressEqual ¶
Use DeepEqual to determine if 2 ingresses are equal. Check ObjectMeta and Spec. If there are any differences, return false. Otherwise, return true.
func IsServiceEqual ¶
Use DeepEqual to determine if 2 services are equal. Check ObjectMeta, Ports and Selector. If there are any differences, return false. Otherwise, return true.
func LabelsForMetadata ¶
returns the labels associated with the resource being created
func LabelsForPodMetadata ¶
returns the labels associated with the Pod being created
func LabelsForSelector ¶
returns the labels for selecting the resources belonging to the given metering CR name
func Log4jsConfigMapUI ¶
func Log4jsConfigMapUI(instance *operatorsv1alpha1.CommonWebUI) *corev1.ConfigMap
func NavIngressForCommonWebUI ¶
func NavIngressForCommonWebUI(instance *operatorsv1alpha1.CommonWebUI) *netv1.Ingress
func ReconcileDaemonSet ¶
func ReconcileDaemonSet(client client.Client, instanceNamespace string, daemonSetName string, newDaemonSet *appsv1.DaemonSet, needToRequeue *bool) error
Check if a DaemonSet already exists. If not, create a new one.
Types ¶
This section is empty.